[help] my d3d8 and d3d9 source code please help me to complete it

01/21/2010 13:23 larongpating#1
Hello!!!

this is my source code of my wallhack for pSF

ahmn well anyway here is my source code that ive compiled for
Philippine Special force

ive switched to d3d9 but it seems to be that this code is detected
this wallhack is only XQZ and i have set its key to F1



Code:
// prototype.cpp : Defines the exported functions for the DLL application.
//
// prototype.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include <windows.h>
#include <d3d9.h>
#pragma comment(lib, "d3d9.lib")
#include <d3dx9.h>
#pragma comment(lib, "d3dx9.lib")
#include <iostream>
//==================================Defines============================================
#define ForceRecon (nNumVertices == 83 && nPrimitiveCount == 137 || nNumVertices == 79 && nPrimitiveCount == 105 || nNumVertices == 142 && nPrimitiveCount == 174 || nNumVertices == 278 && nPrimitiveCount == 462 || nNumVertices == 263 && nPrimitiveCount == 290 || nNumVertices == 316 && nPrimitiveCount == 556)
#define ForceReconAddons (nNumVertices == 432 && nPrimitiveCount == 354 || nNumVertices == 144 && nPrimitiveCount == 136 || nNumVertices == 299 && nPrimitiveCount == 311 || nNumVertices == 167 && nPrimitiveCount == 252 || nNumVertices == 298 && nPrimitiveCount == 506 || nNumVertices == 168 && nPrimitiveCount == 254 || nNumVertices == 860 && nNumVertices == 778 || nNumVertices == 648 && nPrimitiveCount == 710 || nNumVertices == 113 && nPrimitiveCount == 189 || nNumVertices == 142 && nPrimitiveCount == 172 || nNumVertices == 87 && nPrimitiveCount == 90 || nNumVertices == 79 && nPrimitiveCount == 105 || nNumVertices == 84 && nPrimitiveCount == 110 || nNumVertices == 70 && nPrimitiveCount == 70 || nNumVertices == 860 && nPrimitiveCount == 778 || nNumVertices == 85 && nPrimitiveCount == 137)
#define Mulan (nNumVertices == 118 && nPrimitiveCount == 126|| nNumVertices == 121 && nPrimitiveCount == 180|| nNumVertices == 124 && nPrimitiveCount == 126|| nNumVertices == 295 && nPrimitiveCount == 482|| nNumVertices == 299 && nPrimitiveCount == 452|| nNumVertices == 474 && nPrimitiveCount == 728)
#define MulanAddons (nNumVertices == 162 && nPrimitiveCount == 200|| nNumVertices == 120 && nPrimitiveCount == 188|| nNumVertices == 167 && nPrimitiveCount == 276|| nNumVertices == 108 && nPrimitiveCount == 198|| nNumVertices == 512 && nPrimitiveCount == 728|| nNumVertices == 790 && nPrimitiveCount == 881|| nNumVertices == 619 && nPrimitiveCount == 800|| nNumVertices == 399 && nPrimitiveCount == 532|| nNumVertices == 402 && nPrimitiveCount == 580|| nNumVertices == 102 && nPrimitiveCount == 170|| nNumVertices == 125 && nPrimitiveCount == 98|| nNumVertices == 116 && nPrimitiveCount == 128|| nNumVertices == 160 && nPrimitiveCount == 174)
//=====================================================================================================================================================================================================================================================================================================================//
#pragma warning(disable:4305)
//=====================================================================================
int XQZ;
int m_Stride;
int texnum;
int nNumVertices;
int nPrimitiveCount;
float ScreenCenterX = 0.0f;
float ScreenCenterY = 0.0f;
D3DCOLOR redt = D3DCOLOR_XRGB( 255, 0, 0 );
//=====================================================================================
//=====================================================================================

typedef HRESULT (WINAPI* CreateDevice_Prototype)        (LPDIRECT3D9, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE9*);
typedef HRESULT (WINAPI* Reset_Prototype)               (LPDIRECT3DDEVICE9, D3DPRESENT_PARAMETERS*);
typedef HRESULT (WINAPI* EndScene_Prototype)            (LPDIRECT3DDEVICE9);
typedef HRESULT (WINAPI* DrawIndexedPrimitive_Prototype)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);

CreateDevice_Prototype         CreateDevice_Pointer         = NULL;
Reset_Prototype                Reset_Pointer                = NULL;
EndScene_Prototype             EndScene_Pointer             = NULL;
DrawIndexedPrimitive_Prototype DrawIndexedPrimitive_Pointer = NULL;

HRESULT WINAPI Direct3DCreate9_VMTable    (VOID);
HRESULT WINAPI CreateDevice_Detour        (LPDIRECT3D9, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE9*);
HRESULT WINAPI Reset_Detour               (LPDIRECT3DDEVICE9, D3DPRESENT_PARAMETERS*);
HRESULT WINAPI EndScene_Detour            (LPDIRECT3DDEVICE9);
HRESULT WINAPI DrawIndexedPrimitive_Detour(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);

DWORD WINAPI VirtualMethodTableRepatchingLoopToCounterExtensionRepatching(LPVOID);
PDWORD Direct3D_VMTable = NULL;

//=====================================================================================

BOOL WINAPI DllMain(HINSTANCE hinstModule, DWORD dwReason, LPVOID lpvReserved)
{
  if(dwReason == DLL_PROCESS_ATTACH)
  {
    DisableThreadLibraryCalls(hinstModule);

    if(Direct3DCreate9_VMTable() == D3D_OK)
    return TRUE;
  }

  return FALSE;
}

//===============================================================
//=====================================================================================

HRESULT WINAPI Reset_Detour(LPDIRECT3DDEVICE9 Device_Interface, D3DPRESENT_PARAMETERS* PresentationParameters)
{
  return Reset_Pointer(Device_Interface, PresentationParameters);
}

//=====================================================================================

