[Request]What is the D3D Device Pointer

Posts 1–8 of 8 · Page 1 of 1
[Request]What is the D3D Device Pointer
Can anyone tell me what the D3D Device Pointer is of this D3D Test Environment, I've found a few but they don't work. And I need someone who knows for sure that it's the pointer, so I can verify I was correct.

Thanks in advance

Edit: Realized after I posted how scummy this looks, you don't have to run the file... Just want the d3d device pointer.

~lilneo
Quote Originally Posted by lilneo View Post
Can anyone tell me what the D3D Device Pointer is of this D3D Test Environment, I've found a few but they don't work. And I need someone who knows for sure that it's the pointer, so I can verify I was correct.

Thanks in advance

Edit: Realized after I posted how scummy this looks, you don't have to run the file... Just want the d3d device pointer.

~lilneo
Probably will need at least 1 scan
Then scan it T.T, it's just the d3d9 test environment Void posted a while back.
~lilneo
This works for all DirectX 9 devices - I've posted it before.

[php]
bool bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
{
for( ; *szMask; ++szMask, ++pData, ++bMask)
if(*szMask == 'x' && *pData != *bMask)
return false;
return (*szMask) == NULL;
}


DWORD FindPattern(DWORD dValor,DWORD dLer,BYTE *bMaskara,char * szMaskara)
{
for (DWORD i=0; i < dLer; i++)
if (bCompare((PBYTE)(dValor + i), bMaskara, szMaskara))
return (DWORD)(dValor + i);
return false;
}

DWORD dwDXDevice = FindPattern((DWORD)GetModuleHandle("d3d9.dll"), 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x 00\x00\x89\x86", "xx????xx????xx");

[/php]
The virtual table functions can be found by adding 2 to the device pointer (ie, (dwDXDevice + 2))

Not sure who made the bCompare and FindPattern functions, but credits to them.

--

How are you trying to hook it - that may be your problem.
Its on the environment itself. The address is right there where u run the environment. You don't even need to search for it if you don't want to.
The way I do it is set a breakpoint on IDirect3D::CreateDevice and check the stack window in olly for the device, since one of the parameters is the device itself.
Quote Originally Posted by freedompeace View Post
This works for all DirectX 9 devices - I've posted it before.

[php]
bool bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
{
for( ; *szMask; ++szMask, ++pData, ++bMask)
if(*szMask == 'x' && *pData != *bMask)
return false;
return (*szMask) == NULL;
}


DWORD FindPattern(DWORD dValor,DWORD dLer,BYTE *bMaskara,char * szMaskara)
{
for (DWORD i=0; i < dLer; i++)
if (bCompare((PBYTE)(dValor + i), bMaskara, szMaskara))
return (DWORD)(dValor + i);
return false;
}

DWORD dwDXDevice = FindPattern((DWORD)GetModuleHandle("d3d9.dll"), 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x 00\x00\x89\x86", "xx????xx????xx");

[/php]
The virtual table functions can be found by adding 2 to the device pointer (ie, (dwDXDevice + 2))

Not sure who made the bCompare and FindPattern functions, but credits to them.

--

How are you trying to hook it - that may be your problem.
I am using Void's hooking code, http://www.mpgh.net/forum/31-c-c/125...3ddevice9.html

Quote Originally Posted by why06 View Post
Its on the environment itself. The address is right there where u run the environment. You don't even need to search for it if you don't want to.
It said Device... I didn't think it meant the pointer?


Quote Originally Posted by Void View Post
The way I do it is set a breakpoint on IDirect3D::CreateDevice and check the stack window in olly for the device, since one of the parameters is the device itself.
But how do you find IDirect3D::CreateDevice? Or are you using the command line? Like
Code:
bp IDrect3D::CreateDevice
Okay, so I tried the hook with the "d3ddev" given inside the app, and it just crashes too.
~lilneo
Okay so the pointer was posted with the initial post of this environment, failme. It was also the pointer in Void's hooking code. The pointer is 0x40CE08, is anyone able to tell me how I could get to this pointer?

Also, when I use the code Void posted, to hook the test environment. It says Hooked, then crashes.

~lilneo
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us