Code:
#include <d3d9.h> #include <d3dx9.h> #include "Fuente.h" #include "color.h" #include "detour.h" #include "opciones.h" #include "Hacks.h" #include "d3dmenu.h" #include "d3dmenu.h" //#include "Structs.h" //Omg wie kann man das vergessen? xd #include "ServerHacks.h" // können die dort bleiben? #pragma comment(lib, "d3d9.lib") #pragma comment(lib, "D3DX9.LIB") D3D9Menu *pMenu = NULL; CD3DFont* pFont; // Farben halt LPDIRECT3DTEXTURE9 Red, Blue, Green, White, Black, Yellow; // Definition von den Farben LPDIRECT3DVERTEXBUFFER9 StreamData; // Definition von HRESULT GenerateTexture UINT OffsetInBytes; UINT m_Stride; // Definition m_Stride (Player, Vehicles) int Chams; // Chams int Color1; // Farbe 1 (Vor der Wand) int Color2; // Farbe 2 (Hinter der Wand) int Direct3DMenu; // D3D Folder char *Colors[] = {"OFF", "RED", "BLUE", "GREEN", "WHITE", "BLACK", "YELLOW"}; // Char "Colors", fürs Menü bool Color = true; bool Create; char *Moptfolder[] = {"+", "-"}; char *Moptonoff[] = {"OFF", "ON"}; char *cSpeed[]={"OFF","x2","x4","x7"}; int Playerhacks; int Server; void RebuildMenu(void) { pMenu->AddFolder("Direct3D", Moptfolder, &Direct3DMenu, 2); if(Direct3DMenu) { pMenu->AddCategory("Chams", Moptonoff, &Chams, 2); if(Chams) { pMenu->AddItem("Color 1", Colors, &Color1, 7); pMenu->AddItem("Color 2", Colors, &Color2, 7); } } pMenu->AddFolder("PlayerHacks", Moptfolder, &Playerhacks, 2); if (Playerhacks) { pMenu->AddItem("SuperJump",Moptonoff,&jump,2); pMenu->AddItem("NFD",Moptonoff,&NFD,2); pMenu->AddItem("NoSpawn",Moptonoff,&QUICKSPAWN,2); pMenu->AddItem("Stamina",Moptonoff,&STAMINA,2); pMenu->AddItem("NoBounds",Moptonoff,&NoBounds,2); pMenu->AddItem("Speed",cSpeed,&Speed,4); pMenu->AddItem("Bandage",Moptonoff,&Bandage,2); pMenu->AddItem("Super NoSpread",Moptonoff,&SuperNoSpread,2); pMenu->AddItem("No Recoil",Moptonoff,&NoRecoil,2); pMenu->AddItem("CQC Prone", Moptonoff, &CQCProne, 2); pMenu->AddItem("Plant Anywhere", Moptonoff, &Plantanywhere, 2); pMenu->AddItem("NoWater", Moptonoff, &NoWater, 2); pMenu->AddItem("FastAll", Moptonoff, &FastAll, 2); } pMenu->AddFolder("Serverhacks",Moptfolder,&Server,2); pMenu->AddItem("All Slots",Moptonoff,&Slots,2); pMenu->AddItem("Premium",Moptonoff,&Premium,2); pMenu->AddItem("Extra Ammo",Moptonoff,&ExtraAmmo,2); if (Server){ }} // Beschreibt die Funktion "GenerateTexture" 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; } HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount) { if(pDevice->GetStreamSource(0,&StreamData,&OffsetInBytes,&m_Stride) == D3D_OK) { StreamData->Release(); } DWORD dwOldZEnable = D3DZB_TRUE; if(Color) { GenerateTexture(pDevice, &White, WHITE); // generateTexture Generiert halt ne Textur (Was das ist is kla) , &White ist die "Define" so wie int Speed; WHITE ist die farbe aus der colors.h GenerateTexture(pDevice, &Red, RED); GenerateTexture(pDevice, &Green, GREEN); GenerateTexture(pDevice, &Blue, BLUE); GenerateTexture(pDevice, &Black, BLACK); GenerateTexture(pDevice, &Yellow, YELLOW); Color = false; } typedef HRESULT (WINAPI* oDrawIndexedPrimitive) (LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount); oDrawIndexedPrimitive pDrawIndexedPrimitive; if(Chams == 1) { if( (m_Stride == 36) || (m_Stride == 32) || (m_Stride == 44)) { pDevice->SetRenderState(D3DRS_ZENABLE, 0); if(Color1==1) pDevice->SetTexture(0, Red); if(Color1==2) pDevice->SetTexture(0, Blue); if(Color1==3) pDevice->SetTexture(0, Green); if(Color1==4) pDevice->SetTexture(0, White); if(Color1==5) pDevice->SetTexture(0, Black); if(Color1==6) pDevice->SetTexture(0, Yellow); pDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount); pDevice->SetRenderState(D3DRS_ZENABLE, 1); if(Color2==1) pDevice->SetTexture(0, Red); if(Color2==2) pDevice->SetTexture(0, Blue); if(Color2==3) pDevice->SetTexture(0, Green); if(Color2==4) pDevice->SetTexture(0, White); if(Color2==5) pDevice->SetTexture(0, Black); if(Color2==6) pDevice->SetTexture(0, Yellow); } } } 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("Comic Sans SM", 8, D3DFONT_BOLD); pFont->InitDeviceObjects(pDevice); pFont->RestoreDeviceObjects(); if(pMenu == NULL) { pMenu = new D3D9Menu("Stuxnet's D3D v4.0 ");//menü name }else{ pMenu->MenuShow(12,10,pFont,pDevice); if(pMenu->Mmax==0) RebuildMenu(); pMenu->MenuNav(); } HacksInGame(); //ServerHacks(); delete pFont; return pPresent(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion); } 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; }
What can i do please help me Thanks..