HRESULT WINAPI EndScene_Detour(LPDIRECT3DDEVICE9 Device_Interface)
{
if (GetAsyncKeyState(VK_F1)&1) //
{ XQZ = !XQZ; } //
  return EndScene_Pointer(Device_Interface);
}
///////////////////////
HRESULT WINAPI DrawIndexedPrimitive_Detour(LPDIRECT3DDEVICE9 Device_Interface, D3DPRIMITIVETYPE pType, INT BaseIndex,
                                           UINT MinIndex, UINT NumVertices, UINT StartIndex, UINT PrimitiveCount)
{
  LPDIRECT3DVERTEXBUFFER9 Stream_Data;
  UINT Offset = 0;
  UINT Stride = 40;

  if(Device_Interface->GetStreamSource(0, &Stream_Data, &Offset, &Stride) == D3D_OK)
  Stream_Data->Release();
//============================================================================================================

if(XQZ)
{
texnum = (nNumVertices*100000)+nPrimitiveCount;
if(Stride == 40 &&
 
(texnum==34900580)|| // Delta Force Head
(texnum==36100604)|| // Spetsnaz Head
(texnum==38000658)|| // Spetsnaz Legs
(texnum==18300268)|| // Spetsnaz Body
(texnum==36200604)|| // GIGN Head
(texnum==21200306)|| // GIGN Body
(texnum==35500568)|| // GSG9 Head
(texnum==2200024)|| // GSG9 Bangs
(texnum==8800105)|| // GSG9 Feet
(texnum==36900650)|| // GSG9 Legs
(texnum==19600314)|| // GSG9 Body
(texnum==36700612)|| // SAS Head
(texnum==8500105)|| // SAS Feet
(texnum==37000650)|| // SAS Legs
(texnum==18000274)|| // SAS Body
(texnum==35300556)|| // KSF Head
(texnum==7500121)|| // KSF Arms
(texnum==9200115)|| // KSF Feet
(texnum==12400168)|| // KSF Hands
(texnum==30100522)|| // KSF Legs
(texnum==18700288)|| // KSF Body
(texnum==40900594)|| // ARTC Head
(texnum==11700190)|| // ARTC Arms
(texnum==9100118)|| // ARTC Feet
(texnum==12500170)|| // ARTC Hands
(texnum==37000634)|| // ARTC Legs
(texnum==41700516)|| // ARTC Body
(texnum==19400260)|| // ROKMC Body
(texnum==37900592)|| // ROKMC Head
(texnum==36500642)|| // ROKMC Legs
(texnum==44800776)|| // SRG Head
(texnum==15900200)|| // SRG Left Arm
(texnum==10500168)|| // SRG Right Arm
(texnum==80401016)|| // SRG Body
(texnum==10000121)|| // SRG Feet
(texnum==13200180)|| // SRG Hands
(ForceRecon)|| // ForceRecon
(Mulan)||
(texnum==33800534)) // SRG Leg
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 213 && nPrimitiveCount == 174) // M67 Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 158 && nPrimitiveCount == 131) // Flashbang =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 171 && nPrimitiveCount == 143) // Smoke Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 271 && nPrimitiveCount == 257) // VX Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 338 && nPrimitiveCount == 339) // RGD-5 Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
 
 
 
if (Stride==40 && // Equipment =============== //
(texnum==13200212)|| // Delta Force Helmet
(texnum==13200212)|| // Delta Force Helmet 2
(texnum==34700538)|| // Delta Force Gas Mask
(texnum==19500352)|| // Delta Force Balaclava
(texnum==84900778)|| // Delta Force Clan BDU
(texnum==27500442)|| // Delta Force Body Armor
(texnum==42800576)|| // Delta Force Body Armor 2
(texnum==52100658)|| // Delta Force Tactical Vest
(texnum==12200196)|| // Spetsnaz Helmet
(texnum==27100464)|| // Spetsnaz Gas Mask
(texnum==33600552)|| // Spetsnaz Body Armor
(texnum==44100646)|| // Spetsnaz Tactical Vest
(texnum==17800292)|| // GIGN Red Bandana
(texnum==21300290)|| // GIGN Helmet
(texnum==2800036)|| // GIGN Helmet Lens
(texnum==35700558)|| // GIGN Gas Mask
(texnum==22100396)|| // GIGN Balaclava
(texnum==29700492)|| // GIGN Body Armor
(texnum==11200188)|| // ROKMC Beret
(texnum==12000194)|| // ROKMC Helmet
(texnum==29800450)|| // ROKMC Gas Mask
(texnum==27100394)|| // ROKMC Body Armor
(texnum==28700374)|| // ROKMC X Harness
(texnum==34700470)|| // ROKMC X Harness
(texnum==5100056)|| // ROKMC Pouch
(texnum==9900163)|| // ROKMC Left Arm
(texnum==18300163)|| // ROKMC Right Arm
(texnum==16400266)|| // GSG9 Red Bandana
(texnum==16200243)|| // GSG9 Helmet
(texnum==31900466)|| // GSG9 Gas Mask
(texnum==19300342)|| // GSG9 Balaclava
(texnum==83600752)|| // GSG9 Clan BDU
(texnum==33400477)|| // GSG9 Body Armor
(texnum==10500163)|| // GSG9 Rolled Up Sleeves
(texnum==38100666)|| // GSG9 Tactical Knee Pads
(texnum==9600172)|| // SAS Boonie Hat
(texnum==14200236)|| // SAS Helmet
(texnum==37800552)|| // SAS Gas Mask
(texnum==28100486)|| // SAS Balaclava
(texnum==62400752)|| // SAS Clan BDU
(texnum==27900456)|| // SAS Body Armor
(texnum==45700654)|| // SAS Tactical Vest
(texnum==39800532)|| // SAS Tactical Vest 2
(texnum==9200100)|| // SAS Holster
(texnum==4800040)|| // SAS Magazine Pouch
(texnum==4000044)|| // SAS Pouch
(texnum==6500110) || // KSF Boonie Hat
(texnum==12900208)|| // KSF Helmet
(texnum==29600448)|| // KSF Gas Mask
(texnum==31100398)|| // KSF Sunglasses
(texnum==84700776)|| // KSF Clan BDU
(texnum==600004)|| // KSF Clan BDU Logo
(texnum==36500606)|| // KSF Body Armor
(texnum==63100646)|| // KSF Tactical Vest
(texnum==19800163)|| // KSF Rolled Up Sleeves
(texnum==7000066)|| // KSF Holster
(texnum==10400190)|| // SRG Beret
(texnum==23800294)|| // SRG Deer Head
(texnum==11600180)|| // SRG NIJ IIIA Helmet
(texnum==17100278)|| // SRG Red Bandana
(texnum==14600198)|| // SRG Battle Cap
(texnum==18200266)|| // SRG Helmet
(texnum==19100106)|| // SRG Gas Mask
(texnum==54300350)|| // SRG Sunglasses
(texnum==30800380)|| // SRG Mid Class Sunglasses
(texnum==79300995)|| // SRG Clan BDU 1
(texnum==13300138)|| // SRG Clan BDU 2
(texnum==300001)|| // SRG Clan BDU 3
(texnum==1200012)|| // SRG Clan BDU Logo
(texnum==10900110)|| // SRG Bulletproof Vest
(texnum==6200064)|| // SRG Holster
(ForceReconAddons)||
(MulanAddons)||
(texnum==22700250)) // SRG Pouch
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (Stride==40 && // Guns =============== //
(texnum==187200968)|| // GALIL
(texnum==187200968)|| // GALIL 2
(texnum==149701124)|| // UZI
(texnum==193701304)|| // M249
(texnum==232501431)|| // SIG551
(texnum==161500751)|| // FA-MAS
(texnum==107400724)|| // FR-F2
(texnum==141600900)|| // AN94
(texnum==145900805)|| // G36C
(texnum==42200339)|| // K1
(texnum==23400116)|| // K1 2
(texnum==17500073)|| // K1 3
(texnum==3200012)|| // K1 4
(texnum==2300012)|| // K1 5
(texnum==71900459)|| // MP5
(texnum==1800008)|| // MP5 2
(texnum==20300084)|| // MP5 3
(texnum==16700083)|| // MP5 4
(texnum==79100469)|| // M4A1
(texnum==12000044)|| // M4A1 2
(texnum==16800062)|| // M4A1 3
(texnum==2400008)|| // M4A1 4
(texnum==600002)|| // M4A1 5
(texnum==12800050)|| // M4A1 6
(texnum==2600010)|| // M4A1 7
(texnum==4200014)|| // M4A1 8
(texnum==1400008)|| // M4A1 9
(texnum==80600442)|| // M16A2
(texnum==13400052)|| // M16A2 2
(texnum==17600066)|| // M16A2 3
(texnum==5400018)|| // M16A2 4
(texnum==46200348)|| // STEYR_AUG
(texnum==27000133)|| // STEYR_AUG 2
(texnum==4100025)|| // STEYR_AUG 3
(texnum==1200006)|| // STEYR_AUG 4
(texnum==400002)|| // STEYR_AUG 5
(texnum==46800367)|| // PSG-1
(texnum==9600042)|| // PSG-1 2
(texnum==18800092)|| // PSG-1 3
(texnum==16900071)|| // PSG-1 4
(texnum==3400012)|| // PSG-1 5
(texnum==800004)|| // PSG-1 6
(texnum==40500383)|| // K2
(texnum==15800089)|| // K2 2
(texnum==2200012)|| // K2 3
(texnum==7000034)|| // K2 4
(texnum==60700349)|| // P90
(texnum==5500033)|| // P90 2
(texnum==47700227)|| // P90 3
(texnum==10300047)|| // P90 4
(texnum==3800014)|| // P90 5
(texnum==50300349)|| // AK-74
(texnum==14700071)|| // AK-74 2
(texnum==13100061)|| // AK-74 3
(texnum==194501145)|| // MG36
(texnum==116000670)|| // DESERT EAGLE
(texnum==182101089)|| // MR73
(texnum==62500454)|| // REMINGTON M870
(texnum==95200571)|| // BENELLI M1
(texnum==40700334)|| // GLOCK 23
(texnum==71500449)|| // BERETTA M92F
(texnum==11000044)|| // BERETTA M92F 2
(texnum==16500075)|| // BERETTA M92F 3
(texnum==4400020)|| // BERETTA M92F 4
(texnum==2800014)|| // BERETTA M92F 5
(texnum==92000543)|| // COLT 45
(texnum==239001276)) // DRAGONUV
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
}
return DrawIndexedPrimitive_Pointer(Device_Interface, pType, BaseIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);
}
//=====================================================================================

HRESULT WINAPI Direct3DCreate9_VMTable(VOID)
{
  LPDIRECT3D9 Direct3D_Object = Direct3DCreate9(D3D_SDK_VERSION);

  if(Direct3D_Object == NULL)
  return D3DERR_INVALIDCALL;
 
  Direct3D_VMTable = (PDWORD)*(PDWORD)Direct3D_Object;
  Direct3D_Object->Release();

  DWORD dwProtect;

  if(VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), PAGE_READWRITE, &dwProtect) != 0)
  {
    *(PDWORD)&CreateDevice_Pointer = Direct3D_VMTable[16];
    *(PDWORD)&Direct3D_VMTable[16] = (DWORD)CreateDevice_Detour;

    if(VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), dwProtect, &dwProtect) == 0)
    return D3DERR_INVALIDCALL;
  }
  else
  return D3DERR_INVALIDCALL;

  return D3D_OK;
}

//=====================================================================================
//=====================================================================================

HRESULT WINAPI CreateDevice_Detour(LPDIRECT3D9 Direct3D_Object, UINT Adapter, D3DDEVTYPE DeviceType, HWND FocusWindow,
                    DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* PresentationParameters,
                    LPDIRECT3DDEVICE9* Returned_Device_Interface)
{
  HRESULT Returned_Result = CreateDevice_Pointer(Direct3D_Object, Adapter, DeviceType, FocusWindow, BehaviorFlags,
                                              PresentationParameters, Returned_Device_Interface);
  
  DWORD dwProtect;

  if(VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), PAGE_READWRITE, &dwProtect) != 0)
  {
    *(PDWORD)&Direct3D_VMTable[16] = *(PDWORD)&CreateDevice_Pointer;
    CreateDevice_Pointer           = NULL;

    if(VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), dwProtect, &dwProtect) == 0)
    return D3DERR_INVALIDCALL;
  }
  else
  return D3DERR_INVALIDCALL;

  if(Returned_Result == D3D_OK)
  {
    Direct3D_VMTable = (PDWORD)*(PDWORD)*Returned_Device_Interface;

    *(PDWORD)&Reset_Pointer                = (DWORD)Direct3D_VMTable[16];
    *(PDWORD)&EndScene_Pointer             = (DWORD)Direct3D_VMTable[42];
    *(PDWORD)&DrawIndexedPrimitive_Pointer = (DWORD)Direct3D_VMTable[82];

    if(CreateThread(NULL, 0, VirtualMethodTableRepatchingLoopToCounterExtensionRepatching, NULL, 0, NULL) == NULL)
    return D3DERR_INVALIDCALL;
  }
   
  return Returned_Result;
}

//=====================================================================================
//=====================================================================================
//=====================================================================================

DWORD WINAPI VirtualMethodTableRepatchingLoopToCounterExtensionRepatching(LPVOID Param)
{
  UNREFERENCED_PARAMETER(Param);

  while(1)
  {
    Sleep(100);

    *(PDWORD)&Direct3D_VMTable[42] = (DWORD)EndScene_Detour;
    *(PDWORD)&Direct3D_VMTable[82] = (DWORD)DrawIndexedPrimitive_Detour;
    *(PDWORD)&Direct3D_VMTable[16] = (DWORD)Reset_Detour;
  }

  return 1;
}

//=====================================================================================


and here my d3d8 compilation it seems to be that in lobby ive stayed for 1hours and the gameguard doesnt detect it.. but when im in game..
the gameguard says that there's a d3d8.dll error
ahmn, here's my source code

