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
hooking C++ methods
Re: hooking C++ methods
I'm not sure. Maybe you can do something with "__thiscall"? I never really had the need to hook a C++ class, yet, so I didn't really try myself. I did hook some interfaces, like Direct3D, but they're WINAPI/stdcall, which makes things a lot easier.