| 16 | int g_methodHookCount = 0; |
| 17 | |
| 18 | void* 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 | |
| 29 | void enableMethodHook(void* hookHandle) |
| 30 | { |
nothing calls this directly
no outgoing calls
no test coverage detected