Code:
// prototype.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include <windows.h>
#include <d3d8.h>
#pragma comment(lib, "d3d8.lib")
#include <iostream>
//==================================Defines============================================
#define ForceRecon (nNumVertices == 83 && nPrimitiveCount == 137 || nNumVertices == 79 && nPrimitiveCount == 105 || nNumVertices == 142 && nPrimitiveCount == 174 || nNumVertices == 278 && nPrimitiveCount == 462 || nNumVertices == 263 && nPrimitiveCount == 290 || nNumVertices == 316 && nPrimitiveCount == 556)
#define ForceReconAddons (nNumVertices == 432 && nPrimitiveCount == 354 || nNumVertices == 144 && nPrimitiveCount == 136 || nNumVertices == 299 && nPrimitiveCount == 311 || nNumVertices == 167 && nPrimitiveCount == 252 || nNumVertices == 298 && nPrimitiveCount == 506 || nNumVertices == 168 && nPrimitiveCount == 254 || nNumVertices == 860 && nNumVertices == 778 || nNumVertices == 648 && nPrimitiveCount == 710 || nNumVertices == 113 && nPrimitiveCount == 189 || nNumVertices == 142 && nPrimitiveCount == 172 || nNumVertices == 87 && nPrimitiveCount == 90 || nNumVertices == 79 && nPrimitiveCount == 105 || nNumVertices == 84 && nPrimitiveCount == 110 || nNumVertices == 70 && nPrimitiveCount == 70 || nNumVertices == 860 && nPrimitiveCount == 778 || nNumVertices == 85 && nPrimitiveCount == 137)
#define Mulan (nNumVertices == 118 && nPrimitiveCount == 126|| nNumVertices == 121 && nPrimitiveCount == 180|| nNumVertices == 124 && nPrimitiveCount == 126|| nNumVertices == 295 && nPrimitiveCount == 482|| nNumVertices == 299 && nPrimitiveCount == 452|| nNumVertices == 474 && nPrimitiveCount == 728)
#define MulanAddons (nNumVertices == 162 && nPrimitiveCount == 200|| nNumVertices == 120 && nPrimitiveCount == 188|| nNumVertices == 167 && nPrimitiveCount == 276|| nNumVertices == 108 && nPrimitiveCount == 198|| nNumVertices == 512 && nPrimitiveCount == 728|| nNumVertices == 790 && nPrimitiveCount == 881|| nNumVertices == 619 && nPrimitiveCount == 800|| nNumVertices == 399 && nPrimitiveCount == 532|| nNumVertices == 402 && nPrimitiveCount == 580|| nNumVertices == 102 && nPrimitiveCount == 170|| nNumVertices == 125 && nPrimitiveCount == 98|| nNumVertices == 116 && nPrimitiveCount == 128|| nNumVertices == 160 && nPrimitiveCount == 174)
//=====================================================================================================================================================================================================================================================================================================================//
#pragma warning(disable:4305)
//=====================================================================================
int XQZ;
int m_Stride;
int texnum;
int nNumVertices;
int nPrimitiveCount;
float ScreenCenterX = 0.0f;
float ScreenCenterY = 0.0f;
D3DCOLOR redt = D3DCOLOR_XRGB( 255, 0, 0 );
//=====================================================================================
//=====================================================================================

typedef HRESULT (WINAPI* CreateDevice_Prototype)        (LPDIRECT3D8, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE8*);
typedef HRESULT (WINAPI* Reset_Prototype)               (LPDIRECT3DDEVICE8, D3DPRESENT_PARAMETERS*);
typedef HRESULT (WINAPI* EndScene_Prototype)            (LPDIRECT3DDEVICE8);
typedef HRESULT (WINAPI* DrawIndexedPrimitive_Prototype)(LPDIRECT3DDEVICE8, D3DPRIMITIVETYPE, UINT, UINT, UINT, UINT);

CreateDevice_Prototype         CreateDevice_Pointer         = NULL;
Reset_Prototype                Reset_Pointer                = NULL;
EndScene_Prototype             EndScene_Pointer             = NULL;
DrawIndexedPrimitive_Prototype DrawIndexedPrimitive_Pointer = NULL;

HRESULT WINAPI Direct3DCreate8_VMTable    (VOID);
HRESULT WINAPI CreateDevice_Detour        (LPDIRECT3D8, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE8*);
HRESULT WINAPI Reset_Detour               (LPDIRECT3DDEVICE8, D3DPRESENT_PARAMETERS*);
HRESULT WINAPI EndScene_Detour            (LPDIRECT3DDEVICE8);
HRESULT WINAPI DrawIndexedPrimitive_Detour(LPDIRECT3DDEVICE8, D3DPRIMITIVETYPE, UINT, UINT, UINT, UINT);

PDWORD Direct3D_VMTable = NULL;

//=====================================================================================

BOOL WINAPI DllMain(HINSTANCE hinstModule, DWORD dwReason, LPVOID lpvReserved)
{
  if(dwReason == DLL_PROCESS_ATTACH)
  {
    DisableThreadLibraryCalls(hinstModule);

    if(Direct3DCreate8_VMTable() == D3D_OK)
    return TRUE;
  }

  return FALSE;
}

//=====================================================================================
//=====================================================================================

HRESULT WINAPI Reset_Detour(LPDIRECT3DDEVICE8 Device_Interface, D3DPRESENT_PARAMETERS* PresentationParameters)
{
  return Reset_Pointer(Device_Interface, PresentationParameters);
}

//=====================================================================================

