OldSchoolHack

Registrieren / Anmelden Deutsch

[C++]CoD4 DLL hack Problem

icon Thema: [C++]CoD4 DLL hack Problem

Anmeldungsdatum: Aug 2011

Beiträge: 1

Hey leute,
ich beschäftige mich seit gut einer woche damit einen schönen CoD4 hack zu coden. Dazu nutzte ich C++ mit der standart <windows.h> libary. Als Dll injector benuttzte ich Fu's Injector. Bei mir funktioniert auch alles wunderbar doch wenn ich die dll einem Kummple schicken kann er sie zwar injecten aber im spiel ist nicht davon zusehen.
Weiß jemand vielleicht weiter?

Würde mich über antwort sehr freuen

Source: main.cpp

CPP Code:
  1.  
  2. #define DLL_EXPORT
  3. #include "main.h"
  4. #include <windows.h>
  5.  
  6.  
  7.  
  8. HANDLE CallOfDuty4 = GetCurrentProcess();
  9.  
  10.  
  11.  
  12.  
  13.  
  14. DWORD GameBase = 0x400000;
  15.  
  16.  
  17.  
  18.  
  19.  
  20. DWORD NORECOIL = GameBase + 0x057CCF;
  21. DWORD MINIMAP = GameBase + 0x02A0B4;
  22. DWORD MINIMAP1 = GameBase + 0x02A0B5;
  23. DWORD MINIMAP2 = GameBase + 0x02A0B6;
  24. DWORD MINIMAP3 = GameBase + 0x02A0B7;
  25. DWORD MINIMAP4 = GameBase + 0x02A0B8;
  26. DWORD LASER = GameBase + 0x056E78;
  27. DWORD NAMETAGS = GameBase + 0x02E1CE;
  28. DWORD NAMETAGS1 = GameBase + 0x02E1CF;
  29. DWORD NAMETAGS2 = GameBase + 0x02E1AC;
  30. DWORD NAMETAGS3 = GameBase + 0x02E1AD;
  31. DWORD NAMETAGS4 = GameBase + 0x02E1AF;
  32. DWORD NAMETAGS5 = GameBase + 0x02E1B0;
  33. DWORD NAMETAGS6 = GameBase + 0x02E1B1;
  34. DWORD FOG = GameBase + 0x23DB0D;
  35. DWORD FOG1 = GameBase + 0x23DB0E;
  36. DWORD DVAR = GameBase + 0x16B386;
  37. DWORD WALLHACK = GameBase + 0x045480;
  38. DWORD ESP1 = 0x0040326E;
  39. DWORD ESP2 = 0x00403281;
  40. DWORD Crosshair = 0x430EE3;
  41. DWORD Crosshair2 = 0x430ED5;
  42.  
  43.  
  44.  
  45.  
  46. BYTE NoRecoil[] = {0x75, 0x12};
  47. BYTE Wallhack[] = {0x6a, 0x12};
  48. BYTE Laser[] = {0x74, 0x04};
  49. BYTE NameTags[] = {0x75, 0x12};
  50. BYTE Dvar[] = {0x74, 0x19};
  51. BYTE ESP1A[] = {0x75, 0x2C};
  52. BYTE ESP2A[] = {0x90, 0x90};
  53.  
  54.  
  55.  
  56. BYTE NopOne[] = {0x90};
  57. BYTE NopTwo[] = {0x90,0x90};
  58. BYTE NopThree[] = {0x90,0x90,0x90};
  59. BYTE NopFour[] = {0x90,0x90,0x90,0x90};
  60.  
  61.  
  62.  
  63.  
  64.  
  65. void SendCommandToConsole(char* command)
  66. {
  67. __asm
  68. {
  69. push command
  70. push 0
  71. push 0
  72. mov esi, 0x004F9AB0
  73. call esi
  74. add esp, 0x0C
  75. }
  76. }
  77.  
  78.  
  79.  
  80.  
  81. DWORD WINAPI SetupDvars(LPVOID)
  82. {
  83. SendCommandToConsole("dvar_int laser 0 0 1");
  84. SendCommandToConsole("dvar_int wallhack 0 0 1");
  85. SendCommandToConsole("dvar_int nofog 0 0 1");
  86. SendCommandToConsole("dvar_int dvarunlock 0 0 1");
  87. SendCommandToConsole("dvar_int minimap 0 0 1");
  88. SendCommandToConsole("dvar_int norecoil 0 0 1");
  89. SendCommandToConsole("dvar_int esp 0 0 1");
  90.  
  91. return true;
  92. }
  93.  
  94.  
  95.  
  96. BOOL WINAPI DllMain (HINSTANCE hModule, DWORD dwAttached, LPVOID lpvReserved)
  97. {
  98.  
  99.  
  100. if (dwAttached==DLL_PROCESS_ATTACH)
  101. {
  102.  
  103.  
  104. WriteProcessMemory(CallOfDuty4, (void*)LASER, &Laser, 2, 0);
  105. WriteProcessMemory(CallOfDuty4, (void*)MINIMAP, &NopTwo, 2, 0);
  106. WriteProcessMemory(CallOfDuty4, (void*)MINIMAP1, &NopTwo, 2, 0);
  107. WriteProcessMemory(CallOfDuty4, (void*)MINIMAP2, &NopTwo, 2, 0);
  108. WriteProcessMemory(CallOfDuty4, (void*)MINIMAP3, &NopTwo, 2, 0);
  109. WriteProcessMemory(CallOfDuty4, (void*)NAMETAGS, &NopOne, 1, 0);
  110. WriteProcessMemory(CallOfDuty4, (void*)NAMETAGS1, &NopOne, 1, 0);
  111. WriteProcessMemory(CallOfDuty4, (void*)NAMETAGS2, &NopOne, 1, 0);
  112. WriteProcessMemory(CallOfDuty4, (void*)NAMETAGS3, &NopOne, 1, 0);
  113. WriteProcessMemory(CallOfDuty4, (void*)NAMETAGS4, &NopOne, 1, 0);
  114. WriteProcessMemory(CallOfDuty4, (void*)NAMETAGS5, &NopOne, 1, 0);
  115. WriteProcessMemory(CallOfDuty4, (void*)NAMETAGS6, &NopOne, 1, 0);
  116. WriteProcessMemory(CallOfDuty4, (void*)FOG, &NopOne, 1, 0);
  117. WriteProcessMemory(CallOfDuty4, (void*)FOG1, &NopOne, 1, 0);
  118. WriteProcessMemory(CallOfDuty4, (void*)DVAR, &Dvar, 2, 0);
  119. WriteProcessMemory(CallOfDuty4, (void*)WALLHACK, &Wallhack, 2, 0);
  120. WriteProcessMemory(CallOfDuty4, (void*)NORECOIL, &NoRecoil, 2, 0);
  121. WriteProcessMemory(CallOfDuty4,(void*) ESP1,&ESP1A,1,0);
  122. WriteProcessMemory(CallOfDuty4,(void*) ESP2,&ESP2A,2,0);
  123. WriteProcessMemory(CallOfDuty4, (void*) Crosshair, &NopTwo,2,0);
  124. WriteProcessMemory(CallOfDuty4, (void*) Crosshair2, &NopTwo,2,0);
  125.  
  126.  
  127. CreateThread(0,0,SetupDvars,0,0,0);
  128. Beep(150,150);
  129.  
  130.  
  131. }
  132. return 1;
  133. }
  134.  

Source: main.h
CPP Code:
  1.  
  2. #ifndef DLLHEADER_H_INCLUDED
  3. #define DLLHEADER_H_INCLUDED
  4.  
  5. #ifdef DLL_EXPORT
  6. # define EXPORT __declspec (dllexport)
  7. #else
  8. # define EXPORT
  9. #endif
  10.  
  11. extern EXPORT void foo ();
  12.  
  13. #endif