void __cdecl hMenuCore::PushToConsole( const char* szCommand )
{
DWORD* addr = ( DWORD* ) LTClientEXE;
if(*(BYTE*)ADDR_GAMESTATUS == 1)
{
__asm
{
Pushad;
Push szCommand
call addr
add esp, 0x4
Popad;
}
}
}
typedef HRESULT (WINAPI* tDrawIndexedPrimitive)(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount); tDrawIndexedPrimitive oDrawIndexedPrimitive2 = NULL;
DWORD hDIPtr = hHooker(82); oDrawIndexedPrimitive2 = ( tDrawIndexedPrimitive )hDetour( (PBYTE)hDIPtr,(PBYTE)&tDrawIndexedPrimitive2, 5 );
HRESULT WINAPI tDrawIndexedPrimitive2(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
{
LPDIRECT3DVERTEXBUFFER9 Stream_Data;
UINT Offset = 0, m_Stride = 0;
if(pDevice->GetStreamSource(0, &Stream_Data, &Offset, &m_Stride) == D3D_OK)
Stream_Data->Release();
//MessageBox(NULL,"","",NULL); --> game crash after this message
return oDrawIndexedPrimitive2(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
}