Jump to content
Tuts 4 You

[Help] about hookjit and ilcode compile


DragonX

Recommended Posts

Posted

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....

  • Like 1
Posted

looks like nobody want talk with this...:wacko:

  • Sad 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...