[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
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.
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