HRESULT WINAPI EndScene_Detour(LPDIRECT3DDEVICE8 Device_Interface)
{
if (GetAsyncKeyState(VK_F1)&1) //
{ XQZ = !XQZ; } //
  return EndScene_Pointer(Device_Interface);
}
//=====================================================================================
HRESULT WINAPI DrawIndexedPrimitive_Detour(LPDIRECT3DDEVICE8 Device_Interface, D3DPRIMITIVETYPE pType,
UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount)
{
 
LPDIRECT3DVERTEXBUFFER8 Stream_Data;
UINT Stride = 40;
if(Device_Interface->GetStreamSource(0, &Stream_Data, &Stride) == D3D_OK)
Stream_Data->Release();
//============================================================================================================
if(XQZ)
{
texnum = (nNumVertices*100000)+nPrimitiveCount;
if(Stride == 40 &&
 
(texnum==34900580)|| // Delta Force Head
(texnum==36100604)|| // Spetsnaz Head
(texnum==38000658)|| // Spetsnaz Legs
(texnum==18300268)|| // Spetsnaz Body
(texnum==36200604)|| // GIGN Head
(texnum==21200306)|| // GIGN Body
(texnum==35500568)|| // GSG9 Head
(texnum==2200024)|| // GSG9 Bangs
(texnum==8800105)|| // GSG9 Feet
(texnum==36900650)|| // GSG9 Legs
(texnum==19600314)|| // GSG9 Body
(texnum==36700612)|| // SAS Head
(texnum==8500105)|| // SAS Feet
(texnum==37000650)|| // SAS Legs
(texnum==18000274)|| // SAS Body
(texnum==35300556)|| // KSF Head
(texnum==7500121)|| // KSF Arms
(texnum==9200115)|| // KSF Feet
(texnum==12400168)|| // KSF Hands
(texnum==30100522)|| // KSF Legs
(texnum==18700288)|| // KSF Body
(texnum==40900594)|| // ARTC Head
(texnum==11700190)|| // ARTC Arms
(texnum==9100118)|| // ARTC Feet
(texnum==12500170)|| // ARTC Hands
(texnum==37000634)|| // ARTC Legs
(texnum==41700516)|| // ARTC Body
(texnum==19400260)|| // ROKMC Body
(texnum==37900592)|| // ROKMC Head
(texnum==36500642)|| // ROKMC Legs
(texnum==44800776)|| // SRG Head
(texnum==15900200)|| // SRG Left Arm
(texnum==10500168)|| // SRG Right Arm
(texnum==80401016)|| // SRG Body
(texnum==10000121)|| // SRG Feet
(texnum==13200180)|| // SRG Hands
(ForceRecon)|| // ForceRecon
(Mulan)||
(texnum==33800534)) // SRG Leg
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 213 && nPrimitiveCount == 174) // M67 Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 158 && nPrimitiveCount == 131) // Flashbang =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 171 && nPrimitiveCount == 143) // Smoke Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 271 && nPrimitiveCount == 257) // VX Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 338 && nPrimitiveCount == 339) // RGD-5 Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
 
 
 
if (Stride==40 && // Equipment =============== //
(texnum==13200212)|| // Delta Force Helmet
(texnum==13200212)|| // Delta Force Helmet 2
(texnum==34700538)|| // Delta Force Gas Mask
(texnum==19500352)|| // Delta Force Balaclava
(texnum==84900778)|| // Delta Force Clan BDU
(texnum==27500442)|| // Delta Force Body Armor
(texnum==42800576)|| // Delta Force Body Armor 2
(texnum==52100658)|| // Delta Force Tactical Vest
(texnum==12200196)|| // Spetsnaz Helmet
(texnum==27100464)|| // Spetsnaz Gas Mask
(texnum==33600552)|| // Spetsnaz Body Armor
(texnum==44100646)|| // Spetsnaz Tactical Vest
(texnum==17800292)|| // GIGN Red Bandana
(texnum==21300290)|| // GIGN Helmet
(texnum==2800036)|| // GIGN Helmet Lens
(texnum==35700558)|| // GIGN Gas Mask
(texnum==22100396)|| // GIGN Balaclava
(texnum==29700492)|| // GIGN Body Armor
(texnum==11200188)|| // ROKMC Beret
(texnum==12000194)|| // ROKMC Helmet
(texnum==29800450)|| // ROKMC Gas Mask
(texnum==27100394)|| // ROKMC Body Armor
(texnum==28700374)|| // ROKMC X Harness
(texnum==34700470)|| // ROKMC X Harness
(texnum==5100056)|| // ROKMC Pouch
(texnum==9900163)|| // ROKMC Left Arm
(texnum==18300163)|| // ROKMC Right Arm
(texnum==16400266)|| // GSG9 Red Bandana
(texnum==16200243)|| // GSG9 Helmet
(texnum==31900466)|| // GSG9 Gas Mask
(texnum==19300342)|| // GSG9 Balaclava
(texnum==83600752)|| // GSG9 Clan BDU
(texnum==33400477)|| // GSG9 Body Armor
(texnum==10500163)|| // GSG9 Rolled Up Sleeves
(texnum==38100666)|| // GSG9 Tactical Knee Pads
(texnum==9600172)|| // SAS Boonie Hat
(texnum==14200236)|| // SAS Helmet
(texnum==37800552)|| // SAS Gas Mask
(texnum==28100486)|| // SAS Balaclava
(texnum==62400752)|| // SAS Clan BDU
(texnum==27900456)|| // SAS Body Armor
(texnum==45700654)|| // SAS Tactical Vest
(texnum==39800532)|| // SAS Tactical Vest 2
(texnum==9200100)|| // SAS Holster
(texnum==4800040)|| // SAS Magazine Pouch
(texnum==4000044)|| // SAS Pouch
(texnum==6500110) || // KSF Boonie Hat
(texnum==12900208)|| // KSF Helmet
(texnum==29600448)|| // KSF Gas Mask
(texnum==31100398)|| // KSF Sunglasses
(texnum==84700776)|| // KSF Clan BDU
(texnum==600004)|| // KSF Clan BDU Logo
(texnum==36500606)|| // KSF Body Armor
(texnum==63100646)|| // KSF Tactical Vest
(texnum==19800163)|| // KSF Rolled Up Sleeves
(texnum==7000066)|| // KSF Holster
(texnum==10400190)|| // SRG Beret
(texnum==23800294)|| // SRG Deer Head
(texnum==11600180)|| // SRG NIJ IIIA Helmet
(texnum==17100278)|| // SRG Red Bandana
(texnum==14600198)|| // SRG Battle Cap
(texnum==18200266)|| // SRG Helmet
(texnum==19100106)|| // SRG Gas Mask
(texnum==54300350)|| // SRG Sunglasses
(texnum==30800380)|| // SRG Mid Class Sunglasses
(texnum==79300995)|| // SRG Clan BDU 1
(texnum==13300138)|| // SRG Clan BDU 2
(texnum==300001)|| // SRG Clan BDU 3
(texnum==1200012)|| // SRG Clan BDU Logo
(texnum==10900110)|| // SRG Bulletproof Vest
(texnum==6200064)|| // SRG Holster
(ForceReconAddons)||
(MulanAddons)||
(texnum==22700250)) // SRG Pouch
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (Stride==40 && // Guns =============== //
(texnum==187200968)|| // GALIL
(texnum==187200968)|| // GALIL 2
(texnum==149701124)|| // UZI
(texnum==193701304)|| // M249
(texnum==232501431)|| // SIG551
(texnum==161500751)|| // FA-MAS
(texnum==107400724)|| // FR-F2
(texnum==141600900)|| // AN94
(texnum==145900805)|| // G36C
(texnum==42200339)|| // K1
(texnum==23400116)|| // K1 2
(texnum==17500073)|| // K1 3
(texnum==3200012)|| // K1 4
(texnum==2300012)|| // K1 5
(texnum==71900459)|| // MP5
(texnum==1800008)|| // MP5 2
(texnum==20300084)|| // MP5 3
(texnum==16700083)|| // MP5 4
(texnum==79100469)|| // M4A1
(texnum==12000044)|| // M4A1 2
(texnum==16800062)|| // M4A1 3
(texnum==2400008)|| // M4A1 4
(texnum==600002)|| // M4A1 5
(texnum==12800050)|| // M4A1 6
(texnum==2600010)|| // M4A1 7
(texnum==4200014)|| // M4A1 8
(texnum==1400008)|| // M4A1 9
(texnum==80600442)|| // M16A2
(texnum==13400052)|| // M16A2 2
(texnum==17600066)|| // M16A2 3
(texnum==5400018)|| // M16A2 4
(texnum==46200348)|| // STEYR_AUG
(texnum==27000133)|| // STEYR_AUG 2
(texnum==4100025)|| // STEYR_AUG 3
(texnum==1200006)|| // STEYR_AUG 4
(texnum==400002)|| // STEYR_AUG 5
(texnum==46800367)|| // PSG-1
(texnum==9600042)|| // PSG-1 2
(texnum==18800092)|| // PSG-1 3
(texnum==16900071)|| // PSG-1 4
(texnum==3400012)|| // PSG-1 5
(texnum==800004)|| // PSG-1 6
(texnum==40500383)|| // K2
(texnum==15800089)|| // K2 2
(texnum==2200012)|| // K2 3
(texnum==7000034)|| // K2 4
(texnum==60700349)|| // P90
(texnum==5500033)|| // P90 2
(texnum==47700227)|| // P90 3
(texnum==10300047)|| // P90 4
(texnum==3800014)|| // P90 5
(texnum==50300349)|| // AK-74
(texnum==14700071)|| // AK-74 2
(texnum==13100061)|| // AK-74 3
(texnum==194501145)|| // MG36
(texnum==116000670)|| // DESERT EAGLE
(texnum==182101089)|| // MR73
(texnum==62500454)|| // REMINGTON M870
(texnum==95200571)|| // BENELLI M1
(texnum==40700334)|| // GLOCK 23
(texnum==71500449)|| // BERETTA M92F
(texnum==11000044)|| // BERETTA M92F 2
(texnum==16500075)|| // BERETTA M92F 3
(texnum==4400020)|| // BERETTA M92F 4
(texnum==2800014)|| // BERETTA M92F 5
(texnum==92000543)|| // COLT 45
(texnum==239001276)) // DRAGONUV
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
}
return DrawIndexedPrimitive_Pointer(Device_Interface, pType, nMinIndex, nNumVertices, nStartIndex, nPrimitiveCount);
}
//=====================================================================================

HRESULT WINAPI Direct3DCreate8_VMTable(VOID)
{
  LPDIRECT3D8 Direct3D_Object = Direct3DCreate8(D3D_SDK_VERSION);

  if(Direct3D_Object == NULL)
  return D3DERR_INVALIDCALL;
 
  Direct3D_VMTable = (PDWORD)*(PDWORD)Direct3D_Object;
  Direct3D_Object->Release();

  DWORD dwProtect;

  if(VirtualProtect(&Direct3D_VMTable[15], sizeof(DWORD), PAGE_READWRITE, &dwProtect) != 0)
  {
    *(PDWORD)&CreateDevice_Pointer = Direct3D_VMTable[15];
    *(PDWORD)&Direct3D_VMTable[15] = (DWORD)CreateDevice_Detour;

    if(VirtualProtect(&Direct3D_VMTable[15], sizeof(DWORD), dwProtect, &dwProtect) == 0)
    return D3DERR_INVALIDCALL;
  }
  else
  return D3DERR_INVALIDCALL;

  return D3D_OK;
}

//=====================================================================================
//=====================================================================================

HRESULT WINAPI CreateDevice_Detour(LPDIRECT3D8 Direct3D_Object, UINT Adapter, D3DDEVTYPE DeviceType, HWND FocusWindow,
                    DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* PresentationParameters,
                    LPDIRECT3DDEVICE8* Returned_Device_Interface)
{
  HRESULT Returned_Result = CreateDevice_Pointer(Direct3D_Object, Adapter, DeviceType, FocusWindow, BehaviorFlags,
                                              PresentationParameters, Returned_Device_Interface);

  DWORD dwProtect;

  if(VirtualProtect(&Direct3D_VMTable[15], sizeof(DWORD), PAGE_READWRITE, &dwProtect) != 0)
  {
    *(PDWORD)&Direct3D_VMTable[15] = *(PDWORD)&CreateDevice_Pointer;
    CreateDevice_Pointer           = NULL;

    if(VirtualProtect(&Direct3D_VMTable[15], sizeof(DWORD), dwProtect, &dwProtect) == 0)
    return D3DERR_INVALIDCALL;
  }
  else
  return D3DERR_INVALIDCALL;

  if(Returned_Result == D3D_OK)
  {
    Direct3D_VMTable = (PDWORD)*(PDWORD)*Returned_Device_Interface;

    *(PDWORD)&Reset_Pointer                = (DWORD)Direct3D_VMTable[14];
    *(PDWORD)&EndScene_Pointer             = (DWORD)Direct3D_VMTable[35];
    *(PDWORD)&DrawIndexedPrimitive_Pointer = (DWORD)Direct3D_VMTable[71];

    *(PDWORD)&Direct3D_VMTable[14] = (DWORD)Reset_Detour;
    *(PDWORD)&Direct3D_VMTable[35] = (DWORD)EndScene_Detour;
    *(PDWORD)&Direct3D_VMTable[71] = (DWORD)DrawIndexedPrimitive_Detour;
  }
   
  return Returned_Result;
}

//=====================================================================================
the hotkey is also F1 and its only a XQZ wallhack

please help me with my problem. im a slow learner and im having a hard time in hooking..

best regards,
larongpating
01/23/2010 16:16 firefox800#2
Nice hack but u should chk your detour files..
01/25/2010 11:11 Cleidophoros#3
Quote:
Originally Posted by larongpating View Post
Hello!!!

this is my source code of my wallhack for pSF

ahmn well anyway here is my source code that ive compiled for
Philippine Special force

ive switched to d3d9 but it seems to be that this code is detected
this wallhack is only XQZ and i have set its key to F1



