https://github.com/Batchhh/libspecter/releases/tag/v1.0.6 Download latest and then you can do something like:
using AddRecoil_t = void (*)(void *self, float amount);
static uint64_t g_addRecoilBrk = 0;
static AddRecoil_t orig_AddRecoil = nullptr;
void hook_AddRecoil(void *self, float amount) {
if (orig_AddRecoil) {
CHECK(mem_brk_suspend_self());
orig_AddRecoil(self, amount);
CHECK(mem_brk_resume_self());
}
}
void install() {
CHECK(mem_init("UnityFramework", nullptr));
CHECK(mem_brk_install(0x123,
reinterpret_cast<uintptr_t>(hook_AddRecoil),
&g_addRecoilBrk));
uintptr_t absolute = 0;
CHECK(mem_brk_target(g_addRecoilBrk, &absolute));
orig_AddRecoil = reinterpret_cast<AddRecoil_t>(absolute);
}