D3D Device Pointer Finder

Posts 1–15 of 16 · Page 1 of 2
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)
Quote Originally Posted by Moothew =^_^= View Post
fix it: d3d8.dll to d3d9.dll
my bad...lol fixed
More simple using a sign? or not
Anyway GJ
Quote Originally Posted by coogle007 View Post
More simple using a sign? or not
Anyway GJ
this will work for all d3d9 games though.
If you were using a sig you would need to find new bytes.
i have no idea, i haven't tried this yet lol
Quote Originally Posted by supercarz1991 View Post
i have no idea, i haven't tried this yet lol
me neither/
To bad its for Directx 8
Debating whether i should move too the Directx programing section..
So this will not work on D3d9 games?
Should delete thread.
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
Quote Originally Posted by assault833 View Post
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
Quote Originally Posted by whatup777 View Post
DX 8 != DX 9
and isn't this just findpattern using a different method?
Posts 1–15 of 16 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us