Code:
// prototype.cpp : Defines the exported functions for the DLL application.
//
// prototype.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include <windows.h>
#include <d3d9.h>
#pragma comment(lib, "d3d9.lib")
#include <d3dx9.h>
#pragma comment(lib, "d3dx9.lib")
#include <iostream>
//==================================Defines============================================
#define ForceRecon (nNumVertices == 83 && nPrimitiveCount == 137 || nNumVertices == 79 && nPrimitiveCount == 105 || nNumVertices == 142 && nPrimitiveCount == 174 || nNumVertices == 278 && nPrimitiveCount == 462 || nNumVertices == 263 && nPrimitiveCount == 290 || nNumVertices == 316 && nPrimitiveCount == 556)
#define ForceReconAddons (nNumVertices == 432 && nPrimitiveCount == 354 || nNumVertices == 144 && nPrimitiveCount == 136 || nNumVertices == 299 && nPrimitiveCount == 311 || nNumVertices == 167 && nPrimitiveCount == 252 || nNumVertices == 298 && nPrimitiveCount == 506 || nNumVertices == 168 && nPrimitiveCount == 254 || nNumVertices == 860 && nNumVertices == 778 || nNumVertices == 648 && nPrimitiveCount == 710 || nNumVertices == 113 && nPrimitiveCount == 189 || nNumVertices == 142 && nPrimitiveCount == 172 || nNumVertices == 87 && nPrimitiveCount == 90 || nNumVertices == 79 && nPrimitiveCount == 105 || nNumVertices == 84 && nPrimitiveCount == 110 || nNumVertices == 70 && nPrimitiveCount == 70 || nNumVertices == 860 && nPrimitiveCount == 778 || nNumVertices == 85 && nPrimitiveCount == 137)
#define Mulan (nNumVertices == 118 && nPrimitiveCount == 126|| nNumVertices == 121 && nPrimitiveCount == 180|| nNumVertices == 124 && nPrimitiveCount == 126|| nNumVertices == 295 && nPrimitiveCount == 482|| nNumVertices == 299 && nPrimitiveCount == 452|| nNumVertices == 474 && nPrimitiveCount == 728)
#define MulanAddons (nNumVertices == 162 && nPrimitiveCount == 200|| nNumVertices == 120 && nPrimitiveCount == 188|| nNumVertices == 167 && nPrimitiveCount == 276|| nNumVertices == 108 && nPrimitiveCount == 198|| nNumVertices == 512 && nPrimitiveCount == 728|| nNumVertices == 790 && nPrimitiveCount == 881|| nNumVertices == 619 && nPrimitiveCount == 800|| nNumVertices == 399 && nPrimitiveCount == 532|| nNumVertices == 402 && nPrimitiveCount == 580|| nNumVertices == 102 && nPrimitiveCount == 170|| nNumVertices == 125 && nPrimitiveCount == 98|| nNumVertices == 116 && nPrimitiveCount == 128|| nNumVertices == 160 && nPrimitiveCount == 174)
//=====================================================================================================================================================================================================================================================================================================================//
#pragma warning(disable:4305)
//=====================================================================================
int XQZ;
int m_Stride;
int texnum;
int nNumVertices;
int nPrimitiveCount;
float ScreenCenterX = 0.0f;
float ScreenCenterY = 0.0f;
D3DCOLOR redt = D3DCOLOR_XRGB( 255, 0, 0 );
//=====================================================================================
//=====================================================================================

typedef HRESULT (WINAPI* CreateDevice_Prototype)        (LPDIRECT3D9, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE9*);
typedef HRESULT (WINAPI* Reset_Prototype)               (LPDIRECT3DDEVICE9, D3DPRESENT_PARAMETERS*);
typedef HRESULT (WINAPI* EndScene_Prototype)            (LPDIRECT3DDEVICE9);
typedef HRESULT (WINAPI* DrawIndexedPrimitive_Prototype)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);

CreateDevice_Prototype         CreateDevice_Pointer         = NULL;
Reset_Prototype                Reset_Pointer                = NULL;
EndScene_Prototype             EndScene_Pointer             = NULL;
DrawIndexedPrimitive_Prototype DrawIndexedPrimitive_Pointer = NULL;

HRESULT WINAPI Direct3DCreate9_VMTable    (VOID);
HRESULT WINAPI CreateDevice_Detour        (LPDIRECT3D9, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE9*);
HRESULT WINAPI Reset_Detour               (LPDIRECT3DDEVICE9, D3DPRESENT_PARAMETERS*);
HRESULT WINAPI EndScene_Detour            (LPDIRECT3DDEVICE9);
HRESULT WINAPI DrawIndexedPrimitive_Detour(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);

DWORD WINAPI VirtualMethodTableRepatchingLoopToCounterExtensionRepatching(LPVOID);
PDWORD Direct3D_VMTable = NULL;

//=====================================================================================

BOOL WINAPI DllMain(HINSTANCE hinstModule, DWORD dwReason, LPVOID lpvReserved)
{
  if(dwReason == DLL_PROCESS_ATTACH)
  {
    DisableThreadLibraryCalls(hinstModule);

    if(Direct3DCreate9_VMTable() == D3D_OK)
    return TRUE;
  }

  return FALSE;
}

//===============================================================
//=====================================================================================

HRESULT WINAPI Reset_Detour(LPDIRECT3DDEVICE9 Device_Interface, D3DPRESENT_PARAMETERS* PresentationParameters)
{
  return Reset_Pointer(Device_Interface, PresentationParameters);
}

//=====================================================================================

HRESULT WINAPI EndScene_Detour(LPDIRECT3DDEVICE9 Device_Interface)
{
if (GetAsyncKeyState(VK_F1)&1) //
{ XQZ = !XQZ; } //
  return EndScene_Pointer(Device_Interface);
}
///////////////////////
HRESULT WINAPI DrawIndexedPrimitive_Detour(LPDIRECT3DDEVICE9 Device_Interface, D3DPRIMITIVETYPE pType, INT BaseIndex,
                                           UINT MinIndex, UINT NumVertices, UINT StartIndex, UINT PrimitiveCount)
{
  LPDIRECT3DVERTEXBUFFER9 Stream_Data;
  UINT Offset = 0;
  UINT Stride = 40;

  if(Device_Interface->GetStreamSource(0, &Stream_Data, &Offset, &Stride) == D3D_OK)
  Stream_Data->Release();
//============================================================================================================

if(XQZ)
{
texnum = (nNumVertices*100000)+nPrimitiveCount;
if(Stride == 40 &&
 
(texnum==34900580)|| // Delta Force Head
(texnum==36100604)|| // Spetsnaz Head
(texnum==38000658)|| // Spetsnaz Legs
(texnum==18300268)|| // Spetsnaz Body
(texnum==36200604)|| // GIGN Head
(texnum==21200306)|| // GIGN Body
(texnum==35500568)|| // GSG9 Head
(texnum==2200024)|| // GSG9 Bangs
(texnum==8800105)|| // GSG9 Feet
(texnum==36900650)|| // GSG9 Legs
(texnum==19600314)|| // GSG9 Body
(texnum==36700612)|| // SAS Head
(texnum==8500105)|| // SAS Feet
(texnum==37000650)|| // SAS Legs
(texnum==18000274)|| // SAS Body
(texnum==35300556)|| // KSF Head
(texnum==7500121)|| // KSF Arms
(texnum==9200115)|| // KSF Feet
(texnum==12400168)|| // KSF Hands
(texnum==30100522)|| // KSF Legs
(texnum==18700288)|| // KSF Body
(texnum==40900594)|| // ARTC Head
(texnum==11700190)|| // ARTC Arms
(texnum==9100118)|| // ARTC Feet
(texnum==12500170)|| // ARTC Hands
(texnum==37000634)|| // ARTC Legs
(texnum==41700516)|| // ARTC Body
(texnum==19400260)|| // ROKMC Body
(texnum==37900592)|| // ROKMC Head
(texnum==36500642)|| // ROKMC Legs
(texnum==44800776)|| // SRG Head
(texnum==15900200)|| // SRG Left Arm
(texnum==10500168)|| // SRG Right Arm
(texnum==80401016)|| // SRG Body
(texnum==10000121)|| // SRG Feet
(texnum==13200180)|| // SRG Hands
(ForceRecon)|| // ForceRecon
(Mulan)||
(texnum==33800534)) // SRG Leg
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 213 && nPrimitiveCount == 174) // M67 Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 158 && nPrimitiveCount == 131) // Flashbang =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 171 && nPrimitiveCount == 143) // Smoke Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 271 && nPrimitiveCount == 257) // VX Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 338 && nPrimitiveCount == 339) // RGD-5 Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
 
 
 
if (Stride==40 && // Equipment =============== //
(texnum==13200212)|| // Delta Force Helmet
(texnum==13200212)|| // Delta Force Helmet 2
(texnum==34700538)|| // Delta Force Gas Mask
(texnum==19500352)|| // Delta Force Balaclava
(texnum==84900778)|| // Delta Force Clan BDU
(texnum==27500442)|| // Delta Force Body Armor
(texnum==42800576)|| // Delta Force Body Armor 2
(texnum==52100658)|| // Delta Force Tactical Vest
(texnum==12200196)|| // Spetsnaz Helmet
(texnum==27100464)|| // Spetsnaz Gas Mask
(texnum==33600552)|| // Spetsnaz Body Armor
(texnum==44100646)|| // Spetsnaz Tactical Vest
(texnum==17800292)|| // GIGN Red Bandana
(texnum==21300290)|| // GIGN Helmet
(texnum==2800036)|| // GIGN Helmet Lens
(texnum==35700558)|| // GIGN Gas Mask
(texnum==22100396)|| // GIGN Balaclava
(texnum==29700492)|| // GIGN Body Armor
(texnum==11200188)|| // ROKMC Beret
(texnum==12000194)|| // ROKMC Helmet
(texnum==29800450)|| // ROKMC Gas Mask
(texnum==27100394)|| // ROKMC Body Armor
(texnum==28700374)|| // ROKMC X Harness
(texnum==34700470)|| // ROKMC X Harness
(texnum==5100056)|| // ROKMC Pouch
(texnum==9900163)|| // ROKMC Left Arm
(texnum==18300163)|| // ROKMC Right Arm
(texnum==16400266)|| // GSG9 Red Bandana
(texnum==16200243)|| // GSG9 Helmet
(texnum==31900466)|| // GSG9 Gas Mask
(texnum==19300342)|| // GSG9 Balaclava
(texnum==83600752)|| // GSG9 Clan BDU
(texnum==33400477)|| // GSG9 Body Armor
(texnum==10500163)|| // GSG9 Rolled Up Sleeves
(texnum==38100666)|| // GSG9 Tactical Knee Pads
(texnum==9600172)|| // SAS Boonie Hat
(texnum==14200236)|| // SAS Helmet
(texnum==37800552)|| // SAS Gas Mask
(texnum==28100486)|| // SAS Balaclava
(texnum==62400752)|| // SAS Clan BDU
(texnum==27900456)|| // SAS Body Armor
(texnum==45700654)|| // SAS Tactical Vest
(texnum==39800532)|| // SAS Tactical Vest 2
(texnum==9200100)|| // SAS Holster
(texnum==4800040)|| // SAS Magazine Pouch
(texnum==4000044)|| // SAS Pouch
(texnum==6500110) || // KSF Boonie Hat
(texnum==12900208)|| // KSF Helmet
(texnum==29600448)|| // KSF Gas Mask
(texnum==31100398)|| // KSF Sunglasses
(texnum==84700776)|| // KSF Clan BDU
(texnum==600004)|| // KSF Clan BDU Logo
(texnum==36500606)|| // KSF Body Armor
(texnum==63100646)|| // KSF Tactical Vest
(texnum==19800163)|| // KSF Rolled Up Sleeves
(texnum==7000066)|| // KSF Holster
(texnum==10400190)|| // SRG Beret
(texnum==23800294)|| // SRG Deer Head
(texnum==11600180)|| // SRG NIJ IIIA Helmet
(texnum==17100278)|| // SRG Red Bandana
(texnum==14600198)|| // SRG Battle Cap
(texnum==18200266)|| // SRG Helmet
(texnum==19100106)|| // SRG Gas Mask
(texnum==54300350)|| // SRG Sunglasses
(texnum==30800380)|| // SRG Mid Class Sunglasses
(texnum==79300995)|| // SRG Clan BDU 1
(texnum==13300138)|| // SRG Clan BDU 2
(texnum==300001)|| // SRG Clan BDU 3
(texnum==1200012)|| // SRG Clan BDU Logo
(texnum==10900110)|| // SRG Bulletproof Vest
(texnum==6200064)|| // SRG Holster
(ForceReconAddons)||
(MulanAddons)||
(texnum==22700250)) // SRG Pouch
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (Stride==40 && // Guns =============== //
(texnum==187200968)|| // GALIL
(texnum==187200968)|| // GALIL 2
(texnum==149701124)|| // UZI
(texnum==193701304)|| // M249
(texnum==232501431)|| // SIG551
(texnum==161500751)|| // FA-MAS
(texnum==107400724)|| // FR-F2
(texnum==141600900)|| // AN94
(texnum==145900805)|| // G36C
(texnum==42200339)|| // K1
(texnum==23400116)|| // K1 2
(texnum==17500073)|| // K1 3
(texnum==3200012)|| // K1 4
(texnum==2300012)|| // K1 5
(texnum==71900459)|| // MP5
(texnum==1800008)|| // MP5 2
(texnum==20300084)|| // MP5 3
(texnum==16700083)|| // MP5 4
(texnum==79100469)|| // M4A1
(texnum==12000044)|| // M4A1 2
(texnum==16800062)|| // M4A1 3
(texnum==2400008)|| // M4A1 4
(texnum==600002)|| // M4A1 5
(texnum==12800050)|| // M4A1 6
(texnum==2600010)|| // M4A1 7
(texnum==4200014)|| // M4A1 8
(texnum==1400008)|| // M4A1 9
(texnum==80600442)|| // M16A2
(texnum==13400052)|| // M16A2 2
(texnum==17600066)|| // M16A2 3
(texnum==5400018)|| // M16A2 4
(texnum==46200348)|| // STEYR_AUG
(texnum==27000133)|| // STEYR_AUG 2
(texnum==4100025)|| // STEYR_AUG 3
(texnum==1200006)|| // STEYR_AUG 4
(texnum==400002)|| // STEYR_AUG 5
(texnum==46800367)|| // PSG-1
(texnum==9600042)|| // PSG-1 2
(texnum==18800092)|| // PSG-1 3
(texnum==16900071)|| // PSG-1 4
(texnum==3400012)|| // PSG-1 5
(texnum==800004)|| // PSG-1 6
(texnum==40500383)|| // K2
(texnum==15800089)|| // K2 2
(texnum==2200012)|| // K2 3
(texnum==7000034)|| // K2 4
(texnum==60700349)|| // P90
(texnum==5500033)|| // P90 2
(texnum==47700227)|| // P90 3
(texnum==10300047)|| // P90 4
(texnum==3800014)|| // P90 5
(texnum==50300349)|| // AK-74
(texnum==14700071)|| // AK-74 2
(texnum==13100061)|| // AK-74 3
(texnum==194501145)|| // MG36
(texnum==116000670)|| // DESERT EAGLE
(texnum==182101089)|| // MR73
(texnum==62500454)|| // REMINGTON M870
(texnum==95200571)|| // BENELLI M1
(texnum==40700334)|| // GLOCK 23
(texnum==71500449)|| // BERETTA M92F
(texnum==11000044)|| // BERETTA M92F 2
(texnum==16500075)|| // BERETTA M92F 3
(texnum==4400020)|| // BERETTA M92F 4
(texnum==2800014)|| // BERETTA M92F 5
(texnum==92000543)|| // COLT 45
(texnum==239001276)) // DRAGONUV
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
}
return DrawIndexedPrimitive_Pointer(Device_Interface, pType, BaseIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);
}
//=====================================================================================

HRESULT WINAPI Direct3DCreate9_VMTable(VOID)
{
  LPDIRECT3D9 Direct3D_Object = Direct3DCreate9(D3D_SDK_VERSION);

  if(Direct3D_Object == NULL)
  return D3DERR_INVALIDCALL;
 
  Direct3D_VMTable = (PDWORD)*(PDWORD)Direct3D_Object;
  Direct3D_Object->Release();

  DWORD dwProtect;

  if(VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), PAGE_READWRITE, &dwProtect) != 0)
  {
    *(PDWORD)&CreateDevice_Pointer = Direct3D_VMTable[16];
    *(PDWORD)&Direct3D_VMTable[16] = (DWORD)CreateDevice_Detour;

    if(VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), dwProtect, &dwProtect) == 0)
    return D3DERR_INVALIDCALL;
  }
  else
  return D3DERR_INVALIDCALL;

  return D3D_OK;
}

//=====================================================================================
//=====================================================================================

HRESULT WINAPI CreateDevice_Detour(LPDIRECT3D9 Direct3D_Object, UINT Adapter, D3DDEVTYPE DeviceType, HWND FocusWindow,
                    DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* PresentationParameters,
                    LPDIRECT3DDEVICE9* Returned_Device_Interface)
{
  HRESULT Returned_Result = CreateDevice_Pointer(Direct3D_Object, Adapter, DeviceType, FocusWindow, BehaviorFlags,
                                              PresentationParameters, Returned_Device_Interface);
  
  DWORD dwProtect;

  if(VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), PAGE_READWRITE, &dwProtect) != 0)
  {
    *(PDWORD)&Direct3D_VMTable[16] = *(PDWORD)&CreateDevice_Pointer;
    CreateDevice_Pointer           = NULL;

    if(VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), dwProtect, &dwProtect) == 0)
    return D3DERR_INVALIDCALL;
  }
  else
  return D3DERR_INVALIDCALL;

  if(Returned_Result == D3D_OK)
  {
    Direct3D_VMTable = (PDWORD)*(PDWORD)*Returned_Device_Interface;

    *(PDWORD)&Reset_Pointer                = (DWORD)Direct3D_VMTable[16];
    *(PDWORD)&EndScene_Pointer             = (DWORD)Direct3D_VMTable[42];
    *(PDWORD)&DrawIndexedPrimitive_Pointer = (DWORD)Direct3D_VMTable[82];

    if(CreateThread(NULL, 0, VirtualMethodTableRepatchingLoopToCounterExtensionRepatching, NULL, 0, NULL) == NULL)
    return D3DERR_INVALIDCALL;
  }
   
  return Returned_Result;
}

//=====================================================================================
//=====================================================================================
//=====================================================================================

DWORD WINAPI VirtualMethodTableRepatchingLoopToCounterExtensionRepatching(LPVOID Param)
{
  UNREFERENCED_PARAMETER(Param);

  while(1)
  {
    Sleep(100);

    *(PDWORD)&Direct3D_VMTable[42] = (DWORD)EndScene_Detour;
    *(PDWORD)&Direct3D_VMTable[82] = (DWORD)DrawIndexedPrimitive_Detour;
    *(PDWORD)&Direct3D_VMTable[16] = (DWORD)Reset_Detour;
  }

  return 1;
}

//=====================================================================================


and here my d3d8 compilation it seems to be that in lobby ive stayed for 1hours and the gameguard doesnt detect it.. but when im in game..
the gameguard says that there's a d3d8.dll error
ahmn, here's my source code

