#include "stdafx.h"
#include <windows.h>
#include <d3d9.h>
#pragma comment(lib, "d3d9.lib")
bool wallhack = false;
typedef HRESULT (WINAPI* DrawIndexedPrimitive_Prototype)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, UINT, UINT, UINT, UINT);
DrawIndexedPrimitive_Prototype DrawIndexedPrimitive_Pointer = NULL;
HRESULT WINAPI DrawIndexedPrimitive_Detour(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, UINT, UINT, UINT, UINT);
BOOL WINAPI DllMain(HINSTANCE hinstModule, DWORD dwReason, LPVOID lpvReserved)
{
if(dwReason == DLL_PROCESS_ATTACH)
{
MessageBoxA(0,"Injected, End Key To Activate the Hack. By JustinTCS","Injected",MB_OK);
DisableThreadLibraryCalls(hinstModule);
}
return FALSE;
}
HRESULT WINAPI DrawIndexedPrimitive_Detour(LPDIRECT3DDEVICE9 Device_Interface, D3DPRIMITIVETYPE Type,
UINT MinIndex, UINT NumVertices, UINT StartIndex, UINT PrimitiveCount)
{
LPDIRECT3DVERTEXBUFFER9 Stream_Data;
UINT offset = 0;
UINT Stride = 0;
if(Device_Interface->GetStreamSource(0, &Stream_Data,&offset, &Stride) == D3D_OK)
Stream_Data->Release();
//code
if (wallhack)
{if(Stride == 12 && wallhack || Stride == 35 && wallhack)// put your game's stride number
{
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if ((GetAsyncKeyState(VK_END)&1) == 1) //End key to activate
wallhack = !wallhack;//Start Wallhack
}
return DrawIndexedPrimitive_Pointer(Device_Interface, Type, MinIndex, NumVertices, StartIndex, PrimitiveCount);
}