NOTE: This is not my work just found it and thought i would share with MPGH.
Code:
DWORD dwDrawIndexedPrimitive_EngineCall = 0x006A3AEA;
DWORD dwDrawIndexedPrimitive_CaveJumpBack = dwDrawIndexedPrimitive_EngineCall + 0x8;
Code:
__declspec(naked) void __cdecl DrawIndexedPrimitive_CodeCave()
{
static LPDIRECT3DDEVICE9 pDevice;
static D3DPRIMITIVETYPE PrimType = D3DPT_TRIANGLELIST; //constant parameter 4
static UINT MinIndex, nNumVertices, StartIndex, nPrimitiveCount;
static INT BaseVertexIndex;
__asm
{
MOV ECX, DWORD PTR DS:[EAX]
MOV pDevice, EAX;
MOV EDX, DWORD PTR DS:[ECX+0x148]
PUSHAD
MOV ECX, [EBP + 0x18]
MOV BaseVertexIndex, ECX
MOV ECX, [EBP + 0x8]
MOV MinIndex, ECX
MOV ECX, [EBP + 0x10]
MOV nNumVertices, ECX
MOV ECX, [EBP + 0xC]
MOV StartIndex, ECX
MOV ECX, [EBP + 0x14]
MOV nPrimitiveCount, ECX
}
//Second DIP call
pDevice->DrawIndexedPrimitive(PrimType, BaseVertexIndex, MinIndex, nNumVertices, StartIndex, nPrimitiveCount);
__asm
{
POPAD
JMP dwDrawIndexedPrimitive_CaveJumpBack;
}
}
hook when in-game
Code:
DWORD CALLBACK DIPHook(LPVOID)
{
while(1)
{
if(*(int*)0x377B11B0 == 1)
DetourCreate((PBYTE)dwDrawIndexedPrimitive_EngineCall, (PBYTE)DrawIndexedPrimitive_CodeCave, 8);
else
memcpy((void*)dwDrawIndexedPrimitive_EngineCall, (PBYTE)"\x8B\x08\x8B\x91\x48\x01\x00\x00", 8);
Sleep(500);
}
return 0;
}
create thread when injected:
Code:
CreateThread(NULL, NULL, DIPHook, NULL, NULL, NULL);
please correct me if i credited wrwing person(s)
Credit to:
CodeDemon
Crash
donoob
fatboy88
Gellin
Marko
mmbob
NOOB
Scimmy
whit
i think thats everyone now
(Thanks @
[POWER]