#include "stdafx.h"
#include <Windows.h>
#include "d3d9.h"
#include "detours.h"
#include "stdio.h"
#pragma comment (lib, "d3d9.lib")
#pragma comment (lib, "detours.lib")
bool hlWall=1;
bool hlSTART=1;
typedef HRESULT(WINAPI* DrawIndexedPrimitive_)(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex, UINT NumVertices, UINT StartIndex, UINT PrimitiveCount);
DrawIndexedPrimitive_ pDrawIndexedPrimitive;
HRESULT WINAPI nDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex,UINT NumVertices, UINT StartIndex, UINT PrimitiveCount)
{
IDirect3DVertexBuffer9* pStreamData = NULL;
UINT iOffsetInBytes,iStride;
pDevice->GetStreamSource(0,&pStreamData,&iOffsetInBytes,&iStride);
if ( iStride == 40 &&hlSTART==1)
{
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_NEVER);
}
return pDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);
}
int hlMAIN ();
BOOL APIENTRY DllMain( HANDLE hModule,DWORD ul_reason_for_call, LPVOID lpReserved )
{
if (hlWall)
{
hlWall=0;
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)hlMAIN, NULL, NULL, NULL);
}
return TRUE;
}
int hlMAIN()
{
char s[1000];
DWORD ******OffS=0x4FE571A0;
for(;; Sleep(100))
{
******OffS=(DWORD)GetModuleHandle ("d3d9.dll");
if (******OffS)
break;
}
DWORD a[2];
a[0]=******OffS+0x88830; // Offset: 88830 for Sp2 if not Sp2 use 88840
OutputDebugString (s);
pDrawIndexedPrimitive = (DrawIndexedPrimitive_)DetourFunction((PBYTE)a[0],(PBYTE)nDrawIndexedPrimitive);
for (;;Sleep (500))
{
if (GetAsyncKeyState (VK_F9)!=0)
{
Beep (2000,200);
hlSTART=1; // Turn ON
}
if (GetAsyncKeyState (VK_F10)!=0)
{
Beep (3000,200);
hlSTART=0; // Turn OFF
}
}
return 1;
}
![=]](/forum/images/emotions/=].gif)

