Zeex / subhook

Simple hooking library for C/C++ (x86 only, 32/64-bit, no dependencies)
BSD 2-Clause "Simplified" License
800 stars 124 forks source link

x64 trampolines rarely working #53

Open jdbool opened 3 years ago

jdbool commented 3 years ago

This is with v0.8.1, same issue as #15 and #43.

I'm hooking 42 functions in an x64 Linux binary. If I look at the output of GetTrampoline() on every hook after it's installed, 12 of them have trampolines, and the other 30 do not (nullptr).

I'm using subhook::HookFlags::HookFlag64BitOffset, I tried it without as well and the hooks didn't install properly.

The hooks of course work fine without using trampolines, but some of the functions are called very frequently so it would be nice to eliminate all the copying if possible.

Hyjarion commented 2 years ago

Confirmed. I had to switch to MinHook due to this.