MCPcopy Create free account
hub / github.com/aliasIsolation/aliasIsolation / hookMethod

Function hookMethod

src/dll/methodHook.cpp:18–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16int g_methodHookCount = 0;
17
18void* hookMethod(void** vtbl, int fnIndex, void* newFn, void** oldFn)
19{
20 if (g_methodHookCount >= MaxHooks) DebugBreak();
21 HookData& hd = g_methodHooks[g_methodHookCount++];
22 hd.vtblEntryPtr = vtbl + fnIndex;
23 hd.newFn = newFn;
24 MH_CHECK(MH_CreateHook(*hd.vtblEntryPtr, newFn, &hd.oldFn));
25 *oldFn = hd.oldFn;
26 return &hd;
27}
28
29void enableMethodHook(void* hookHandle)
30{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected