Source:TyranoMapHack123/D3Scene.cpp2

From Codemotion
Jump to: navigation, search

Source:TyranoMapHack123/D3Scene.cpp2

Description

Main Source - Part 2: Cdkey grabbing and hotkeys

Code

Parent Directory: Source:TyranoMapHack123
Plain Code: edit

  1. switch (message)                 
  2. 	{  
  3. 	case WM_COMMAND:
  4. 		wmId    = LOWORD(wParam); 
  5. 		wmEvent = HIWORD(wParam); 
  6. 		if ( (HIWORD(wParam) == BN_CLICKED) && (LOWORD(wParam) == IDC_MINIMIZE) )
  7. 		{
  8. 			if (minimized) restore(hwnd);
  9. 			else minimize(hwnd);
  10. 		}
  11. 		switch (wmId)
  12. 		{
  13.  
  14. 		case IDB_BOUT0:
  15. 			SetWindowText(hwnd, titlesafe);
  16.  
  17. 			for(;;)
  18. 			{
  19. 				ReadProcessMemory(hOpen, (LPCVOID)Address, &Buffer, 4, &BytesRead); 
  20.  
  21. 				if(Buffer == 1463898675)
  22. 				{
  23. 					// ROC (3RAW).
  24. 					Address -= 32;
  25. 					break;
  26.                 }
  27.  
  28. 				else if
  29. 					(Buffer == 1462982736)
  30. 				{
  31. 					// TFT (PX3W).
  32. 					Address-= 32;
  33. 					break;
  34. 				}
  35.  
  36. 				else
  37. 				{
  38. 					Address += 65536;
  39. 				}
  40. 			}
  41. 			char Name[16];
  42. 			Name[15] = 0;
  43.  
  44. 			for( unsigned int i = 0; i < 15; i++ )
  45. 			{
  46. 				ReadProcessMemory( hOpen, (LPVOID)( Address + i ), &Buffer, 1, &BytesRead );
  47. 				Name[i] = Buffer;
  48. 			} 
  49.  
  50. 			SendMessage(stat2, WM_SETTEXT, 16, (LPARAM)Name);
  51. 			Sleep(1500);
  52. 			//InvalidateRect(hwnd, NULL, TRUE);
  53. 			GetWindowText(hwndEdit, szText, 16);
  54.  
  55. 			for( unsigned int j = 0; j < 15; j++ )
  56. 			{
  57. 				WriteProcessMemory( hOpen, (LPVOID)(Address + j), (LPCVOID)(szText+ j), 1, &BytesWritten );
  58. 			} 
  59.  
  60. 			SendMessage(stat2, WM_SETTEXT, 16, (LPARAM)szText);
  61.  
  62.  
  63. 		case IDB_BOUT1:
  64. 			rad = SendMessage(boutc1,BM_GETCHECK,0,0);
  65. 			if(rad == 1) 
  66. 			{
  67. 				SetWindowText(hwnd, titlesafe);
  68.  
  69. CIniReader iniReader(".\\config.ini");
  70. bool revealmap = iniReader.ReadBoolean("Settings", "revealmap", false);
  71. bool revealminimap = iniReader.ReadBoolean("Settings", "revealminimap", false);
  72. bool nofogmap = iniReader.ReadBoolean("Settings", "nofogmap", false);
  73. bool nofogminimap = iniReader.ReadBoolean("Settings", "nofogminimap", false);
  74. bool clickunits = iniReader.ReadBoolean("Settings", "clickunits", false);
  75. bool showresources = iniReader.ReadBoolean("Settings", "showresources", false);
  76. bool showinvisible = iniReader.ReadBoolean("Settings", "showinvisible", false);
  77. bool clickinvisible = iniReader.ReadBoolean("Settings", "clickinvisible", false);
  78. bool redinvisible = iniReader.ReadBoolean("Settings", "redinvisible", false);
  79. bool showitems = iniReader.ReadBoolean("Settings", "showitems", false);
  80. bool showillusions = iniReader.ReadBoolean("Settings", "showillusions", false);
  81. bool showskills = iniReader.ReadBoolean("Settings", "showskills", false);
  82. bool showcooldowns = iniReader.ReadBoolean("Settings", "showcooldowns", false);
  83. bool tradehack = iniReader.ReadBoolean("Settings", "tradehack", false);
  84. bool allheroicons = iniReader.ReadBoolean("Settings", "allheroicons", false);
  85. bool enemyheroicons = iniReader.ReadBoolean("Settings", "enemyheroicons", false);
  86. bool allyheroicons = iniReader.ReadBoolean("Settings", "allyheroicons", false);
  87. bool allhpbars = iniReader.ReadBoolean("Settings", "allhpbars", false);
  88. bool enemyhpbars = iniReader.ReadBoolean("Settings", "enemyhpbars", false);
  89. bool allyhpbars = iniReader.ReadBoolean("Settings", "allyhpbars", false);
  90. bool bypassah = iniReader.ReadBoolean("Settings", "bypassah", false);
  91. bool enemypings = iniReader.ReadBoolean("Settings", "enemypings", false);
  92. bool hotkeysoff = iniReader.ReadBoolean("Settings", "hotkeysoff", false);
  93. bool customcamera = iniReader.ReadBoolean("Settings", "customcamera", false);
  94. bool customamounts = iniReader.ReadBoolean("Settings", "customamounts", false);
  95. bool removezoomangles = iniReader.ReadBoolean("Settings", "removezoomangles", false);
  96. bool topview = iniReader.ReadBoolean("Settings", "topview", false);
  97. bool spin = iniReader.ReadBoolean("Settings", "spin", false);
  98. bool smoothcamera = iniReader.ReadBoolean("Settings", "smoothcamera", false);  
  99. char* cameradistance = iniReader.ReadString("Settings", "cameradistance", "1650");
  100. char* minamount = iniReader.ReadString("Settings", "minamount", "100");
  101. char* maxamount = iniReader.ReadString("Settings", "maxamount", "200");
  102. char* smoothdistance = iniReader.ReadString("Settings", "smoothdistance", "1650");
  103.  
  104. if ((smoothcamera==customcamera)){   
  105. MessageBox(NULL, "Customcamera and smoothcamera cannot be both true or both false, else camera hack won't work. One must be true and the other false.", "Warning!", MB_ICONWARNING);
  106. }
  107. else{}
  108.  
  109. if ((smoothcamera==true) && (customcamera==false)){   
  110. SetWindowText(hwndEdit7, smoothdistance);
  111. Sleep(200);
  112. SendMessage(bout7, BM_CLICK,1,0);
  113. }
  114. else{}
  115.  
  116. if ((customcamera==true) && (smoothcamera==false)) {   
  117. SetWindowText(hwndEdit2, cameradistance);
  118. Sleep(200);
  119. SendMessage(bout2, BM_CLICK,1,0);
  120. }
  121. else{}
  122.  
  123. if (customamounts==true){ 
  124. SetWindowText(hwndEdit3, minamount);   
  125. SetWindowText(hwndEdit4, maxamount);
  126. Sleep(200);
  127. SendMessage(bout3, BM_CLICK,1,0);
  128. SendMessage(bout4, BM_CLICK,1,0); 
  129. } 
  130. else{}
  131.  
  132. if (revealmap==true){            
  133. SendMessage(boutc2, BM_CLICK,revealmap,0);
  134. }
  135. else{}
  136.  
  137. if (revealminimap==true){  
  138. SendMessage(boutc3, BM_CLICK,revealminimap,0);
  139. }
  140. else{}
  141.  
  142. if (nofogmap==true){  
  143. SendMessage(boutc4, BM_CLICK,nofogmap,0);
  144. }
  145. else{}
  146.  
  147. if (nofogminimap==true){  
  148. SendMessage(boutc5, BM_CLICK,nofogminimap,0);
  149. }
  150. else{}
  151.  
  152. if (clickunits==true){  
  153. SendMessage(boutc6, BM_CLICK,clickunits,0);
  154. }
  155. else{}
  156.  
  157. if (showresources==true){  
  158. SendMessage(boutc9, BM_CLICK,showresources,0);
  159. }
  160. else{}
  161.  
  162. if (showinvisible==true){  
  163. SendMessage(boutc10, BM_CLICK,showinvisible,0);
  164. }
  165. else{}
  166.  
  167. if (clickinvisible==true){  
  168. SendMessage(boutc18, BM_CLICK,clickinvisible,0);
  169. }
  170. else{}
  171.  
  172. if (redinvisible==true){  
  173. SendMessage(boutc19, BM_CLICK,redinvisible,0);
  174. }
  175. else{}
  176.  
  177. if (showitems==true){  
  178. SendMessage(boutc11, BM_CLICK,showitems,0);
  179. }
  180. else{}
  181.  
  182. if (showillusions==true){  
  183. SendMessage(boutc8, BM_CLICK,showillusions,0);
  184. }
  185. else{}
  186.  
  187. if (showskills==true){  
  188. SendMessage(boutc20, BM_CLICK,showskills,0);
  189. }
  190. else{}
  191.  
  192. if (showcooldowns==true){  
  193. SendMessage(boutc21, BM_CLICK,showcooldowns,0);
  194. }
  195. else{}
  196.  
  197. if (tradehack==true){  
  198. SendMessage(boutc23, BM_CLICK,tradehack,0);
  199. }
  200. else{}
  201.  
  202. if (allheroicons==true){  
  203. SendMessage(boutc22, BM_CLICK,allheroicons,0);
  204. }
  205. else{}
  206.  
  207. if (enemyheroicons==true){  
  208. SendMessage(boutc24, BM_CLICK,enemyheroicons,0);
  209. }
  210. else{}
  211.  
  212. if (allyheroicons==true){  
  213. SendMessage(boutc25, BM_CLICK,allyheroicons,0);
  214. }
  215. else{}
  216.  
  217. if (allhpbars==true){  
  218. SendMessage(boutc12, BM_CLICK,allhpbars,0);
  219. }
  220. else{}
  221.  
  222. if (enemyhpbars==true){  
  223. SendMessage(boutc13, BM_CLICK,enemyhpbars,0);
  224. }
  225. else{}
  226.  
  227. if (allyhpbars==true){  
  228. SendMessage(boutc14, BM_CLICK,allyhpbars,0);
  229. }
  230. else{}
  231.  
  232. if (bypassah==true){  
  233. SendMessage(boutc17, BM_CLICK,bypassah,0);
  234. }
  235. else{}
  236.  
  237. if (enemypings==true){  
  238. SendMessage(boutc16, BM_CLICK,enemypings,0);
  239. }
  240. else{}
  241.  
  242. if (hotkeysoff==true){  
  243. SendMessage(boutc41, BM_CLICK,hotkeysoff,0);
  244. }
  245. else{}
  246.  
  247. if (removezoomangles==true){  
  248. SendMessage(boutc53, BM_CLICK,removezoomangles,0);
  249. }
  250. else{}
  251.  
  252. if (topview==true){  
  253. SendMessage(boutc54, BM_CLICK,topview,0);
  254. }
  255. else{}
  256.  
  257. if (spin==true){  
  258. SendMessage(boutc57, BM_CLICK,spin,0);
  259. }
  260. else{}
  261.  
  262.  
  263. SendMessage(boutc2, BM_SETCHECK,revealmap,0);
  264. SendMessage(boutc3, BM_SETCHECK,revealminimap,0);
  265. SendMessage(boutc4, BM_SETCHECK,nofogmap,0);
  266. SendMessage(boutc5, BM_SETCHECK,nofogminimap,0);
  267. SendMessage(boutc6, BM_SETCHECK,clickunits,0);
  268. SendMessage(boutc9, BM_SETCHECK,showresources,0);
  269. SendMessage(boutc10, BM_SETCHECK,showinvisible,0);
  270. SendMessage(boutc18, BM_SETCHECK,clickinvisible,0);
  271. SendMessage(boutc19, BM_SETCHECK,redinvisible,0);
  272. SendMessage(boutc11, BM_SETCHECK,showitems,0);
  273. SendMessage(boutc8, BM_SETCHECK,showillusions,0);
  274. SendMessage(boutc20, BM_SETCHECK,showskills,0);
  275. SendMessage(boutc21, BM_SETCHECK,showcooldowns,0);
  276. SendMessage(boutc23, BM_SETCHECK,tradehack,0);
  277. SendMessage(boutc22, BM_SETCHECK,allheroicons,0);
  278. SendMessage(boutc24, BM_SETCHECK,enemyheroicons,0);
  279. SendMessage(boutc25, BM_SETCHECK,allyheroicons,0);
  280. SendMessage(boutc12, BM_SETCHECK,allhpbars,0);
  281. SendMessage(boutc13, BM_SETCHECK,enemyhpbars,0);
  282. SendMessage(boutc14, BM_SETCHECK,allyhpbars,0);
  283. SendMessage(boutc17, BM_SETCHECK,bypassah,0);
  284. SendMessage(boutc16, BM_SETCHECK,enemypings,0);
  285. SendMessage(boutc41, BM_SETCHECK,hotkeysoff,0);
  286. SendMessage(boutc53, BM_SETCHECK,removezoomangles,0);
  287. SendMessage(boutc54, BM_SETCHECK,topview,0);
  288. SendMessage(boutc57, BM_SETCHECK,spin,0);
  289. PlaySound("activate.wav",NULL,SND_FILENAME|SND_ASYNC);
  290. SendMessage(stat2, WM_SETTEXT, 16, (LPARAM)"All features enabled.");
  291. 			}
  292.  
  293. 			else
  294.  
  295. 			{
  296.  
  297. SetWindowText(hwnd, titlesafe);
  298.  
  299. CIniReader iniReader(".\\config.ini");
  300. bool revealmap = iniReader.ReadBoolean("Settings", "revealmap", false);
  301. bool revealminimap = iniReader.ReadBoolean("Settings", "revealminimap", false);
  302. bool nofogmap = iniReader.ReadBoolean("Settings", "nofogmap", false);
  303. bool nofogminimap = iniReader.ReadBoolean("Settings", "nofogminimap", false);
  304. bool clickunits = iniReader.ReadBoolean("Settings", "clickunits", false);
  305. bool showresources = iniReader.ReadBoolean("Settings", "showresources", false);
  306. bool showinvisible = iniReader.ReadBoolean("Settings", "showinvisible", false);
  307. bool clickinvisible = iniReader.ReadBoolean("Settings", "clickinvisible", false);
  308. bool redinvisible = iniReader.ReadBoolean("Settings", "redinvisible", false);
  309. bool showitems = iniReader.ReadBoolean("Settings", "showitems", false);
  310. bool showillusions = iniReader.ReadBoolean("Settings", "showillusions", false);
  311. bool showskills = iniReader.ReadBoolean("Settings", "showskills", false);
  312. bool showcooldowns = iniReader.ReadBoolean("Settings", "showcooldowns", false);
  313. bool tradehack = iniReader.ReadBoolean("Settings", "tradehack", false);
  314. bool allheroicons = iniReader.ReadBoolean("Settings", "allheroicons", false);
  315. bool enemyheroicons = iniReader.ReadBoolean("Settings", "enemyheroicons", false);
  316. bool allyheroicons = iniReader.ReadBoolean("Settings", "allyheroicons", false);
  317. bool allhpbars = iniReader.ReadBoolean("Settings", "allhpbars", false);
  318. bool enemyhpbars = iniReader.ReadBoolean("Settings", "enemyhpbars", false);
  319. bool allyhpbars = iniReader.ReadBoolean("Settings", "allyhpbars", false);
  320. bool bypassah = iniReader.ReadBoolean("Settings", "bypassah", false);
  321. bool enemypings = iniReader.ReadBoolean("Settings", "enemypings", false);
  322. bool hotkeysoff = iniReader.ReadBoolean("Settings", "hotkeysoff", false);
  323. bool removezoomangles = iniReader.ReadBoolean("Settings", "removezoomangles", false);
  324. bool topview = iniReader.ReadBoolean("Settings", "topview", false);
  325. bool spin = iniReader.ReadBoolean("Settings", "spin", false); 
  326. bool customcamera = iniReader.ReadBoolean("Settings", "customcamera", false);
  327. bool smoothcamera = iniReader.ReadBoolean("Settings", "smoothcamera", false);
  328. char* smoothdistance = iniReader.ReadString("Settings", "smoothdistance", "1650");
  329.  
  330. if ((smoothcamera==true)&&(customcamera==false)){   
  331. SetWindowText(hwndEdit7, "1650");
  332. Sleep(200);
  333. SendMessage(bout7, BM_CLICK,1,0);
  334. }
  335. else{}
  336.  
  337. if  ((customcamera==true) && (smoothcamera==false)){
  338. SetWindowText(hwndEdit2, "1650");
  339. Sleep(200);
  340. SendMessage(bout2, BM_CLICK,1,0);
  341. }
  342. else{}
  343.  
  344. if (revealmap==true){            
  345. SendMessage(boutc2, BM_CLICK,revealmap,0);
  346. }
  347. else{}
  348.  
  349. if (revealminimap==true){  
  350. SendMessage(boutc3, BM_CLICK,revealminimap,0);
  351. }
  352. else{}
  353.  
  354. if (nofogmap==true){  
  355. SendMessage(boutc4, BM_CLICK,nofogmap,0);
  356. }
  357. else{}
  358.  
  359. if (nofogminimap==true){  
  360. SendMessage(boutc5, BM_CLICK,nofogminimap,0);
  361. }
  362. else{}
  363.  
  364. if (clickunits==true){  
  365. SendMessage(boutc6, BM_CLICK,clickunits,0);
  366. }
  367. else{}
  368.  
  369. if (showresources==true){  
  370. SendMessage(boutc9, BM_CLICK,showresources,0);
  371. }
  372. else{}
  373.  
  374. if (showinvisible==true){  
  375. SendMessage(boutc10, BM_CLICK,showinvisible,0);
  376. }
  377. else{}
  378.  
  379. if (clickinvisible==true){  
  380. SendMessage(boutc18, BM_CLICK,clickinvisible,0);
  381. }
  382. else{}
  383.  
  384. if (redinvisible==true){  
  385. SendMessage(boutc19, BM_CLICK,redinvisible,0);
  386. }
  387. else{}
  388.  
  389. if (showitems==true){  
  390. SendMessage(boutc11, BM_CLICK,showitems,0);
  391. }
  392. else{}
  393.  
  394. if (showillusions==true){  
  395. SendMessage(boutc8, BM_CLICK,showillusions,0);
  396. }
  397. else{}
  398.  
  399. if (showskills==true){  
  400. SendMessage(boutc20, BM_CLICK,showskills,0);
  401. }
  402. else{}
  403.  
  404. if (showcooldowns==true){  
  405. SendMessage(boutc21, BM_CLICK,showcooldowns,0);
  406. }
  407. else{}
  408.  
  409. if (tradehack==true){  
  410. SendMessage(boutc23, BM_CLICK,tradehack,0);
  411. }
  412. else{}
  413.  
  414. if (allheroicons==true){  
  415. SendMessage(boutc22, BM_CLICK,allheroicons,0);
  416. }
  417. else{}
  418.  
  419. if (enemyheroicons==true){  
  420. SendMessage(boutc24, BM_CLICK,enemyheroicons,0);
  421. }
  422. else{}
  423.  
  424. if (allyheroicons==true){  
  425. SendMessage(boutc25, BM_CLICK,allyheroicons,0);
  426. }
  427. else{}
  428.  
  429. if (allhpbars==true){  
  430. SendMessage(boutc12, BM_CLICK,allhpbars,0);
  431. }
  432. else{}
  433.  
  434. if (enemyhpbars==true){  
  435. SendMessage(boutc13, BM_CLICK,enemyhpbars,0);
  436. }
  437. else{}
  438.  
  439. if (allyhpbars==true){  
  440. SendMessage(boutc14, BM_CLICK,allyhpbars,0);
  441. }
  442. else{}
  443.  
  444. if (bypassah==true){  
  445. SendMessage(boutc17, BM_CLICK,bypassah,0);
  446. }
  447. else{}
  448.  
  449. if (enemypings==true){  
  450. SendMessage(boutc16, BM_CLICK,enemypings,0);
  451. }
  452. else{}
  453.  
  454. if (hotkeysoff==true){  
  455. SendMessage(boutc41, BM_CLICK,hotkeysoff,0);
  456. }
  457. else{}
  458.  
  459. if (removezoomangles==true){  
  460. SendMessage(boutc53, BM_CLICK,removezoomangles,0);
  461. }
  462. else{}
  463.  
  464. if (topview==true){  
  465. SendMessage(boutc54, BM_CLICK,topview,0);
  466. }
  467. else{}
  468.  
  469. if (spin==true){  
  470. SendMessage(boutc57, BM_CLICK,spin,0);
  471. }
  472. else{}
  473.  
  474. SendMessage(boutc2, BM_SETCHECK,0,0);
  475. SendMessage(boutc3, BM_SETCHECK,0,0);
  476. SendMessage(boutc4, BM_SETCHECK,0,0);
  477. SendMessage(boutc5, BM_SETCHECK,0,0);
  478. SendMessage(boutc6, BM_SETCHECK,0,0);
  479. SendMessage(boutc9, BM_SETCHECK,0,0);
  480. SendMessage(boutc10, BM_SETCHECK,0,0);
  481. SendMessage(boutc18, BM_SETCHECK,0,0);
  482. SendMessage(boutc19, BM_SETCHECK,0,0);
  483. SendMessage(boutc11, BM_SETCHECK,0,0);
  484. SendMessage(boutc8, BM_SETCHECK,0,0);
  485. SendMessage(boutc20, BM_SETCHECK,0,0);
  486. SendMessage(boutc21, BM_SETCHECK,0,0);
  487. SendMessage(boutc23, BM_SETCHECK,0,0);
  488. SendMessage(boutc22, BM_SETCHECK,0,0);
  489. SendMessage(boutc24, BM_SETCHECK,0,0);
  490. SendMessage(boutc25, BM_SETCHECK,0,0);
  491. SendMessage(boutc12, BM_SETCHECK,0,0);
  492. SendMessage(boutc13, BM_SETCHECK,0,0);
  493. SendMessage(boutc14, BM_SETCHECK,0,0);
  494. SendMessage(boutc17, BM_SETCHECK,0,0);
  495. SendMessage(boutc16, BM_SETCHECK,0,0);
  496. SendMessage(boutc41, BM_SETCHECK,0,0);
  497. SendMessage(boutc53, BM_SETCHECK,0,0);
  498. SendMessage(boutc54, BM_SETCHECK,0,0);
  499. SendMessage(boutc57, BM_SETCHECK,0,0);
  500. SendMessage(stat2, WM_SETTEXT, 16, (LPARAM)"All features disabled.");
  501. 			}
  502.  
  503. 			break;
Personal tools