fcccode / vmthook

Extremely basic virtual method table hooking class.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vmthook

Basic class for hooking virtual methods.

Example

/* define target function prototype */
typedef void (*FrameStageNotify)(void*, ClientFrameStage_t);

/* hook function in clientdll virtual method table */
clienthook = new VMTHook(clientdll);
clienthook->HookFunction((void*)hkFrameStageNotify, 36);
void hkFrameStageNotify(void* thisptr, ClientFrameStage_t Stage) {
    /* call the original function inside our hook */
    clienthook->GetOriginalFunction<FrameStageNotify>(36)(thisptr, Stage);
}

About

Extremely basic virtual method table hooking class.

License:GNU General Public License v2.0


Languages

Language:C++ 100.0%