Code:
// prototype.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include <windows.h>
#include <d3d8.h>
#pragma comment(lib, "d3d8.lib")
#include <iostream>
//==================================Defines============================================
#define ForceRecon (nNumVertices == 83 && nPrimitiveCount == 137 || nNumVertices == 79 && nPrimitiveCount == 105 || nNumVertices == 142 && nPrimitiveCount == 174 || nNumVertices == 278 && nPrimitiveCount == 462 || nNumVertices == 263 && nPrimitiveCount == 290 || nNumVertices == 316 && nPrimitiveCount == 556)
#define ForceReconAddons (nNumVertices == 432 && nPrimitiveCount == 354 || nNumVertices == 144 && nPrimitiveCount == 136 || nNumVertices == 299 && nPrimitiveCount == 311 || nNumVertices == 167 && nPrimitiveCount == 252 || nNumVertices == 298 && nPrimitiveCount == 506 || nNumVertices == 168 && nPrimitiveCount == 254 || nNumVertices == 860 && nNumVertices == 778 || nNumVertices == 648 && nPrimitiveCount == 710 || nNumVertices == 113 && nPrimitiveCount == 189 || nNumVertices == 142 && nPrimitiveCount == 172 || nNumVertices == 87 && nPrimitiveCount == 90 || nNumVertices == 79 && nPrimitiveCount == 105 || nNumVertices == 84 && nPrimitiveCount == 110 || nNumVertices == 70 && nPrimitiveCount == 70 || nNumVertices == 860 && nPrimitiveCount == 778 || nNumVertices == 85 && nPrimitiveCount == 137)
#define Mulan (nNumVertices == 118 && nPrimitiveCount == 126|| nNumVertices == 121 && nPrimitiveCount == 180|| nNumVertices == 124 && nPrimitiveCount == 126|| nNumVertices == 295 && nPrimitiveCount == 482|| nNumVertices == 299 && nPrimitiveCount == 452|| nNumVertices == 474 && nPrimitiveCount == 728)
#define MulanAddons (nNumVertices == 162 && nPrimitiveCount == 200|| nNumVertices == 120 && nPrimitiveCount == 188|| nNumVertices == 167 && nPrimitiveCount == 276|| nNumVertices == 108 && nPrimitiveCount == 198|| nNumVertices == 512 && nPrimitiveCount == 728|| nNumVertices == 790 && nPrimitiveCount == 881|| nNumVertices == 619 && nPrimitiveCount == 800|| nNumVertices == 399 && nPrimitiveCount == 532|| nNumVertices == 402 && nPrimitiveCount == 580|| nNumVertices == 102 && nPrimitiveCount == 170|| nNumVertices == 125 && nPrimitiveCount == 98|| nNumVertices == 116 && nPrimitiveCount == 128|| nNumVertices == 160 && nPrimitiveCount == 174)
//=====================================================================================================================================================================================================================================================================================================================//
#pragma warning(disable:4305)
//=====================================================================================
int XQZ;
int m_Stride;
int texnum;
int nNumVertices;
int nPrimitiveCount;
float ScreenCenterX = 0.0f;
float ScreenCenterY = 0.0f;
D3DCOLOR redt = D3DCOLOR_XRGB( 255, 0, 0 );
//=====================================================================================
//=====================================================================================

typedef HRESULT (WINAPI* CreateDevice_Prototype)        (LPDIRECT3D8, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE8*);
typedef HRESULT (WINAPI* Reset_Prototype)               (LPDIRECT3DDEVICE8, D3DPRESENT_PARAMETERS*);
typedef HRESULT (WINAPI* EndScene_Prototype)            (LPDIRECT3DDEVICE8);
typedef HRESULT (WINAPI* DrawIndexedPrimitive_Prototype)(LPDIRECT3DDEVICE8, D3DPRIMITIVETYPE, UINT, UINT, UINT, UINT);

CreateDevice_Prototype         CreateDevice_Pointer         = NULL;
Reset_Prototype                Reset_Pointer                = NULL;
EndScene_Prototype             EndScene_Pointer             = NULL;
DrawIndexedPrimitive_Prototype DrawIndexedPrimitive_Pointer = NULL;

HRESULT WINAPI Direct3DCreate8_VMTable    (VOID);
HRESULT WINAPI CreateDevice_Detour        (LPDIRECT3D8, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE8*);
HRESULT WINAPI Reset_Detour               (LPDIRECT3DDEVICE8, D3DPRESENT_PARAMETERS*);
HRESULT WINAPI EndScene_Detour            (LPDIRECT3DDEVICE8);
HRESULT WINAPI DrawIndexedPrimitive_Detour(LPDIRECT3DDEVICE8, D3DPRIMITIVETYPE, UINT, UINT, UINT, UINT);

PDWORD Direct3D_VMTable = NULL;

//=====================================================================================

BOOL WINAPI DllMain(HINSTANCE hinstModule, DWORD dwReason, LPVOID lpvReserved)
{
  if(dwReason == DLL_PROCESS_ATTACH)
  {
    DisableThreadLibraryCalls(hinstModule);

    if(Direct3DCreate8_VMTable() == D3D_OK)
    return TRUE;
  }

  return FALSE;
}

//=====================================================================================
//=====================================================================================

HRESULT WINAPI Reset_Detour(LPDIRECT3DDEVICE8 Device_Interface, D3DPRESENT_PARAMETERS* PresentationParameters)
{
  return Reset_Pointer(Device_Interface, PresentationParameters);
}

//=====================================================================================

HRESULT WINAPI EndScene_Detour(LPDIRECT3DDEVICE8 Device_Interface)
{
if (GetAsyncKeyState(VK_F1)&1) //
{ XQZ = !XQZ; } //
  return EndScene_Pointer(Device_Interface);
}
//=====================================================================================
HRESULT WINAPI DrawIndexedPrimitive_Detour(LPDIRECT3DDEVICE8 Device_Interface, D3DPRIMITIVETYPE pType,
UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount)
{
 
LPDIRECT3DVERTEXBUFFER8 Stream_Data;
UINT Stride = 40;
if(Device_Interface->GetStreamSource(0, &Stream_Data, &Stride) == D3D_OK)
Stream_Data->Release();
//============================================================================================================
if(XQZ)
{
texnum = (nNumVertices*100000)+nPrimitiveCount;
if(Stride == 40 &&
 
(texnum==34900580)|| // Delta Force Head
(texnum==36100604)|| // Spetsnaz Head
(texnum==38000658)|| // Spetsnaz Legs
(texnum==18300268)|| // Spetsnaz Body
(texnum==36200604)|| // GIGN Head
(texnum==21200306)|| // GIGN Body
(texnum==35500568)|| // GSG9 Head
(texnum==2200024)|| // GSG9 Bangs
(texnum==8800105)|| // GSG9 Feet
(texnum==36900650)|| // GSG9 Legs
(texnum==19600314)|| // GSG9 Body
(texnum==36700612)|| // SAS Head
(texnum==8500105)|| // SAS Feet
(texnum==37000650)|| // SAS Legs
(texnum==18000274)|| // SAS Body
(texnum==35300556)|| // KSF Head
(texnum==7500121)|| // KSF Arms
(texnum==9200115)|| // KSF Feet
(texnum==12400168)|| // KSF Hands
(texnum==30100522)|| // KSF Legs
(texnum==18700288)|| // KSF Body
(texnum==40900594)|| // ARTC Head
(texnum==11700190)|| // ARTC Arms
(texnum==9100118)|| // ARTC Feet
(texnum==12500170)|| // ARTC Hands
(texnum==37000634)|| // ARTC Legs
(texnum==41700516)|| // ARTC Body
(texnum==19400260)|| // ROKMC Body
(texnum==37900592)|| // ROKMC Head
(texnum==36500642)|| // ROKMC Legs
(texnum==44800776)|| // SRG Head
(texnum==15900200)|| // SRG Left Arm
(texnum==10500168)|| // SRG Right Arm
(texnum==80401016)|| // SRG Body
(texnum==10000121)|| // SRG Feet
(texnum==13200180)|| // SRG Hands
(ForceRecon)|| // ForceRecon
(Mulan)||
(texnum==33800534)) // SRG Leg
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 213 && nPrimitiveCount == 174) // M67 Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 158 && nPrimitiveCount == 131) // Flashbang =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 171 && nPrimitiveCount == 143) // Smoke Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 271 && nPrimitiveCount == 257) // VX Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (nNumVertices == 338 && nPrimitiveCount == 339) // RGD-5 Grenade =============== //
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
 
 
 
if (Stride==40 && // Equipment =============== //
(texnum==13200212)|| // Delta Force Helmet
(texnum==13200212)|| // Delta Force Helmet 2
(texnum==34700538)|| // Delta Force Gas Mask
(texnum==19500352)|| // Delta Force Balaclava
(texnum==84900778)|| // Delta Force Clan BDU
(texnum==27500442)|| // Delta Force Body Armor
(texnum==42800576)|| // Delta Force Body Armor 2
(texnum==52100658)|| // Delta Force Tactical Vest
(texnum==12200196)|| // Spetsnaz Helmet
(texnum==27100464)|| // Spetsnaz Gas Mask
(texnum==33600552)|| // Spetsnaz Body Armor
(texnum==44100646)|| // Spetsnaz Tactical Vest
(texnum==17800292)|| // GIGN Red Bandana
(texnum==21300290)|| // GIGN Helmet
(texnum==2800036)|| // GIGN Helmet Lens
(texnum==35700558)|| // GIGN Gas Mask
(texnum==22100396)|| // GIGN Balaclava
(texnum==29700492)|| // GIGN Body Armor
(texnum==11200188)|| // ROKMC Beret
(texnum==12000194)|| // ROKMC Helmet
(texnum==29800450)|| // ROKMC Gas Mask
(texnum==27100394)|| // ROKMC Body Armor
(texnum==28700374)|| // ROKMC X Harness
(texnum==34700470)|| // ROKMC X Harness
(texnum==5100056)|| // ROKMC Pouch
(texnum==9900163)|| // ROKMC Left Arm
(texnum==18300163)|| // ROKMC Right Arm
(texnum==16400266)|| // GSG9 Red Bandana
(texnum==16200243)|| // GSG9 Helmet
(texnum==31900466)|| // GSG9 Gas Mask
(texnum==19300342)|| // GSG9 Balaclava
(texnum==83600752)|| // GSG9 Clan BDU
(texnum==33400477)|| // GSG9 Body Armor
(texnum==10500163)|| // GSG9 Rolled Up Sleeves
(texnum==38100666)|| // GSG9 Tactical Knee Pads
(texnum==9600172)|| // SAS Boonie Hat
(texnum==14200236)|| // SAS Helmet
(texnum==37800552)|| // SAS Gas Mask
(texnum==28100486)|| // SAS Balaclava
(texnum==62400752)|| // SAS Clan BDU
(texnum==27900456)|| // SAS Body Armor
(texnum==45700654)|| // SAS Tactical Vest
(texnum==39800532)|| // SAS Tactical Vest 2
(texnum==9200100)|| // SAS Holster
(texnum==4800040)|| // SAS Magazine Pouch
(texnum==4000044)|| // SAS Pouch
(texnum==6500110) || // KSF Boonie Hat
(texnum==12900208)|| // KSF Helmet
(texnum==29600448)|| // KSF Gas Mask
(texnum==31100398)|| // KSF Sunglasses
(texnum==84700776)|| // KSF Clan BDU
(texnum==600004)|| // KSF Clan BDU Logo
(texnum==36500606)|| // KSF Body Armor
(texnum==63100646)|| // KSF Tactical Vest
(texnum==19800163)|| // KSF Rolled Up Sleeves
(texnum==7000066)|| // KSF Holster
(texnum==10400190)|| // SRG Beret
(texnum==23800294)|| // SRG Deer Head
(texnum==11600180)|| // SRG NIJ IIIA Helmet
(texnum==17100278)|| // SRG Red Bandana
(texnum==14600198)|| // SRG Battle Cap
(texnum==18200266)|| // SRG Helmet
(texnum==19100106)|| // SRG Gas Mask
(texnum==54300350)|| // SRG Sunglasses
(texnum==30800380)|| // SRG Mid Class Sunglasses
(texnum==79300995)|| // SRG Clan BDU 1
(texnum==13300138)|| // SRG Clan BDU 2
(texnum==300001)|| // SRG Clan BDU 3
(texnum==1200012)|| // SRG Clan BDU Logo
(texnum==10900110)|| // SRG Bulletproof Vest
(texnum==6200064)|| // SRG Holster
(ForceReconAddons)||
(MulanAddons)||
(texnum==22700250)) // SRG Pouch
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
if (Stride==40 && // Guns =============== //
(texnum==187200968)|| // GALIL
(texnum==187200968)|| // GALIL 2
(texnum==149701124)|| // UZI
(texnum==193701304)|| // M249
(texnum==232501431)|| // SIG551
(texnum==161500751)|| // FA-MAS
(texnum==107400724)|| // FR-F2
(texnum==141600900)|| // AN94
(texnum==145900805)|| // G36C
(texnum==42200339)|| // K1
(texnum==23400116)|| // K1 2
(texnum==17500073)|| // K1 3
(texnum==3200012)|| // K1 4
(texnum==2300012)|| // K1 5
(texnum==71900459)|| // MP5
(texnum==1800008)|| // MP5 2
(texnum==20300084)|| // MP5 3
(texnum==16700083)|| // MP5 4
(texnum==79100469)|| // M4A1
(texnum==12000044)|| // M4A1 2
(texnum==16800062)|| // M4A1 3
(texnum==2400008)|| // M4A1 4
(texnum==600002)|| // M4A1 5
(texnum==12800050)|| // M4A1 6
(texnum==2600010)|| // M4A1 7
(texnum==4200014)|| // M4A1 8
(texnum==1400008)|| // M4A1 9
(texnum==80600442)|| // M16A2
(texnum==13400052)|| // M16A2 2
(texnum==17600066)|| // M16A2 3
(texnum==5400018)|| // M16A2 4
(texnum==46200348)|| // STEYR_AUG
(texnum==27000133)|| // STEYR_AUG 2
(texnum==4100025)|| // STEYR_AUG 3
(texnum==1200006)|| // STEYR_AUG 4
(texnum==400002)|| // STEYR_AUG 5
(texnum==46800367)|| // PSG-1
(texnum==9600042)|| // PSG-1 2
(texnum==18800092)|| // PSG-1 3
(texnum==16900071)|| // PSG-1 4
(texnum==3400012)|| // PSG-1 5
(texnum==800004)|| // PSG-1 6
(texnum==40500383)|| // K2
(texnum==15800089)|| // K2 2
(texnum==2200012)|| // K2 3
(texnum==7000034)|| // K2 4
(texnum==60700349)|| // P90
(texnum==5500033)|| // P90 2
(texnum==47700227)|| // P90 3
(texnum==10300047)|| // P90 4
(texnum==3800014)|| // P90 5
(texnum==50300349)|| // AK-74
(texnum==14700071)|| // AK-74 2
(texnum==13100061)|| // AK-74 3
(texnum==194501145)|| // MG36
(texnum==116000670)|| // DESERT EAGLE
(texnum==182101089)|| // MR73
(texnum==62500454)|| // REMINGTON M870
(texnum==95200571)|| // BENELLI M1
(texnum==40700334)|| // GLOCK 23
(texnum==71500449)|| // BERETTA M92F
(texnum==11000044)|| // BERETTA M92F 2
(texnum==16500075)|| // BERETTA M92F 3
(texnum==4400020)|| // BERETTA M92F 4
(texnum==2800014)|| // BERETTA M92F 5
(texnum==92000543)|| // COLT 45
(texnum==239001276)) // DRAGONUV
{
Device_Interface->SetRenderState(D3DRS_LIGHTING, false);
Device_Interface->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
}
return DrawIndexedPrimitive_Pointer(Device_Interface, pType, nMinIndex, nNumVertices, nStartIndex, nPrimitiveCount);
}
//=====================================================================================

