Code:
#include <d3d9.h>
#include <d3dx9.h>
#include "Quelle.h"
#include "color.h"
#include "detour.h"
#include "int.h"
#include "Hacks.h"
#include "d3dmenu.h"
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "D3DX9.LIB")
LPDIRECT3DTEXTURE9 sRed,sYellow,sGreen,sBlue,sPurple,sPink,sOrange,sBlack,sWhite,sGrey,sCyan;
D3D9Menu *Bl4ck = NULL;
CD3DFont* pFont;
bool Color = true;
bool Create;
char *folder[] = {"[+]", "[-]"};
char *onoff[] = {"[OFF]", "[ON]"};
char *jump[] = {"[OFF]", "[500]", "[1000]", "[1500]", "[2000]", "[2500]"};
char *cham2[] = {"[OFF]", "[Normal]", "[Light]", "[Pro]"};
char *cham[] = {"[OFF]", "[Red]", "[Yellow]", "[Green]", "[Blue]", "[Purple]", "[Pink]", "[Orange]", "[Black]", "[White]", "[Grey]", "[Cyan]"};
void RebuildMenu(void)
{
Bl4ck->AddFolder("D3D Hacks", folder, &folder1, 2);
if (folder1)
{
Bl4ck->AddItem (" Chams",cham2, &CH_Chams, 4);
Bl4ck->AddItem (" Back",cham, &CH_ChamsColorA, 12);
Bl4ck->AddItem (" Front",cham, &CH_ChamsColorB, 12);
}
{
Bl4ck->AddFolder("Player Hacks", folder, &folder2, 2);
if (folder2)
{
Bl4ck->AddItem (" NFD",onoff, &CH_NFD, 2);
Bl4ck->AddItem (" Super Jump",jump, &CH_SuperJump, 6);
}
{
Bl4ck->AddFolder("Server Hacks", folder, &folder3, 2);
if (folder3)
{
Bl4ck->AddItem (" 5th Slot",onoff, &CH_Slot5, 2);
Bl4ck->AddItem (" 6th Slot",onoff, &CH_Slot6, 2);
Bl4ck->AddItem (" 7th Slot",onoff, &CH_Slot7, 2);
Bl4ck->AddItem (" 8th Slot",onoff, &CH_Slot8, 2);
}
{
Bl4ck->AddFolder("Vehicle Hacks", folder, &folder4, 2);
if (folder4)
{
Bl4ck->AddItem (" Vehicle Chams",onoff, &CH_ChamsSet, 3);
Bl4ck->AddItem (" Back",cham, &CH_ChamsSetA, 12);
Bl4ck->AddItem (" Front",cham, &CH_ChamsSetB, 12);
}
}
typedef HRESULT ( WINAPI* oPresent ) ( LPDIRECT3DDEVICE9 pDevice, CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion);
oPresent pPresent;
HRESULT WINAPI myPresent ( LPDIRECT3DDEVICE9 pDevice, CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion)
{
pFont = new CD3DFont("Arial", 8, D3DFONT_BOLD);
pFont->InitDeviceObjects(pDevice);
pFont->RestoreDeviceObjects();
if(Bl4ck == NULL)
{
Bl4ck = new D3D9Menu("DraX D3D");
}else{
Bl4ck->MenuShow(12,10,pFont,pDevice);
if(Bl4ck->Mmax==0) RebuildMenu();
Bl4ck->MenuNav();
}
Hacks();
delete pFont;
return pPresent(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
}
HRESULT GenerateTexture(IDirect3DDevice9 *pD3Ddev, IDirect3DTexture9 **ppD3Dtex, DWORD colour32)
{
if( FAILED(pD3Ddev->CreateTexture(8, 8, 1, 0, D3DFMT_A4R4G4B4, D3DPOOL_MANAGED, ppD3Dtex, NULL)) )
return E_FAIL;
WORD colour16 = ((WORD)((colour32>>28)&0xF)<<12)
|(WORD)(((colour32>>20)&0xF)<<8)
|(WORD)(((colour32>>12)&0xF)<<4)
|(WORD)(((colour32>>4)&0xF)<<0);
D3DLOCKED_RECT d3dlr;
(*ppD3Dtex)->LockRect(0, &d3dlr, 0, 0);
WORD *pDst16 = (WORD*)d3dlr.pBits;
for(int xy=0; xy < 8*8; xy++)
*pDst16++ = colour16;
(*ppD3Dtex)->UnlockRect(0);
return S_OK;
}
DWORD dwDrawindexedprimitive_ret;
HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, UINT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount)
{
LPDIRECT3DVERTEXBUFFER9 Stream_Data;
UINT Offset = 0;
UINT m_Stride = 0;
if(pDevice->GetStreamSource(0, &Stream_Data, &Offset, &m_Stride) == D3D_OK)
Stream_Data->Release();
if(Color)
{
GenerateTexture(pDevice, &sRed, RED);
GenerateTexture(pDevice, &sYellow, YELLOW);
GenerateTexture(pDevice, &sGreen, GREEN);
GenerateTexture(pDevice, &sBlue, BLUE);
GenerateTexture(pDevice, &sPurple, PURPLE);
GenerateTexture(pDevice, &sPink, PINK);
GenerateTexture(pDevice, &sOrange, ORANGE);
GenerateTexture(pDevice, &sBlack, BLACK);
GenerateTexture(pDevice, &sWhite, WHITE);
GenerateTexture(pDevice, &sGrey, GREY);
GenerateTexture(pDevice, &sCyan , CYAN);
Color = false;
}
//D3D Funcs
//Light Ambient, Adjustable
if (CH_LightChams==1)
{
pDevice->SetRenderState(D3DRS_LIGHTING, false);
pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255,255,255,255));
}else{
pDevice->SetRenderState(D3DRS_AMBIENT, false);
}
//With Weapon
if(CH_Chams==1)
{
if(CH_ChamsColorA || !CH_ChamsColorA)
{
if(m_Stride == 36)
{
if(CH_ChamsColorA) pDevice->SetRenderState(D3DRS_LIGHTING,false);
if(CH_ChamsColorA) pDevice->SetRenderState(D3DRS_ZENABLE,false);
if(CH_ChamsColorA==1){pDevice->SetTexture(0, sRed);}
if(CH_ChamsColorA==2){pDevice->SetTexture(0, sYellow);}
if(CH_ChamsColorA==3){pDevice->SetTexture(0, sGreen);}
if(CH_ChamsColorA==4){pDevice->SetTexture(0, sBlue);}
if(CH_ChamsColorA==5){pDevice->SetTexture(0, sPurple);}
if(CH_ChamsColorA==6){pDevice->SetTexture(0, sPink);}
if(CH_ChamsColorA==7){pDevice->SetTexture(0, sOrange);}
if(CH_ChamsColorA==8){pDevice->SetTexture(0, sBlack);}
if(CH_ChamsColorA==9){pDevice->SetTexture(0, sWhite);}
if(CH_ChamsColorA==10){pDevice->SetTexture(0, sGrey);}
if(CH_ChamsColorA==11){pDevice->SetTexture(0, sCyan);}
myDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
}
if(m_Stride == 32)
{
if(CH_ChamsColorA) pDevice->SetRenderState(D3DRS_LIGHTING,false);
if(CH_ChamsColorA) pDevice->SetRenderState(D3DRS_ZENABLE,false);
if(CH_ChamsColorA==1){pDevice->SetTexture(0, sRed);}
if(CH_ChamsColorA==2){pDevice->SetTexture(0, sYellow);}
if(CH_ChamsColorA==3){pDevice->SetTexture(0, sGreen);}
if(CH_ChamsColorA==4){pDevice->SetTexture(0, sBlue);}
if(CH_ChamsColorA==5){pDevice->SetTexture(0, sPurple);}
if(CH_ChamsColorA==6){pDevice->SetTexture(0, sPink);}
if(CH_ChamsColorA==7){pDevice->SetTexture(0, sOrange);}
if(CH_ChamsColorA==8){pDevice->SetTexture(0, sBlack);}
if(CH_ChamsColorA==9){pDevice->SetTexture(0, sWhite);}
if(CH_ChamsColorA==10){pDevice->SetTexture(0, sGrey);}
if(CH_ChamsColorA==11){pDevice->SetTexture(0, sCyan);}
myDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
}
}
}
if(CH_Chams==1)
{
if(CH_ChamsColorB || !CH_ChamsColorB)
{
if(m_Stride== 36){
if(CH_ChamsColorB)pDevice->SetRenderState(D3DRS_LIGHTING, false);
if(CH_ChamsColorB)pDevice->SetRenderState(D3DRS_ZENABLE, true);
if(CH_ChamsColorB==1){pDevice->SetTexture(0, sRed);}
if(CH_ChamsColorB==2){pDevice->SetTexture(0, sYellow);}
if(CH_ChamsColorB==3){pDevice->SetTexture(0, sGreen);}
if(CH_ChamsColorB==4){pDevice->SetTexture(0, sBlue);}
if(CH_ChamsColorB==5){pDevice->SetTexture(0, sPurple);}
if(CH_ChamsColorB==6){pDevice->SetTexture(0, sPink);}
if(CH_ChamsColorB==7){pDevice->SetTexture(0, sOrange);}
if(CH_ChamsColorB==8){pDevice->SetTexture(0, sBlack);}
if(CH_ChamsColorB==9){pDevice->SetTexture(0, sWhite);}
if(CH_ChamsColorB==10){pDevice->SetTexture(0, sGrey);}
if(CH_ChamsColorB==11){pDevice->SetTexture(0, sCyan);}
}
if(m_Stride== 32){
if(CH_ChamsColorB)pDevice->SetRenderState(D3DRS_LIGHTING, false);
if(CH_ChamsColorB)pDevice->SetRenderState(D3DRS_ZENABLE, true);
if(CH_ChamsColorB==1){pDevice->SetTexture(0, sRed);}
if(CH_ChamsColorB==2){pDevice->SetTexture(0, sYellow);}
if(CH_ChamsColorB==3){pDevice->SetTexture(0, sGreen);}
if(CH_ChamsColorB==4){pDevice->SetTexture(0, sBlue);}
if(CH_ChamsColorB==5){pDevice->SetTexture(0, sPurple);}
if(CH_ChamsColorB==6){pDevice->SetTexture(0, sPink);}
if(CH_ChamsColorB==7){pDevice->SetTexture(0, sOrange);}
if(CH_ChamsColorB==8){pDevice->SetTexture(0, sBlack);}
if(CH_ChamsColorB==9){pDevice->SetTexture(0, sWhite);}
if(CH_ChamsColorB==10){pDevice->SetTexture(0, sGrey);}
if(CH_ChamsColorB==11){pDevice->SetTexture(0, sCyan);}
}
}
}
//Without Weapon
if(CH_Chams==2)
{
if(CH_ChamsColorA || !CH_ChamsColorA)
{
if(m_Stride == 36)
{
if(CH_ChamsColorA) pDevice->SetRenderState(D3DRS_LIGHTING,false);
if(CH_ChamsColorA) pDevice->SetRenderState(D3DRS_ZENABLE,false);
if(CH_ChamsColorA==1){pDevice->SetTexture(0, sRed);}
if(CH_ChamsColorA==2){pDevice->SetTexture(0, sYellow);}
if(CH_ChamsColorA==3){pDevice->SetTexture(0, sGreen);}
if(CH_ChamsColorA==4){pDevice->SetTexture(0, sBlue);}
if(CH_ChamsColorA==5){pDevice->SetTexture(0, sPurple);}
if(CH_ChamsColorA==6){pDevice->SetTexture(0, sPink);}
if(CH_ChamsColorA==7){pDevice->SetTexture(0, sOrange);}
if(CH_ChamsColorA==8){pDevice->SetTexture(0, sBlack);}
if(CH_ChamsColorA==9){pDevice->SetTexture(0, sWhite);}
if(CH_ChamsColorA==10){pDevice->SetTexture(0, sGrey);}
if(CH_ChamsColorA==11){pDevice->SetTexture(0, sCyan);}
myDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
}
}
}
if(CH_Chams==2)
{
if(CH_ChamsColorB || !CH_ChamsColorB)
{
if(m_Stride== 36){
if(CH_ChamsColorB)pDevice->SetRenderState(D3DRS_LIGHTING, false);
if(CH_ChamsColorB)pDevice->SetRenderState(D3DRS_ZENABLE, true);
if(CH_ChamsColorB==1){pDevice->SetTexture(0, sRed);}
if(CH_ChamsColorB==2){pDevice->SetTexture(0, sYellow);}
if(CH_ChamsColorB==3){pDevice->SetTexture(0, sGreen);}
if(CH_ChamsColorB==4){pDevice->SetTexture(0, sBlue);}
if(CH_ChamsColorB==5){pDevice->SetTexture(0, sPurple);}
if(CH_ChamsColorB==6){pDevice->SetTexture(0, sPink);}
if(CH_ChamsColorB==7){pDevice->SetTexture(0, sOrange);}
if(CH_ChamsColorB==8){pDevice->SetTexture(0, sBlack);}
if(CH_ChamsColorB==9){pDevice->SetTexture(0, sWhite);}
if(CH_ChamsColorB==10){pDevice->SetTexture(0, sGrey);}
if(CH_ChamsColorB==11){pDevice->SetTexture(0, sCyan);}
}
}
}
//Vehicle Chams
if(CH_ChamsSet==2)
{
if(CH_ChamsSetA || !CH_ChamsSetA)
{
if(m_Stride == 44)
{
if(CH_ChamsSetA) pDevice->SetRenderState(D3DRS_LIGHTING,false);
if(CH_ChamsSetA) pDevice->SetRenderState(D3DRS_ZENABLE,false);
if(CH_ChamsSetA==1){pDevice->SetTexture(0, sRed);}
if(CH_ChamsSetA==2){pDevice->SetTexture(0, sYellow);}
if(CH_ChamsSetA==3){pDevice->SetTexture(0, sGreen);}
if(CH_ChamsSetA==4){pDevice->SetTexture(0, sBlue);}
if(CH_ChamsSetA==5){pDevice->SetTexture(0, sPurple);}
if(CH_ChamsSetA==6){pDevice->SetTexture(0, sPink);}
if(CH_ChamsSetA==7){pDevice->SetTexture(0, sOrange);}
if(CH_ChamsSetA==8){pDevice->SetTexture(0, sBlack);}
if(CH_ChamsSetA==9){pDevice->SetTexture(0, sWhite);}
if(CH_ChamsSetA==10){pDevice->SetTexture(0, sGrey);}
if(CH_ChamsSetA==11){pDevice->SetTexture(0, sCyan);}
myDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
}
if(m_Stride == 44)
{
if(CH_ChamsSetA) pDevice->SetRenderState(D3DRS_LIGHTING,false);
if(CH_ChamsSetA) pDevice->SetRenderState(D3DRS_ZENABLE,false);
if(CH_ChamsSetA==1){pDevice->SetTexture(0, sRed);}
if(CH_ChamsSetA==2){pDevice->SetTexture(0, sYellow);}
if(CH_ChamsSetA==3){pDevice->SetTexture(0, sGreen);}
if(CH_ChamsSetA==4){pDevice->SetTexture(0, sBlue);}
if(CH_ChamsSetA==5){pDevice->SetTexture(0, sPurple);}
if(CH_ChamsSetA==6){pDevice->SetTexture(0, sPink);}
if(CH_ChamsSetA==7){pDevice->SetTexture(0, sOrange);}
if(CH_ChamsSetA==8){pDevice->SetTexture(0, sBlack);}
if(CH_ChamsSetA==9){pDevice->SetTexture(0, sWhite);}
if(CH_ChamsSetA==10){pDevice->SetTexture(0, sGrey);}
if(CH_ChamsSetA==11){pDevice->SetTexture(0, sCyan);}
myDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
}
}
}
if(CH_ChamsSet==1)
{
if(CH_ChamsSetB || !CH_ChamsSetB)
{
if(m_Stride== 44){
if(CH_ChamsSetB)pDevice->SetRenderState(D3DRS_LIGHTING, false);
if(CH_ChamsSetB)pDevice->SetRenderState(D3DRS_ZENABLE, true);
if(CH_ChamsSetB==1){pDevice->SetTexture(0, sRed);}
if(CH_ChamsSetB==2){pDevice->SetTexture(0, sYellow);}
if(CH_ChamsSetB==3){pDevice->SetTexture(0, sGreen);}
if(CH_ChamsSetB==4){pDevice->SetTexture(0, sBlue);}
if(CH_ChamsSetB==5){pDevice->SetTexture(0, sPurple);}
if(CH_ChamsSetB==6){pDevice->SetTexture(0, sPink);}
if(CH_ChamsSetB==7){pDevice->SetTexture(0, sOrange);}
if(CH_ChamsSetB==8){pDevice->SetTexture(0, sBlack);}
if(CH_ChamsSetB==9){pDevice->SetTexture(0, sWhite);}
if(CH_ChamsSetB==10){pDevice->SetTexture(0, sGrey);}
if(CH_ChamsSetB==11){pDevice->SetTexture(0, sCyan);}
}
if(m_Stride== 44){
if(CH_ChamsSetB)pDevice->SetRenderState(D3DRS_LIGHTING, false);
if(CH_ChamsSetB)pDevice->SetRenderState(D3DRS_ZENABLE, true);
if(CH_ChamsSetB==1){pDevice->SetTexture(0, sRed);}
if(CH_ChamsSetB==2){pDevice->SetTexture(0, sYellow);}
if(CH_ChamsSetB==3){pDevice->SetTexture(0, sGreen);}
if(CH_ChamsSetB==4){pDevice->SetTexture(0, sBlue);}
if(CH_ChamsSetB==5){pDevice->SetTexture(0, sPurple);}
if(CH_ChamsSetB==6){pDevice->SetTexture(0, sPink);}
if(CH_ChamsSetB==7){pDevice->SetTexture(0, sOrange);}
if(CH_ChamsSetB==8){pDevice->SetTexture(0, sBlack);}
if(CH_ChamsSetB==9){pDevice->SetTexture(0, sWhite);}
if(CH_ChamsSetB==10){pDevice->SetTexture(0, sGrey);}
if(CH_ChamsSetB==11){pDevice->SetTexture(0, sCyan);}
}
}
}
if(CH_ChamsSet==1)
{
if(CH_ChamsSetA || !CH_ChamsSetA)
{
if(m_Stride == 44)
{
if(CH_ChamsSetA) pDevice->SetRenderState(D3DRS_LIGHTING,false);
if(CH_ChamsSetA) pDevice->SetRenderState(D3DRS_ZENABLE,false);
if(CH_ChamsSetA==1){pDevice->SetTexture(0, sRed);}
if(CH_ChamsSetA==2){pDevice->SetTexture(0, sYellow);}
if(CH_ChamsSetA==3){pDevice->SetTexture(0, sGreen);}
if(CH_ChamsSetA==4){pDevice->SetTexture(0, sBlue);}
if(CH_ChamsSetA==5){pDevice->SetTexture(0, sPurple);}
if(CH_ChamsSetA==6){pDevice->SetTexture(0, sPink);}
if(CH_ChamsSetA==7){pDevice->SetTexture(0, sOrange);}
if(CH_ChamsSetA==8){pDevice->SetTexture(0, sBlack);}
if(CH_ChamsSetA==9){pDevice->SetTexture(0, sWhite);}
if(CH_ChamsSetA==10){pDevice->SetTexture(0, sGrey);}
if(CH_ChamsSetA==11){pDevice->SetTexture(0, sCyan);}
myDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
}
if(m_Stride == 44)
{
if(CH_ChamsSetA) pDevice->SetRenderState(D3DRS_LIGHTING,false);
if(CH_ChamsSetA) pDevice->SetRenderState(D3DRS_ZENABLE,false);
if(CH_ChamsSetA==1){pDevice->SetTexture(0, sRed);}
if(CH_ChamsSetA==2){pDevice->SetTexture(0, sYellow);}
if(CH_ChamsSetA==3){pDevice->SetTexture(0, sGreen);}
if(CH_ChamsSetA==4){pDevice->SetTexture(0, sBlue);}
if(CH_ChamsSetA==5){pDevice->SetTexture(0, sPurple);}
if(CH_ChamsSetA==6){pDevice->SetTexture(0, sPink);}
if(CH_ChamsSetA==7){pDevice->SetTexture(0, sOrange);}
if(CH_ChamsSetA==8){pDevice->SetTexture(0, sBlack);}
if(CH_ChamsSetA==9){pDevice->SetTexture(0, sWhite);}
if(CH_ChamsSetA==10){pDevice->SetTexture(0, sGrey);}
if(CH_ChamsSetA==11){pDevice->SetTexture(0, sCyan);}
myDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
}
}
}
if(CH_ChamsSet==1)
{
if(CH_ChamsSetB || !CH_ChamsSetB)
{
if(m_Stride== 44){
if(CH_ChamsSetB)pDevice->SetRenderState(D3DRS_LIGHTING, false);
if(CH_ChamsSetB)pDevice->SetRenderState(D3DRS_ZENABLE, true);
if(CH_ChamsSetB==1){pDevice->SetTexture(0, sRed);}
if(CH_ChamsSetB==2){pDevice->SetTexture(0, sYellow);}
if(CH_ChamsSetB==3){pDevice->SetTexture(0, sGreen);}
if(CH_ChamsSetB==4){pDevice->SetTexture(0, sBlue);}
if(CH_ChamsSetB==5){pDevice->SetTexture(0, sPurple);}
if(CH_ChamsSetB==6){pDevice->SetTexture(0, sPink);}
if(CH_ChamsSetB==7){pDevice->SetTexture(0, sOrange);}
if(CH_ChamsSetB==8){pDevice->SetTexture(0, sBlack);}
if(CH_ChamsSetB==9){pDevice->SetTexture(0, sWhite);}
if(CH_ChamsSetB==10){pDevice->SetTexture(0, sGrey);}
if(CH_ChamsSetB==11){pDevice->SetTexture(0, sCyan);}
}
if(m_Stride== 44){
if(CH_ChamsSetB)pDevice->SetRenderState(D3DRS_LIGHTING, false);
if(CH_ChamsSetB)pDevice->SetRenderState(D3DRS_ZENABLE, true);
if(CH_ChamsSetB==1){pDevice->SetTexture(0, sRed);}
if(CH_ChamsSetB==2){pDevice->SetTexture(0, sYellow);}
if(CH_ChamsSetB==3){pDevice->SetTexture(0, sGreen);}
if(CH_ChamsSetB==4){pDevice->SetTexture(0, sBlue);}
if(CH_ChamsSetB==5){pDevice->SetTexture(0, sPurple);}
if(CH_ChamsSetB==6){pDevice->SetTexture(0, sPink);}
if(CH_ChamsSetB==7){pDevice->SetTexture(0, sOrange);}
if(CH_ChamsSetB==8){pDevice->SetTexture(0, sBlack);}
if(CH_ChamsSetB==9){pDevice->SetTexture(0, sWhite);}
if(CH_ChamsSetB==10){pDevice->SetTexture(0, sGrey);}
if(CH_ChamsSetB==11){pDevice->SetTexture(0, sCyan);}
}
}
}
__asm
{
popad
jmp dwDrawindexedprimitive_ret;
}
}
int D3D(void)
{
HINSTANCE hD3D;
DWORD vTable[105];
hD3D=0;
do {
hD3D = GetModuleHandle("d3d9.dll");
if (!hD3D) Sleep(10);
} while(!hD3D);
if (D3Ddiscover((void *)&vTable[0],420)==0) return 0;
{
pPresent = (oPresent)DetourCreate((DWORD)vTable[17], (DWORD)myPresent,12);
Sleep(100);
}
return 0;
}
BOOL WINAPI DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{ HideModule(hDll);
EraseHeaders(hDll);
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)D3D, NULL, NULL, NULL);
}
return TRUE;
}
Addies.h: