D3D Device Pointer Finder
One Simple function to find d3d8 to d3d9 device pointer...
Code:
DWORD_PTR * FindDevice(VOID)
{
DWORD Base = (DWORD)LoadLibraryW(L"d3d8.dll");
for(DWORD i = 0; i < 0x128000; i++ )
{
if ( (*(BYTE *)(Base+i+0x00))==0xC7
&& (*(BYTE *)(Base+i+0x01))==0x06
&& (*(BYTE *)(Base+i+0x06))==0x89
&& (*(BYTE *)(Base+i+0x07))==0x86
&& (*(BYTE *)(Base+i+0x0C))==0x89
&& (*(BYTE *)(Base+i+0x0D))==0x86 )
return (DWORD_PTR *)(Base + i + 2);
}
return NULL;
}
How To Use:
Code:
DWORD_PTR * VtablePtr = FindDevice();
if (VtablePtr = NULL )
{
MessageBoxW(L"Device Not Found !",0,0,0);
ExitProcess(0); //or it will crash anyway
}
DWORD_PTR * VTable ;
*(DWORD_PTR *)&VTable = *(DWORD_PTR *)VtablePtr;
//and then
Vtable[35];//endscene
Credits: Croner (another forum...but this looked useful so i posted it)
fix it: d3d8.dll to d3d9.dll
More simple using a sign? or not
Anyway GJ
i have no idea, i haven't tried this yet lol
Debating whether i should move too the Directx programing section..
So this will not work on D3d9 games?
i bet this is easily updatable to work with DX9
It works good for dx9 and as you can clearly see it uses pattern,dx9 or dx8 it works good aswell they are the same