Guest User

dosbox hack src 0.1

a guest
Jun 2nd, 2013
484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.38 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <iostream>
  3. #include <stdio.h>
  4. #include <TlHelp32.h>
  5. using std::cout;
  6. using std::cin;
  7. #include <limits>
  8. using std::numeric_limits;
  9. using std::streamsize;
  10. using namespace std;
  11. #include <cstdlib>
  12.  
  13. using namespace std;
  14.  
  15. HANDLE hProcess;
  16.  
  17. DWORD GetModuleBase(const DWORD dwProcessId, const char *szModuleName);
  18.  
  19.  
  20.  
  21. void WriteProcessMemory()
  22. {
  23.  
  24. DWORD pID;
  25. HANDLE hHandle;
  26. HWND hWindow;
  27. SetConsoleTitle( "DosBox Hack by Sandaasu" );
  28.  
  29. hWindow = FindWindow(0, "Counter-Strike: Global Offensive");
  30. GetWindowThreadProcessId( hWindow, &pID);
  31. hHandle = OpenProcess( PROCESS_ALL_ACCESS, 0, pID);
  32. if(hWindow == 0)
  33. {
  34.  
  35. system("color 0c");
  36.  
  37. cout << "Cannot find game.. Closing now.." << endl;
  38. Sleep(3000);
  39. exit(1);
  40. }
  41.  
  42. }
  43. void appTitle()
  44. {
  45.  
  46. WriteProcessMemory();
  47. }
  48.  
  49. void appFeatures()
  50. {
  51.  
  52. system("color 0a");
  53. cout << "DosBox Hack" << endl;
  54. cout << "Created by : Sandaasu" << endl;
  55. cout << "Version : 0.1 Beta \n" << endl;
  56. cout << "Starting......" << endl;
  57. Sleep(5000);
  58. system("cls");
  59.  
  60. cout << "======================================================" << endl;
  61.  
  62. cout << "[ HOTKEYS ]" << endl << endl;
  63. cout << "\t NumPad1 = SV bypass Activate" << endl;
  64. cout << "\t NumPad2 = Wallhack ON" << endl;
  65. cout << "\t NumPad3 = Wallhack OFF" << endl;
  66. cout << "\t NumPad4 = ESP ON " << endl;
  67. cout << "\t NumPad5 = ESP OFF" << endl;
  68. cout << "\t NumPad6 = FPS Active" << endl;
  69. cout << "\t NumPad7 = Glasswalls Active" << endl;
  70. cout << "\t NumPad8 = Remove Smoke" << endl;
  71. //cout << "\t F1 = PANIC Key" << endl;
  72. cout << "======================================================" << endl;
  73. cout << "\tEsc: Close" << endl << endl << endl;
  74. }
  75.  
  76.  
  77. void appHotkeys()
  78. {
  79.  
  80.  
  81. WriteProcessMemory();
  82.  
  83. DWORD pID;
  84. HANDLE hHandle;
  85. HWND hWnd;
  86. SetConsoleTitle( "DosBox Hack by Sandaasu" );
  87. hWnd = FindWindow(0, "Counter-Strike: Global Offensive");
  88. GetWindowThreadProcessId( hWnd, &pID);
  89. hHandle = OpenProcess( PROCESS_ALL_ACCESS, 0, pID);
  90.  
  91.  
  92.  
  93.  
  94. while(true)
  95. {
  96.  
  97. if(GetAsyncKeyState(VK_NUMPAD1))
  98. {//SV_bypass
  99. DWORD EngineDll;
  100. EngineDll = GetModuleBase( pID, "engine.dll");
  101. int bypass_value = 1;
  102. /////////////////////////////
  103. int offset = 0x6FB9D8;
  104. /////////////////////////////
  105. DWORD ibypass_value = sizeof(bypass_value);
  106. WriteProcessMemory( hHandle, (LPVOID)( EngineDll + offset), &bypass_value, ibypass_value, 0);
  107. cout << "sv bypass activated. " << endl;
  108.  
  109. }
  110.  
  111.  
  112. if(GetAsyncKeyState(VK_NUMPAD2))
  113. {// WH ON
  114.  
  115. DWORD ClientDll;
  116. ClientDll = GetModuleBase( pID, "client.dll");
  117. int wh_value = 2;
  118. /////////////////////////////
  119. int offset = 0x94C870;
  120. /////////////////////////////
  121. DWORD iwh_value = sizeof(wh_value);
  122. WriteProcessMemory( hHandle, (LPVOID)( ClientDll + offset), &wh_value, iwh_value, 0);
  123. cout << "Wallhack ON . " << endl;
  124.  
  125. }
  126. if(GetAsyncKeyState(VK_NUMPAD3))
  127. {//WH OFF
  128.  
  129.  
  130. DWORD ClientDll;
  131. ClientDll = GetModuleBase( pID, "client.dll");
  132. int wh_value = 1;
  133. /////////////////////////////
  134. int offset = 0x94C870;
  135. /////////////////////////////
  136. DWORD iwh_value = sizeof(wh_value);
  137. WriteProcessMemory( hHandle, (LPVOID)( ClientDll + offset), &wh_value, iwh_value, 0);//8D0610
  138. cout << "Wallhack OFF. " << endl;
  139.  
  140.  
  141. }
  142.  
  143. if(GetAsyncKeyState(VK_NUMPAD4))
  144. {//ESP ON
  145. DWORD ClientDll;
  146. ClientDll = GetModuleBase( pID, "client.dll");
  147. int esp_value = 1;
  148. /////////////////////////////
  149. int offset = 0x94C610;
  150. /////////////////////////////
  151. DWORD iesp_value = sizeof(esp_value);
  152. WriteProcessMemory( hHandle, (LPVOID)( ClientDll + offset), &esp_value, iesp_value, 0);
  153. cout << "ESP ON. " << endl;
  154.  
  155.  
  156. }
  157. if(GetAsyncKeyState(VK_NUMPAD5))
  158. {//ESP OFF
  159. DWORD ClientDll;
  160. ClientDll = GetModuleBase( pID, "client.dll");
  161. int esp_value = 0;
  162. /////////////////////////////
  163. int offset = 0x94C610;
  164. /////////////////////////////
  165. DWORD iesp_value = sizeof(esp_value);
  166. WriteProcessMemory( hHandle, (LPVOID)( ClientDll + offset), &esp_value, iesp_value, 0);
  167. cout << "ESP OFF. " << endl;
  168.  
  169.  
  170. }
  171. if(GetAsyncKeyState(VK_NUMPAD6))
  172. {//FPS ON
  173. DWORD ClientDll;
  174. ClientDll = GetModuleBase( pID, "client.dll");
  175. int fps_value = 2;
  176. /////////////////////////////
  177. int offset = 0x9AFEF8;
  178. /////////////////////////////
  179. DWORD ifps_value = sizeof(fps_value);
  180. WriteProcessMemory( hHandle, (LPVOID)( ClientDll + offset), &fps_value, ifps_value, 0);
  181. cout << "FPS Active. " << endl;
  182.  
  183. }
  184. if(GetAsyncKeyState(VK_NUMPAD7))
  185. {//Glasswalls
  186. DWORD materialsystemDll;
  187. materialsystemDll = GetModuleBase( pID, "materialsystem.dll");
  188. int walls_value = 2;
  189. /////////////////////////////
  190. int offset = 0x33B428;
  191. /////////////////////////////
  192. DWORD iwalls_value = sizeof(walls_value);
  193. WriteProcessMemory( hHandle, (LPVOID)( materialsystemDll + offset), &walls_value, iwalls_value, 0);
  194. Sleep(3000);
  195. int walls2_value = 1;
  196. DWORD iwalls2_value = sizeof(walls2_value);
  197. WriteProcessMemory( hHandle, (LPVOID)( materialsystemDll + offset), &walls2_value, iwalls2_value, 0);
  198. cout << "Glasswalls Active. " << endl;
  199. }
  200.  
  201. if(GetAsyncKeyState(VK_NUMPAD8))
  202. {//NoSmoke
  203.  
  204. DWORD ClientDll;
  205. ClientDll = GetModuleBase( pID, "client.dll");
  206. int smoke_value = 0;
  207. /////////////////////////////
  208. int offset = 0x9AAB00;
  209. /////////////////////////////
  210. DWORD ismoke_value = sizeof(smoke_value);
  211. WriteProcessMemory( hHandle, (LPVOID)( ClientDll + offset), &smoke_value, ismoke_value, 0);
  212. cout << "No Smoke Active. " << endl;
  213.  
  214.  
  215. }
  216. if(GetAsyncKeyState(VK_F1))
  217. {//PANIC
  218.  
  219.  
  220. //enter panic here
  221.  
  222. }
  223.  
  224. }
  225. }
  226.  
  227.  
  228.  
  229. int main()
  230. {
  231. appTitle();
  232. appFeatures();
  233. appHotkeys();
  234. }
  235.  
  236. DWORD GetModuleBase(const DWORD dwProcessId, const char *szModuleName)
  237. {
  238. HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessId);
  239. if (!hSnap)
  240. {
  241. return 0;
  242. }
  243. MODULEENTRY32 me;
  244. me.dwSize = sizeof(MODULEENTRY32);
  245. DWORD dwReturn = 0;
  246. if (Module32First(hSnap, &me))
  247. {
  248. while (Module32Next(hSnap, &me))
  249. {
  250. if (lstrcmpi(me.szModule, szModuleName) == 0)
  251. {
  252. dwReturn = (DWORD)me.modBaseAddr;
  253. break;
  254. }
  255. }
  256. }
  257. CloseHandle(hSnap);
  258. return dwReturn;
  259. }
Add Comment
Please, Sign In to add comment