Hey all, i found a new hook somewhere on another website so, here is it
PTC:
Code:
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
If dwReason == DLL_PROCESS_ATTACH Then
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)D3D_Hook, NULL, NULL, NULL);
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)HACKthread, NULL, NULL, NULL);
_End
return TRUE;
}
MENU:
Code:
Integer D3D_Hook(void)
{
DWORD *vtbl;
DWORD hD3D=0;
do {
hD3D = (DWORD)GetModuleHandleA("d3d9.dll");
Sleep(200);
} while(!hD3D);
DWORD adr = FindPattern(hD3D, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
If adr Then
memcpy(&vtbl,(void *)(adr+2),4);
pReset = (oReset) DetourFunction((PBYTE)vtbl[RESET] , (PBYTE)myReset );
pPresent = (oPresent) DetourFunction((PBYTE)vtbl[PRESENT] , (PBYTE)myPresent );
pBeginScene = (oBeginScene) DetourFunction((PBYTE)vtbl[BEGINSCENE] , (PBYTE)myBeginScene );
pEndScene = (oEndScene) DetourFunction((PBYTE)vtbl[ENDSCENE] , (PBYTE)myEndScene );
pDrawIndexedPrimitive = (DrawIndexedPrimitive_)DetourFunction((PBYTE)vtbl[82],(PBYTE)nDrawIndexedPrimitive);
_End
CreateThread(NULL, NULL, HACKthread, NULL, NULL, NULL);
return 0;
}
Credits: I'm not allowed to advertise, so no credits :P