hooking C++ methods
Posted: Fri Aug 18, 2017 8:37 pm
Hello,
I have been playing with MadCodeHook trying to hook methods in a C++ class in a 32 bit application.
In 32 bits, the usual "__thiscall" calling convention will require handcrafted assembly to recover the "this" pointer passed by ecx and pass it on to the "next hook".
I can declare the handler/nexthook as class members and follow the technique shown here viewtopic.php?t=66.
I am curious if this is still the recommended way, or if the library has changed since then and you recommend a different method.
Thanks,
dgmax
I have been playing with MadCodeHook trying to hook methods in a C++ class in a 32 bit application.
In 32 bits, the usual "__thiscall" calling convention will require handcrafted assembly to recover the "this" pointer passed by ecx and pass it on to the "next hook".
I can declare the handler/nexthook as class members and follow the technique shown here viewtopic.php?t=66.
I am curious if this is still the recommended way, or if the library has changed since then and you recommend a different method.
Thanks,
dgmax