Originally Posted by
Ch40zz-C0d3r
Man... Post some more code :|
Really, DIP is so easy to hook on NA, its done in like 1min.
Just hook it like all the public nerds and youre fine since CA NA is a piece of shit and doesnt scan in d3d9.dll -.-
meh screw it idc
Code:
#include <Windows.h>
#include <d3d9.h>
#include "XOR.h"
#include "main.h"
DWORD retMy_DIP;
// Full Credits to Crash
#define smPlayer (my_Stride == 44)
#define smHeads (my_Stride == 36)
#define smGuns (my_Stride == 32)
#define Hands (my_Stride == 40)
void My_D3D (LPDIRECT3DDEVICE9 pDevice)
{
IDirect3DVertexBuffer9* my_StreamData = NULL;
UINT my_OffsetInBytes,my_Stride;
pDevice->GetStreamSource(0,&my_StreamData,&my_OffsetInBytes,&my_Stride);
if(GetAsyncKeyState(VK_NUMPAD1)&1) //does not seem to activate
{
if(smPlayer || smHeads || smGuns || Hands)
{
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);//WallHack
//MessageBox(NULL, NULL, NULL, NULL);
} else {
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
}
}
if(GetAsyncKeyState(VK_INSERT)%1)
{
TerminateProcess("Engine.exe",1); //jsut a test to see if it would work
}
}
__declspec(naked) HRESULT WINAPI My_DIP()
{
static LPDIRECT3DDEVICE9 pDevice;
__asm
{
MOV EDI,EDI
PUSH EBP
MOV EBP,ESP
MOV EAX,DWORD PTR SS:[EBP + 0x8]
MOV pDevice,EAX
}
My_D3D(pDevice);
__asm
{
JMP retMy_DIP
}
}
void Hook ()
{
DWORD hD3D = (DWORD)LoadLibrary(ed3d9);
DWORD *vtbl;
DWORD adr = FindPattern(hD3D, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
if(adr)
{
memcpy(&vtbl,(void*)(adr + 2),4);
retMy_DIP = vtbl[147] + 0x5;
MakeJMP((PBYTE)vtbl[147],(DWORD)My_DIP,0x5);
}
}
extern "C"
{
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
CreateThread(0,0,(LPTHREAD_START_ROUTINE)Hook,0,0,0); //it does hook, tested with msg box
break;
}
return true;
}
}
ed3d9 is defined elsewhere in a header file