HRESULT WINAPI Direct3DCreate8_VMTable(VOID)
{
  LPDIRECT3D8 Direct3D_Object = Direct3DCreate8(D3D_SDK_VERSION);

  if(Direct3D_Object == NULL)
  return D3DERR_INVALIDCALL;
 
  Direct3D_VMTable = (PDWORD)*(PDWORD)Direct3D_Object;
  Direct3D_Object->Release();

  DWORD dwProtect;

  if(VirtualProtect(&Direct3D_VMTable[15], sizeof(DWORD), PAGE_READWRITE, &dwProtect) != 0)
  {
    *(PDWORD)&CreateDevice_Pointer = Direct3D_VMTable[15];
    *(PDWORD)&Direct3D_VMTable[15] = (DWORD)CreateDevice_Detour;

    if(VirtualProtect(&Direct3D_VMTable[15], sizeof(DWORD), dwProtect, &dwProtect) == 0)
    return D3DERR_INVALIDCALL;
  }
  else
  return D3DERR_INVALIDCALL;

  return D3D_OK;
}

//=====================================================================================
//=====================================================================================

HRESULT WINAPI CreateDevice_Detour(LPDIRECT3D8 Direct3D_Object, UINT Adapter, D3DDEVTYPE DeviceType, HWND FocusWindow,
                    DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* PresentationParameters,
                    LPDIRECT3DDEVICE8* Returned_Device_Interface)
{
  HRESULT Returned_Result = CreateDevice_Pointer(Direct3D_Object, Adapter, DeviceType, FocusWindow, BehaviorFlags,
                                              PresentationParameters, Returned_Device_Interface);

  DWORD dwProtect;

  if(VirtualProtect(&Direct3D_VMTable[15], sizeof(DWORD), PAGE_READWRITE, &dwProtect) != 0)
  {
    *(PDWORD)&Direct3D_VMTable[15] = *(PDWORD)&CreateDevice_Pointer;
    CreateDevice_Pointer           = NULL;

    if(VirtualProtect(&Direct3D_VMTable[15], sizeof(DWORD), dwProtect, &dwProtect) == 0)
    return D3DERR_INVALIDCALL;
  }
  else
  return D3DERR_INVALIDCALL;

  if(Returned_Result == D3D_OK)
  {
    Direct3D_VMTable = (PDWORD)*(PDWORD)*Returned_Device_Interface;

    *(PDWORD)&Reset_Pointer                = (DWORD)Direct3D_VMTable[14];
    *(PDWORD)&EndScene_Pointer             = (DWORD)Direct3D_VMTable[35];
    *(PDWORD)&DrawIndexedPrimitive_Pointer = (DWORD)Direct3D_VMTable[71];

    *(PDWORD)&Direct3D_VMTable[14] = (DWORD)Reset_Detour;
    *(PDWORD)&Direct3D_VMTable[35] = (DWORD)EndScene_Detour;
    *(PDWORD)&Direct3D_VMTable[71] = (DWORD)DrawIndexedPrimitive_Detour;
  }
   
  return Returned_Result;
}

//=====================================================================================
the hotkey is also F1 and its only a XQZ wallhack

please help me with my problem. im a slow learner and im having a hard time in hooking..

best regards,
larongpating
wew, is that Visual Studio 2008 or C++?
01/25/2010 13:39 larongpating#4
this is vc++ sir :) mga pinoy dyan please help me finish this project
thank you :)
03/27/2010 08:46 dan013#5
anu b yan hndi n man nagana wallhack mo!!!nung kinomplile q wla ngyari
03/27/2010 08:51 markjosefff#6
Quote:
Originally Posted by dan013 View Post
anu b yan hndi n man nagana wallhack mo!!!nung kinomplile q wla ngyari
basahin mo nga ung title ?? "Help Me To Complete It".. hayzz .. ee di dafat may gawin ka din dyan .. -_-"
03/27/2010 14:35 WatchOutBelow#7
hahah nagulat ako dun sa nag reklamo :))
@topic
sir you done nice job so far . goodluck ^^

hahah nagulat ako dun sa nag reklamo :))
@topic
sir you done nice job so far . goodluck ^^
03/27/2010 15:53 torjak99#8
Quote:
Originally Posted by dan013 View Post
anu b yan hndi n man nagana wallhack mo!!!nung kinomplile q wla ngyari
Tanga nmn nito!

d cguro marunong magbasa!
03/27/2010 16:11 Cleidophoros#9
a little manipulation will make this code better.
03/28/2010 05:09 kingjohn05#10
undetected nga to maybe....SetRenderState ung problema nyan! parang ung FullBrite.... make the d3d8 error!
03/28/2010 14:16 †DARNOC†#11
* CLOSED
~ Stop Bumping at Old threads