Einleitung:
Ich werde jeden Tag, ein dutzend mal gefragt: "Kannst du mir einen Hack machen, mit Aimbot, 1 Hit KIll und den ganzen anderen Funktionen?", usw..
Also, da mein Hack jetzt läuft und ich jetzt versuche das in Delphi zu programmieren, werde ich meine Base für das TuT benutzen.
Werde, natürlich ned alles machen. Ich werde euch nur mal mein Menü geben und euch erklären wie ihr es zum Laufen bringt. Also noch was zum Trinken holen, dan kanns losgehen.
Was wird benötigt:
Eines zuvor, ihr dürft kein Copy&Paste machen das klappt sonst nicht.
Ja zu guter Erst brauchen wir C++, da holt ihr euch am besten Microsoft Visual C++ 2010. Hier der Link:
So dann brauchen wir die neueste SDK von DirectX für D3D9.
So, das dauert jetzt auch ein bisschen, bis das alles gedownlaodet ist... Wenn der Download fertig ist und ihr alles installiert habt, dann startet ihr Visual C++.
So jetzt seht ihr die Startseite von Microsoft Visual C++ 2010. Jetzt geht ihr auf Datei, Neu, Projekt, jetzt seht ihr Windows Form Application usw. Aber wir brauchen eine Win32 Anwendung. Dann kommt Win32 Anwendungs Assistent, da steht unter Anwendungstyp Dll, da macht ihr Klick drauf und bei zusätzlichen Optionen geht ihr auf Leeres Projekt.
Wenn ihr noch nie was mit C++ gemacht habt und gar nicht wisst was ich meine, dann empfehle ich euch dieses Video, da wird schon ein bisschen was gezeigt und ihr könnt euch vl ein bisschen mehr darunter vorstellen.
Videos:
Er zeigt euch eig alles was man als Anfänger wissen sollte. Wenn ihr euch alle Videos über C++ anguckt, dann beherrscht ihr zumindest schon mal die Grundlagen und sogar ein bisschen mehr.
So wo waren wir, ehmm bei den Namen gebt ihr iwas ein, z.B. Menü Hack oder so.
So jetzt wird das Projekt erstellt.
Jetzt solltet ihr auf der linken Seite den Projektmappen-Explorer sehen, da seht ihr jetzt euer Projekt. Macht mal einen Doppelklick drauf, da sollten jetzt mehrere Untermappen kommen.
Das steht auch Header Files, da macht ihr einen Rechtsklick drauf und Neues Element. Jetzt haben wir wieder so eine Liste da, mit C++ Datei, Headerfiles usw... Ihr wählt Headerfiles un gebt beim Namen ein: Functions.
Das ist unser erster Headerfile, wir brauchen aber insgesamt 3 Headerfiles. Deswegen machen wir es noch einmla aber diesesmal mit dem Namen: SpeedsMenüClass.
So jetzt noch einmal, mit dem Namen: SystemIncludes. !Die Namen hier dürt ihr nicht selbst aussuchen, sondern da müsst ihr die schreiben die ich gerade aufgezählt habe!
Jetzt seht ihr dann bei den Ordner auch noch Source Files, da machen wir auch Rechtsklick > Neues Dokument > diesesmal C++ Datei > und den Namen D3DBase.
So und jetzt zum Coden:
ihr macht einen Doppelkick auf Functions.h und gebt diesen Source Code ein:
Functions.h:
#include "SystemIncludes.h"
Code:
void PrintText(char pString[], int x, int y, D3DCOLOR col, ID3DXFont *font) { RECT FontRect = { x, y, x+500, y+30 }; font->DrawText( NULL, pString, -1, &FontRect, DT_LEFT | DT_WORDBREAK, col); } void FillRGB( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice ) { if( w < 0 )w = 1; if( h < 0 )h = 1; if( x < 0 )x = 1; if( y < 0 )y = 1; D3DRECT rec = { x, y, x + w, y + h }; pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, color, 0, 0 ); } void DrawBorder( int x, int y, int w, int h, int px, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice ) { FillRGB( x, (y + h - px), w, px, BorderColor, pDevice ); FillRGB( x, y, px, h, BorderColor, pDevice ); FillRGB( x, y, w, px, BorderColor, pDevice ); FillRGB( (x + w - px), y, px, h, BorderColor, pDevice ); } void DrawBox( int x, int y, int w, int h, D3DCOLOR BoxColor, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice ) { FillRGB( x, y, w, h, BoxColor, pDevice ); DrawBorder( x, y, w, h, 1, BorderColor, pDevice ); } bool isMouseinRegion(int x1, int y1, int x2, int y2) { POINT cPos; GetCursorPos(&cPos); if(cPos.x > x1 && cPos.x < x2 && cPos.y > y1 && cPos.y < y2){ return true; } else { return false; } } bool bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask) { for(;*szMask;++szMask,++pData,++bMask) if(*szMask=='x' && *pData!=*bMask) return 0; return (*szMask) == NULL; } DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask) { for(DWORD i=0; i<dwLen; i++) if (bCompare((BYTE*)(dwAddress+i),bMask,szMask)) return (DWORD)(dwAddress+i); return 0; } void *DetourFunction (BYTE *src, const BYTE *dst, const int len) { BYTE *jmp; DWORD dwback; DWORD jumpto, newjump; VirtualProtect(src,len,PAGE_READWRITE,&dwback); if(src[0] == 0xE9) { jmp = (BYTE*)malloc(10); jumpto = (*(DWORD*)(src+1))+((DWORD)src)+5; newjump = (jumpto-(DWORD)(jmp+5)); jmp[0] = 0xE9; *(DWORD*)(jmp+1) = newjump; jmp += 5; jmp[0] = 0xE9; *(DWORD*)(jmp+1) = (DWORD)(src-jmp); } else { jmp = (BYTE*)malloc(5+len); memcpy(jmp,src,len); jmp += len; jmp[0] = 0xE9; *(DWORD*)(jmp+1) = (DWORD)(src+len-jmp)-5; } src[0] = 0xE9; *(DWORD*)(src+1) = (DWORD)(dst - src) - 5; for(int i = 5; i < len; i++) src[I] = 0x90; VirtualProtect(src,len,dwback,&dwback); return (jmp-len); }[/I]
Vielleicht, ist ein paar aufgefallen das das nicht C++ ist sondern Assembler Code.
So jetzt macht ihr Doppelklick auf SpeedsMenüClass.h!
SpeedsMenüClass.h:
#include "Functions.h"
Code:
typedef struct{ int index; char * title; int *hack; int hackmaxval; int hacktype; DWORD HCOLOR; }ITEM; class SpeedMenu { public: LPDIRECT3DDEVICE9 pDevice; LPD3DXFONT pFont; int hackcount; int selector; int x,y,w,h; DWORD COLOR; ITEM HACKITEM[99]; char hackrval[256]; void CreateItem(int index, char * title, int *hack,int hackmaxval=1,int hacktype=0); void BuildMenu(char * menuname, int x, int y, int h, int w, DWORD TITLECOL, DWORD BACKCOLOR, DWORD BORDERCOLOR, LPDIRECT3DDEVICE9 pDevice); void RenderMenu(); }; typedef HRESULT ( WINAPI* oReset )( LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters ); typedef HRESULT (WINAPI* oEndScene)(LPDIRECT3DDEVICE9 pDevice); // Hier die D3D Farben, die werden wir nachher nutzen #define RED D3DCOLOR_ARGB(255, 255, 0, 0) #define GREEN D3DCOLOR_ARGB(255, 0, 255, 0) #define BLUE D3DCOLOR_ARGB(255, 0, 0, 255) #define WHITE D3DCOLOR_ARGB(255, 255, 255, 255) #define BLACK D3DCOLOR_ARGB(255, 0, 0, 0) #define YELLOW D3DCOLOR_ARGB(255, 255, 255, 0) #define TEAL D3DCOLOR_ARGB(255, 0, 255, 255) #define PINK D3DCOLOR_ARGB(255, 255, 240, 0) #define ORANGE D3DCOLOR_ARGB(255, 255, 132, 0) #define LIME D3DCOLOR_ARGB(255, 198, 255, 0) #define SKYBLUE D3DCOLOR_ARGB(255, 0, 180, 255) #define MAROON D3DCOLOR_ARGB(255, 142, 30, 0) #define LGRAY D3DCOLOR_ARGB(255, 174, 174, 174) //Helles Grau #define DGRAY D3DCOLOR_ARGB(255, 71, 65, 64) //Dunkles Grau #define BROWN D3DCOLOR_ARGB(255, 77, 46, 38) #define SHIT D3DCOLOR_ARGB(255, 74, 38, 38) //
So und dann noch Doppelklick auf SystemIncludes.h!
SystemIncludes.h:
Code:
#include <Windows.h> #include <stdio.h> #include <d3d9.h> #include <d3dx9.h> #pragma comment(lib,"d3dx9.lib")
Jetzt kommt das eigentliche Menü, also gehen wir zum Ordner Source Files, machen dann Doppelklick auf D3DBase.cpp!
D3DBase.cpp:
Code:
#include "SpeedsMenüClass.h" oReset pReset; oEndScene pEndScene; SpeedMenu dMenu; LPDIRECT3DDEVICE9 g_pDevice = 0; int xFontOffSet = 30; int hackopt1; int MenuHeight = 15; int show = 1; int off = 0; //================================================================== //Hack Vars int hack1 = 0; int hack2 = 0; int hack3 = 0; int hack4 = 0; int hack5 = 0; int hack6 = 0; int hack7 = 0; int hack8 = 0; int hack9 = 0; int hack10 = 0; int hack11 = 0; int hack12 = 0; int hack13 = 0; int hack14 = 0; //================================================================== void SpeedMenu::CreateItem(int index, char * title, int *hack, int hackmaxval,int hacktype) { hackcount++; HACKITEM[hackcount].index = index; HACKITEM[hackcount].hack = hack; HACKITEM[hackcount].hackmaxval = hackmaxval; HACKITEM[hackcount].hacktype = hacktype; PrintText(title, xFontOffSet, index*15+8,HACKITEM[hackcount].HCOLOR,pFont); } void SpeedMenu::BuildMenu(char * menuname, int x, int y, int h, int w, DWORD TITLECOL, DWORD BACKCOLOR, DWORD BORDERCOLOR, LPDIRECT3DDEVICE9 pDevice) { if(GetAsyncKeyState(VK_INSERT)&1)show=(!show); if(!show) { DrawBox(0,0, w, 50, BACKCOLOR, BORDERCOLOR, pDevice); PrintText(menuname, 20, 10, TITLECOL, pFont); return; } DrawBox(x,y, w, h, BACKCOLOR, BORDERCOLOR, pDevice); PrintText(menuname, x+12, y+4, TITLECOL, pFont); CreateItem(1,"One Hit Kill", &hack1); CreateItem(2,"Aimbot", &hack2); CreateItem(3,"Aim Visibility", &hack3); CreateItem(4,"Chams", &hack4); CreateItem(5,"Instant Respawn", &hack5); CreateItem(6,"Speed Knifing", &hack6); CreateItem(7,"No Recoil", &hack7); CreateItem(11,"See Ghost", &hack11); CreateItem(12,"No Nade Damage", &hack12); CreateItem(13,"No Gun", &hack13); CreateItem(14,"C4 Fast Defuse", &hack14); CreateItem(8,"Health ESP", &hack8); CreateItem(9,"3D Boxes ESP", &hack9); CreateItem(10,"Name ESP", &hack10); RenderMenu(); } void SpeedMenu::RenderMenu() { if(GetAsyncKeyState(VK_DOWN)&1) selector++; if(GetAsyncKeyState(VK_UP)&1) if(selector > 1) selector--; if (GetAsyncKeyState(VK_RIGHT)<0){ for(int i=0;i < (hackcount+1);i++){ if(selector == HACKITEM[i].index){ if(*HACKITEM[i].hack < HACKITEM[i].hackmaxval) *HACKITEM[i].hack += 1; // man könnte hier jetzt noch ein Sleep setzen, ist aber nicht unbedingt nötig } } } if (GetAsyncKeyState(VK_LEFT)<0){ for(int i=0;i < (hackcount+1);i++){ if(selector == HACKITEM[i].index){ *HACKITEM[i].hack = 0; Sleep(200); } } } for(int i=0;i < (hackcount+1);i++){ if(selector == HACKITEM[i].index) HACKITEM[i].HCOLOR = YELLOW; else HACKITEM[i].HCOLOR = GREEN; } for(int i=1; i<(hackcount+1); i++){ if(HACKITEM[i].hacktype == 0){ if(*HACKITEM[i].hack == 1) PrintText("Ein", xFontOffSet+100, HACKITEM[i].index*15+8,GREEN,pFont); else PrintText("Aus", xFontOffSet+100, HACKITEM[i].index*15+8,RED,pFont); } } /*for(int i=1; i<(hackcount+1); i++){ if(HACKITEM[i].hackmaxval >1 && HACKITEM[i].hacktype == 1){ sprintf_s(hackrval, "%i", *HACKITEM[i].hack); PrintText(hackrval, xFontOffSet+100, HACKITEM[I].index*15,RED,pFont); } }*/ // So habe ich das berechnet if(selector < 1) selector = 1; if(selector > hackcount) selector = 1; hackcount = 0; } void TestThread() { if( hack2 == 1) PrintText("", 30, 200, GREEN, dMenu.pFont); else PrintText("", 30, 200, RED, dMenu.pFont); } void ReFont(LPDIRECT3DDEVICE9 pDevice) { if (g_pDevice != pDevice) { g_pDevice = pDevice; try { if (dMenu.pFont != 0) dMenu.pFont->Release(); } catch (...) {} dMenu.pFont = 0; D3DXCreateFontA(pDevice, 14, 0, FW_BOLD, 0, 0, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &dMenu.pFont ); } } HRESULT WINAPI Reset(IDirect3DDevice9* pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters ) { dMenu.pFont->OnLostDevice(); HRESULT hRet = pReset(pDevice, pPresentationParameters); dMenu.pFont->OnResetDevice(); return hRet; } HRESULT WINAPI EndScene(LPDIRECT3DDEVICE9 pDevice) { ReFont(pDevice); dMenu.BuildMenu("SpeeDHeads Private Hack",0,0,250,200,BLUE,BLACK,GREEN,pDevice); TestThread(); return pEndScene(pDevice); } int D3Dinit(void) { DWORD hD3D, adr, *vtbl; hD3D=0; do { hD3D = (DWORD)GetModuleHandle("d3d9.dll"); Sleep(10); } while(!hD3D); adr = FindPattern(hD3D, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx"); if (adr) { memcpy(&vtbl,(void *)(adr+2),4); pReset = (oReset) DetourFunction((PBYTE)vtbl[16] , (PBYTE)Reset ,5); pEndScene = (oEndScene) DetourFunction((PBYTE)vtbl[42], (PBYTE)EndScene,5); } return 0; } BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved ) { DisableThreadLibraryCalls(hDll); if ( dwReason == DLL_PROCESS_ATTACH ) { CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)D3Dinit, NULL, NULL, NULL); } if( dwReason == DLL_PROCESS_DETACH) { dMenu.pFont->Release(); } return TRUE; }[/I]
Also, wahrscheinlich sind jetzt viele Fehler drinnen. Das kann man beheben, zumindest ist es bei mir so. Ihr seht neben den grünen Play Button ein Feld in dem Debug steht, das stellt ihr auf Release um und versucht es nochmal.
So, das Menü wäre jetzt fertig, aber jetzt fehlen noch die Funktionen. Das müsst ihr euch selbst überlegen wie ihr das macht. Viel ist es ja jetzt nicht mehr. Aber ich werde euch mal ein paar Codes geben, die ich vor kurzem gefunden habe und auch erfolgreich getestet habe.
Hier die Codes, die ihr dann nur noch richtig einfügen müsst:
1 Hit Kill:
CODE: ALLES AUSWÄHLEN
for(int i=0 ; i<445 ; i++)
*(float*)( (*(DWORD*)((*(DWORD*)(CShellBase+0x0090A4B8))+(4*i ))) + 0x0754) = FLT_MAX ;
No Nade Damage:
CODE: ALLES AUSWÄHLEN
#define Gernades ((i==6)||(i==7)||(i==8)||(i==64)||(i==100)||(i==12 6)||(i==135)||(i==209)||(i==210)||(i==240)||(i==26 3)||(i==272)||(i==338)||(i==382)||(i==383)||(i==38 4))
for(int i=0 ; i<445 ; i++)
{
if(Gernades)
*(float*)( (*(DWORD*)((*(DWORD*)(CShellBase+0x0090A4B8))+(4*i ))) + 0x0754) = 0 ;
}
No Fall Damage:
Code:
[I]*(float*)( (*(DWORD*)(CShellBase+0x0090A4A0))+0x04 ) = 0;[/I]
Instant Respawn:
Code:
[I]memcpy((LPVOID)(CShellBase+0x003A30B),(LPBYTE)"\x90\x90",2);[/I]
Noch ein paar D3D Funktionen: ( Credits: [G]a[M]e[R] )
Datum Anzeige:
Code:
[I]char* DATE(void) { static char cdate[20] = ""; struct tm * current_tm; time_t current_time; time (¤t_time); current_tm = localtime (¤t_time); sprintf( cdate, "%d-%02d-%d",current_tm->tm_mon+1,current_tm->tm_mday,current_tm->tm_year-100+2000); return cdate; } [/I]
Code:
[I]#include <time.h> float fLastTickCount=0.0f; float fCurrentTickCount; char CH_FPS [20]; int CH_NoFPS=0; MenuAddItem("Framerate:",(char **)CH_FPS,0,0,MENUTEXT); if(CH_FPS) { fCurrentTickCount=clock() * 0.001f; CH_NoFPS++; if((fCurrentTickCount - fLastTickCount)>1.0f) { fLastTickCount=fCurrentTickCount; sprintf(CH_FPS, "%d", CH_NoFPS); CH_NoFPS=0; } }[/I]
So, das sollte mal reichen. Vielleicht werde ich noch ein paar adden.
Wenn ihr glaubt ihr seit fertig, dann startet ihr euer Projekt mal. Wenn es geklappt hat dann sollte irgend so eine Meldung kommen, das es nicht geöffnet werden kann, weil es ja eine Dll ist. Die Projekte bzw. das Programm solltet ihr unter Dokumente/Microsoft Visual 2010/Projects finden, wenn ihr nicht geändert habt.
So jetzt müssen wir das ja noch testen, da gibt es ein kleines Programm, habe es hier hochgeladen:
Einfach mit einem Injector die Dll in das Programm injecten, dann sollt das Menü erscheinen.
So und noch ein paar Screens, die das Menü zeigen.
So das wars von mir, hoffe es gefällt euch und ist ned zu kompliziert. Wenn ihr Fragen habt oder etwas klappt nicht einfach hier in den Thread stellen, werde versuchen alles zu beantworten. Kann schon sein das ich manches etwas undeutlich erklärt habe, aber bei so viel Text. ^^
Nochmals alle Programme die benötigt werden:
Microsft Visual C++ 2010:
DirectX SDK June 2010:
D3D Test Fenster:
Hier die fertige Dll: