Jump to content
Tuts 4 You
DragonX

[Help] about hookjit and ilcode compile

Rate this topic

Recommended Posts

DragonX

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

Share this post


Link to post
Share on other sites
DragonX

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

Share this post


Link to post
Share on other sites

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