Closed no-realm closed 7 years ago
This is because polyhook utilizes trampolines which copy the original bytes of the function that are overwritten by our hook into a newly allocated executable memory region. A pointer to this copy is returned, instead of the "original". It is labeled "getoriginal" because if you execute that copy the execution eventually lands back to the original, performing the operation the user wanted (from a functional point of view). But i see you already figured this out as you closed it yourself.
Hey there,
I am having some issues with PolyHook. When I try hooking a particular function, the trampoline memory region doesn't seem to get allocated. The PolyHook output shows the fixed trampoline, but when I go to the trampoline address, the region isn't allocated. The original function also doesn't get patched.
PolyHook output:
Additionally, when I try including "PolyHook.hpp" in more than one file, I get linking errors (something with 'already defined'). This also happens when I put the include in my Includes.h or stdafx.h file.