Hmm..but thats what i have been doing maybe its the version which version are u guys using, i have version 1.5 and when i hook present it draws on the screen but then after a few mins or when i try to join a game the game exits, any ideas?
oh and one more question do i have to hook something before i hook present and reset because i keep on getting the impression that im supposed to do that..?
And Finally are vtables detected, something like:
Code:
void APIENTRY HookAPI(LPVOID param)
{
DWORD hD3D, adr, *vTable;
hD3D=0;
do {
hD3D = (DWORD)GetModuleHandleA("d3d9.dll");
Sleep(25);
} while(!hD3D);
adr = FindPattern(hD3D, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
if(adr){
memcpy(&vTable,(void *)(adr+2),4);
oPresent = (HRESULT (WINAPI *)(LPDIRECT3DDEVICE9 pDevice, CONST RECT* pSourceRect,CONST RECT* pDestRect, HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion))(DetourFunction((PBYTE)vTable[17],(PBYTE)dPresent));
//oEndScene = (HRESULT (WINAPI *)(LPDIRECT3DDEVICE9 pDevice))(DetourFunction((PBYTE)vTable[42],(PBYTE)dEndScene));
//oReset = (HRESULT (WINAPI *)(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters))(DetourFunction((PBYTE)vTable[16],(PBYTE)dReset));
}
else
MessageBoxA(NULL,"~Shit", "Hook", MB_OK);
};
What exactly is detected in that code is it the vtable or is it the actual detour function?
Please Help
Thanks,
Konsowa