View Full Version : [OB] D3D Device Pointer
Stiffler
07-01-2010, 07:06 AM
Hey everybody,
Im looking for the D3D Device pointer from the new Orange Box Engine. Could you post it or tell me how to search for it ?
Thanks a lot
freax
07-01-2010, 07:38 AM
You can use even the old methods since you do a sigscan in d3dx.dll, not in any game dll. And d3dx.dll didn't change, so you can use old sigs / addresses.
Hf
Stiffler
07-01-2010, 08:41 AM
And may I ask for a link of such a thread ? Thanks!
freax
07-01-2010, 08:57 AM
typedef HRESULT (__stdcall *DrawIndexedPrimitive_t)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);
void *pD3DDLL = pTools->ScanSignature((unsigned long)GetModuleHandle("d3d9.dll"), 0x128000, (unsigned char*)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx") + 0x2;
unsigned long *pdwVMT = NULL;
memcpy(&pdwVMT, (void*)pD3DDLL, 4);
this->m_pDrawIndexedPrimitive = (DrawIndexedPrimitive_t)DetourFunction((unsigned char*)pdwVMT[82], (unsigned char*)COtherHooks::DrawIndexedPrimitive);
Do this in HudUpdate once.
HRESULT __stdcall COtherHooks::DrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount)
{
//grab device pointer here
return pOtherHooks->m_pDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
}
learn_more
07-01-2010, 09:26 AM
And may I ask for a link of such a thread ? Thanks!
and why exactly should someone else search for it?
you want it.....
Stiffler
07-01-2010, 10:22 AM
typedef HRESULT (__stdcall *DrawIndexedPrimitive_t)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);
void *pD3DDLL = pTools->ScanSignature((unsigned long)GetModuleHandle("d3d9.dll"), 0x128000, (unsigned char*)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx") + 0x2;
unsigned long *pdwVMT = NULL;
memcpy(&pdwVMT, (void*)pD3DDLL, 4);
this->m_pDrawIndexedPrimitive = (DrawIndexedPrimitive_t)DetourFunction((unsigned char*)pdwVMT[82], (unsigned char*)COtherHooks::DrawIndexedPrimitive);
Do this in HudUpdate once.
HRESULT __stdcall COtherHooks::DrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount)
{
//grab device pointer here
return pOtherHooks->m_pDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
}
Alright, thanks but this sig actually is a normal d3d dip hook which doesnt use the game´s d3d pointer.
freax
07-01-2010, 11:57 AM
Of course this is the games d3d pointer. All the models and objects are drawn through DrawIndexedPrimitive, and because of that, you can be sure that this is the original game pointer...
Powered by vBulletin® Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.