All pastes #441664 Raw Edit

Untitled

public text v1 · immutable
·published 2007-04-15 20:18 UTC
rendered paste body
vm_t *(*pVM_Create)( const char *module, intptr_t (*systemCalls)(intptr_t *), 
				vmInterpret_t interpret );
vm_t *oVM_Create( const char *module, intptr_t (*systemCalls)(intptr_t *), 
				vmInterpret_t interpret )
{
return pVM_Create(module, systemCalls, interpret);
}

BOOL WINAPI DllMain(  HINSTANCE hinstDLL,  DWORD fdwReason,  LPVOID lpvReserved)
{
	if(fdwReason==DLL_PROCESS_ATTACH)
	{
		pVM_Create = (vm_t *(__cdecl *)(const char *,intptr_t (__cdecl *)(intptr_t *),vmInterpret_t))\
			DetourFunction((PBYTE)0x00474EBE, (PBYTE)oVM_Create);
	}
	return 1;
}