Skip to content

Instantly share code, notes, and snippets.

@CyberShadow
Created April 16, 2010 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CyberShadow/368936 to your computer and use it in GitHub Desktop.
Save CyberShadow/368936 to your computer and use it in GitHub Desktop.
madCodeHook method hooking example
class MyObject;
int (MyObject::*origFunction)(int);
class MyObject
{
public:
int funcHandler(int param)
{
// do hooked stuff
return (this->*origFunction)(param);
}
};
// ...
int (MyObject::*handler)(int) = &MyObject::funcHandler;
HookCode((void*)0x??????, *(void**)&handler, &origFunction);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment