Okay..
i'm hooking DIP with Croner's B8 Detour (don't know if i should post here anyways it works).
Code:
DWORD DIP = vtbl[82];
pDrawIndexedPrimitive = (oDrawIndexedPrimitive) DetourCreateB8((DWORD)DIP, (DWORD)myDrawIndexedPrimitive, 7);
Then i start another function for my rehook:
Code:
while(true)
{
if(memcmp((void *)DIP,(void*)*private,*private*) == 0 )
{
pDrawIndexedPrimitive = (oDrawIndexedPrimitive) DetourCreateB8((DWORD)DIP, (DWORD)myDrawIndexedPrimitive, 7);
}
Sleep(500);
}
Rehook works ..
So my DIP:
Code:
HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE pType D3DparamX ,UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount )
{
if(color == false)
{
GenerateTexture1(pDevice, &txtRed, texRed); // textures for chams
GenerateTexture1(pDevice, &txtGreen, texGreen);
color = true;
}
if(pDevice->GetStreamSource(0, &StreamBuffer, &OffsetInBytes, &m_Stride) == D3D_OK)
{
if(getstrides == false)
{
StreamBuffer->Release();
getstrides = true; // need to get strides without SetStreamSource
}
if(GetAsyncKeyState(VK_NUMPAD1))
{
wallhack =! wallhack;
Sleep(50);
}
if(GetAsyncKeyState(VK_NUMPAD2))
{
chams =! chams;
Sleep(50);
}
// This is just a simple method to activate and deactivate wallhack/chams.
if(wallhack == true)
{
if(m_Stride == *private*)
{
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
else
{
pDevice->SetRenderState(D3DRS_ZENABLE, TRUE);
}
}
else
{
if(m_Stride == 44)
{
pDevice->SetRenderState(D3DRS_ZENABLE, TRUE);
}
else
{
pDevice->SetRenderState(D3DRS_ZENABLE, TRUE);
}
}
if(chams == true)
{
if(m_Stride == *private*)
{
pDevice->SetRenderState( D3DRS_ZENABLE,false );
pDevice->SetRenderState( D3DRS_FILLMODE,D3DFILL_SOLID );
pDevice->SetTexture( 0, txtRed );
pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
pDevice->SetRenderState( D3DRS_ZENABLE, true );
pDevice->SetRenderState( D3DRS_FILLMODE,D3DFILL_SOLID );
pDevice->SetTexture( 0, txtGreen );
}
}
return pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
}
Yeah, that it, hope you will find something wrong^^
// Edit:
Screen of BugTrap:
http://www.ab lo ad . de/img/bugtrapmehv.png
And DIP is hooked (chams is activ) when it crashs..