Posted February 19, 20169 yr hook compileMethod like this HMODULE hJitMod = LoadLibrary(_T("mscorjit.dll")); if (!hJitMod) return; p_getJit = (ULONG_PTR *(__stdcall *)()) GetProcAddress(hJitMod, "getJit"); if (p_getJit) { JIT *pJit = (JIT *)*((ULONG_PTR *)p_getJit()); if (pJit) { DWORD OldProtect; VirtualProtect(pJit, sizeof(ULONG_PTR), PAGE_READWRITE, &OldProtect); compileMethod = pJit->compileMethod; pJit->compileMethod = &my_compileMethod; VirtualProtect(pJit, sizeof(ULONG_PTR), OldProtect, &OldProtect); bHooked = TRUE; } } .but how to hook the jitNativeCode and Compiler::compCompile method....
Create an account or sign in to comment