OldSchoolHack

Register / Login English

[Community] AssaultCube

icon Thread: [Community] AssaultCube

Join Date: Jan 2013

Posts: 31

Hallo zusammen,

Sorry erst einmal, dass ich dieses alte Ding hier "ausgrabe".
Aber ich finde eure Idee gar nicht so schlecht, mal zusammen was auf zu bauen.

Was ich aber schlecht finde:
Wenn zum Beispiel Knacker etwas macht, wie z.B. Wallhack/Radarhack etc., dann bringt es zwar das Projekt weiter, aber die Leute, welche nicht so viel Ahnung haben und nicht einmal Baseadressen finden können, die sind dann wahrscheinlich damit total überfordert.
Daher sollte man, wenn man einen Code zum Projekt hinzufügt, diesen noch mit Kommentaren erklären.

Nun ja, ich habe hier mal mein Quell-Code zum Spiel: (Das ist ein Ammo- und Healthhack für den Einzelspieler)

Spoiler
CPP Code:
  1. #include <iostream>
  2. #include <windows.h>
  3. #include <string>
  4. #include <ctime>
  5. using namespace std;
  6.  
  7. DWORD findAddr(int &pointerlevel, DWORD &baseAddress, DWORD baseOffsets[]);
  8. void writeToAddr(void);
  9.  
  10. namespace ammo
  11. {
  12. bool ammoStatus = false;
  13. DWORD ammoBaseAddress = 0x004DF73C;
  14. DWORD ammoBaseOffsets[] = {0x378, 0x14, 0x00};
  15. int ammoPointerlevel = 3;
  16. BYTE ammoValue[] = {0xA3, 0x1C, 0x00, 0x00};
  17. }
  18.  
  19. namespace health
  20. {
  21. bool healthStatus = false;
  22. DWORD healthBaseAddress = 0x004DF73C;
  23. DWORD healthBaseOffsets[] = {0xF4};
  24. int healthPointerlevel = 1;
  25. BYTE healthValue[] = {0x39, 0x05, 0x00, 0x00};
  26. }
  27.  
  28. namespace myHandles
  29. {
  30. HWND hGameWindow = 0;
  31. DWORD dwProcID = 0;
  32. HANDLE hProcHandle = 0;
  33. }
  34.  
  35. using namespace ammo;
  36. using namespace health;
  37. using namespace myHandles;
  38.  
  39. int main(void)
  40. {
  41. int lastUpdateTMR = clock();
  42. int gameAvailCheckTMR = clock();
  43. int onePressTMR = clock();
  44.  
  45. bool isGameAvail;
  46. bool updateOnNextRun = true;
  47.  
  48. string sGameStatus;
  49. string sAmmoStatus = "OFF";
  50. string sHealthStatus = "OFF";
  51.  
  52. while(!GetAsyncKeyState(VK_INSERT))
  53. {
  54. if((clock() - gameAvailCheckTMR) > 100) //Game available check and console update
  55. {
  56. gameAvailCheckTMR = clock();
  57. isGameAvail = false;
  58.  
  59. hGameWindow = FindWindow(NULL, (LPCSTR)"AssaultCube");
  60. if(hGameWindow)
  61. {
  62. GetWindowThreadProcessId(hGameWindow, &dwProcID);
  63. if(dwProcID)
  64. {
  65. hProcHandle = OpenProcess(PROCESS_ALL_ACCESS, false, dwProcID);
  66. if(!hProcHandle)
  67. {
  68. sGameStatus = "Failed to open process for valid handle";
  69. }
  70. else
  71. {
  72. sGameStatus = "AssaultCube is now ready to hack";
  73. isGameAvail = true;
  74. }
  75. }
  76. else
  77. {
  78. sGameStatus = "Failed to get processID";
  79. }
  80. }
  81. else
  82. {
  83. sGameStatus = "Searching for AssaultCube...";
  84. }
  85.  
  86. if(updateOnNextRun || (clock() - lastUpdateTMR) > 5000)
  87. {
  88. system("cls");
  89. cout << "********************************************" << endl;
  90. cout << " External AssaultCube Memory Hacker " << endl;
  91. cout << "********************************************" << endl << endl;
  92.  
  93. cout << "GAME STATUS: " << sGameStatus << endl << endl;
  94.  
  95. cout << "[F1] Unlimited ammo ->" << sAmmoStatus << "<-" << endl;
  96. cout << "[F2] Unlimited health ->" << sHealthStatus << "<-" << endl;
  97. cout << "[INSERT] Exit" << endl;
  98. updateOnNextRun = false;
  99. lastUpdateTMR = clock();
  100. }
  101.  
  102. if(isGameAvail)
  103. {
  104. writeToAddr();
  105. }
  106. }
  107.  
  108. if((clock() - onePressTMR) > 400) // interaction
  109. {
  110. if(isGameAvail)
  111. {
  112. if(GetAsyncKeyState(VK_F1))
  113. {
  114. onePressTMR = clock();
  115. ammoStatus = !ammoStatus;
  116. updateOnNextRun = true;
  117. if(ammoStatus)
  118. {
  119. sAmmoStatus = "ON";
  120. }
  121. else
  122. {
  123. sAmmoStatus = "OFF";
  124. }
  125. }
  126. if(GetAsyncKeyState(VK_F2))
  127. {
  128. onePressTMR = clock();
  129. healthStatus = !healthStatus;
  130. updateOnNextRun = true;
  131. if(healthStatus)
  132. {
  133. sHealthStatus = "ON";
  134. }
  135. else
  136. {
  137. sHealthStatus = "OFF";
  138. }
  139. }
  140. }
  141. }
  142. }
  143.  
  144. CloseHandle(hProcHandle);
  145. CloseHandle(hGameWindow);
  146.  
  147. return 0;
  148. }
  149.  
  150. DWORD findAddr(int &pointerlevel, DWORD &baseAddress, DWORD baseOffsets[])
  151. {
  152. DWORD pTemp;
  153. DWORD pointer;
  154. ReadProcessMemory(hProcHandle, (LPCVOID)baseAddress, &pTemp, sizeof(pTemp), NULL);
  155. for(int c=0; c<pointerlevel; c++)
  156. {
  157. pointer = pTemp + baseOffsets[c];
  158. ReadProcessMemory(hProcHandle, (LPCVOID)pointer, &pTemp, sizeof(pTemp), NULL);
  159. }
  160. return pointer;
  161. }
  162.  
  163. void writeToAddr(void)
  164. {
  165. DWORD addressToWrite;
  166. if(ammoStatus)
  167. {
  168. addressToWrite = findAddr(ammoPointerlevel, ammoBaseAddress, ammoBaseOffsets);
  169. WriteProcessMemory( hProcHandle, (BYTE*)addressToWrite, &ammoValue, sizeof(ammoValue), NULL);
  170. }
  171. if(healthStatus)
  172. {
  173. addressToWrite = findAddr(healthPointerlevel, healthBaseAddress, healthBaseOffsets);
  174. WriteProcessMemory( hProcHandle, (BYTE*)addressToWrite, &healthValue, sizeof(healthValue), NULL);
  175. }
  176. }
  177.  

Diesen Code habe ich mit Hilfe eines Tutorials geschrieben und dann abgeändert bzw. angepasst und verschönert.

Ich wäre sehr interessiert daran, bei diesem Projekt Teil zu haben (:

Regards, xINKtn

__________________

CPP Lehrling

#######################################

Wenn ich online bin, dann bin ich auf diesem Teamspeak anzutreffen:
85.114.154.12:10428
Man darf mich gerne besuchen kommen.