fork download
  1. /* This file has been generated by the Hex-Rays decompiler.
  2.   Copyright (c) 2007-2011 Hex-Rays <info@hex-rays.com>
  3.  
  4.   Detected compiler: Visual C++
  5. */
  6.  
  7. #include <windows.h>
  8. #include <defs.h>
  9.  
  10.  
  11. //-------------------------------------------------------------------------
  12. // Data declarations
  13.  
  14. extern _UNKNOWN unk_413000; // weak
  15. extern _UNKNOWN unk_413208; // weak
  16. extern _UNKNOWN unk_41330C; // weak
  17. extern _UNKNOWN unk_41371C; // weak
  18. extern int off_41387C[2]; // weak
  19. extern _UNKNOWN unk_413B94; // weak
  20. extern _UNKNOWN unk_413C94; // weak
  21. extern _UNKNOWN unk_413FA0; // weak
  22. extern _UNKNOWN unk_413FC0; // weak
  23. extern _UNKNOWN unk_413FE0; // weak
  24. extern char *Format; // idb
  25. extern int dword_415004; // weak
  26. extern int dword_415010; // weak
  27. extern int __security_cookie; // weak
  28. extern int dword_41501C; // weak
  29. extern int dword_415128; // weak
  30. extern int dword_41512C; // weak
  31. extern int dword_415130; // weak
  32. extern int dword_415134; // weak
  33. extern int dword_415138; // weak
  34. extern int dword_41513C; // weak
  35. extern int dword_415140; // weak
  36. extern int dword_415144; // weak
  37. extern int dword_415150; // weak
  38. extern int dword_415154; // weak
  39. extern int dword_415158; // weak
  40. extern int dword_41515C; // weak
  41. extern int dword_415160; // weak
  42. extern int dword_415164; // weak
  43. extern int dword_41516C; // weak
  44. extern int dword_415170; // weak
  45. extern int dword_415174; // weak
  46. extern int dword_4151B0; // weak
  47. extern __int16 word_41523C; // weak
  48. extern __int16 word_415240; // weak
  49. extern __int16 word_415244; // weak
  50. extern __int16 word_415248; // weak
  51. extern int dword_41524C; // weak
  52. extern int dword_415250; // weak
  53. extern int dword_415254; // weak
  54. extern int dword_415258; // weak
  55. extern int dword_41525C; // weak
  56. extern int dword_415260; // weak
  57. extern int dword_415264; // weak
  58. extern int dword_415268; // weak
  59. extern __int16 word_41526C; // weak
  60. extern int dword_415270; // weak
  61. extern int dword_415274; // weak
  62. extern __int16 word_415278; // weak
  63. extern int dword_41547C; // weak
  64. extern _UNKNOWN unk_415520; // weak
  65. extern int dword_415530; // weak
  66. extern PVOID dword_415534; // idb
  67. extern PVOID Ptr; // idb
  68. extern int (__cdecl *dword_415548)(_DWORD, _DWORD, _DWORD); // weak
  69. // extern void *_initenv; weak
  70. // extern int fmode;
  71. // extern void *commode; weak
  72.  
  73. //-------------------------------------------------------------------------
  74. // Function declarations
  75.  
  76. #define __thiscall __cdecl // Test compile in C mode
  77.  
  78. int sub_411005(void); // weak
  79. int sub_41100F(void); // weak
  80. int __cdecl j___crtSetUnhandledExceptionFilter(_DWORD); // weak
  81. _DWORD __cdecl sub_411019(_DWORD); // weak
  82. int sub_411028(); // weak
  83. int sub_411032(void); // weak
  84. _DWORD __cdecl sub_41103C(_DWORD); // weak
  85. int sub_411041(); // weak
  86. int __cdecl j__lock(_DWORD); // weak
  87. _DWORD __cdecl sub_41104B(char); // weak
  88. void __cdecl terminate(); // idb
  89. int __cdecl j__initterm(_DWORD, _DWORD); // weak
  90. int __cdecl j___crtTerminateProcess(_DWORD); // weak
  91. _DWORD __cdecl sub_411078(_DWORD, _DWORD); // weak
  92. int __cdecl j__crt_debugger_hook(_DWORD); // weak
  93. _DWORD __cdecl sub_411087(_DWORD); // weak
  94. int __cdecl sub_41108C(_DWORD); // weak
  95. int __cdecl j___crtUnhandledException(_DWORD); // weak
  96. int __stdcall sub_4110A5(); // weak
  97. int j___SEH_epilog4(void); // weak
  98. int __cdecl j__unlock(_DWORD); // weak
  99. int __cdecl sub_4110C8(_DWORD, _DWORD, _DWORD); // weak
  100. int sub_4110D2(void); // weak
  101. _DWORD __cdecl j___SEH_prolog4(_DWORD, _DWORD); // weak
  102. _DWORD __cdecl sub_4110F5(_DWORD); // weak
  103. int __cdecl j__amsg_exit(_DWORD); // weak
  104. int __cdecl j__XcptFilter(_DWORD, _DWORD); // weak
  105. int sub_41110E(); // weak
  106. BOOL __stdcall j_IsProcessorFeaturePresent(DWORD ProcessorFeature);
  107. int __cdecl j___dllonexit(_DWORD, _DWORD, _DWORD); // weak
  108. int __cdecl j__initterm_e(_DWORD, _DWORD); // weak
  109. int __cdecl sub_411253();
  110. int __cdecl sub_41127E();
  111. int __cdecl sub_411365();
  112. // int __usercall sub_4114DE<eax>(int a1<ebp>);
  113. // void __usercall sub_4114F2(int a1<ebp>);
  114. int loc_41150D(); // weak
  115. // int __usercall start_0<eax>(int a1<ebp>);
  116. int __stdcall sub_4115EA(int a1);
  117. int __cdecl sub_41163B();
  118. int __cdecl sub_411658();
  119. int __cdecl sub_411670(int a1, unsigned int a2);
  120. // unsigned int __usercall sub_4116D0<eax>(int a1<eax>, int a2);
  121. bool __cdecl sub_4117C0(int a1);
  122. signed int __cdecl sub_411810();
  123. int __cdecl sub_4118D3();
  124. signed int __cdecl sub_4118D6();
  125. // int __usercall sub_411921<eax>(int a1<ebp>);
  126. int __cdecl sub_4119C1();
  127. int __cdecl sub_4119F4(int a1);
  128. void __cdecl sub_411A0E();
  129. int __thiscall sub_411B9A(void *this, char a2);
  130. int __cdecl sub_411BB2(int a1);
  131. // int __usercall sub_411BFE<eax>(int a1<ebx>, int a2<edi>, int a3<esi>, char a4);
  132. // int __usercall sub_411D46<eax>(int a1<ebx>, int a2<edi>, int a3<esi>, int a4);
  133. // BOOL __stdcall IsDebuggerPresent();
  134. // PVOID __stdcall DecodePointer(PVOID Ptr);
  135. // void __stdcall GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime);
  136. // DWORD __stdcall GetCurrentThreadId();
  137. // DWORD __stdcall GetCurrentProcessId();
  138. // BOOL __stdcall QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount);
  139. // PVOID __stdcall EncodePointer(PVOID Ptr);
  140. // int __cdecl _setusermatherr(_DWORD); weak
  141. // int __cdecl configthreadlocale(_DWORD); weak
  142. // int __cdecl calloc_crt(_DWORD, _DWORD); weak
  143. // _onexit_t __cdecl onexit(_onexit_t Func);
  144. // int cexit(void); weak
  145. // void __cdecl exit(int Code);
  146. // void __cdecl exit(int Code);
  147. // int __cdecl _set_app_type(_DWORD); weak
  148. // int __cdecl _getmainargs(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD); weak
  149. // int printf(const char *Format, ...);
  150.  
  151.  
  152. //----- (00411253) --------------------------------------------------------
  153. int __cdecl sub_411253()
  154. {
  155. return printf(Format);
  156. }
  157.  
  158. //----- (0041127E) --------------------------------------------------------
  159. int __cdecl sub_41127E()
  160. {
  161. int v0; // eax@2
  162.  
  163. if ( v400000 != 23117 || *(_DWORD *)(v40003C + 4194304) != 17744 || *(_WORD *)(v40003C + 4194328) != 267 )
  164. {
  165. v0 = 0;
  166. }
  167. else
  168. {
  169. v0 = 0;
  170. if ( *(_DWORD *)(v40003C + 4194420) > 0xEu )
  171. LOBYTE(v0) = *(_DWORD *)(v40003C + 4194536) != 0;
  172. }
  173. dword_415130 = v0;
  174. _set_app_type(1);
  175. dword_415534 = EncodePointer((PVOID)0xFFFFFFFF);
  176. Ptr = dword_415534;
  177. fmode = dword_41515C;
  178. commode = (void *)dword_415150;
  179. sub_4110D2();
  180. sub_41100F();
  181. if ( !dword_415004 )
  182. _setusermatherr(sub_41110E);
  183. sub_411005();
  184. if ( dword_415010 == -1 )
  185. configthreadlocale(-1);
  186. return 0;
  187. }
  188. // 411005: using guessed type int sub_411005(void);
  189. // 41100F: using guessed type int sub_41100F(void);
  190. // 4110D2: using guessed type int sub_4110D2(void);
  191. // 41110E: using guessed type int sub_41110E();
  192. // 415004: using guessed type int dword_415004;
  193. // 415010: using guessed type int dword_415010;
  194. // 415130: using guessed type int dword_415130;
  195. // 415150: using guessed type int dword_415150;
  196. // 41515C: using guessed type int dword_41515C;
  197. // 416050: using guessed type int __cdecl _setusermatherr(_DWORD);
  198. // 416064: using guessed type void *commode;
  199. // 416070: using guessed type int __cdecl configthreadlocale(_DWORD);
  200. // 4160A8: using guessed type int __cdecl _set_app_type(_DWORD);
  201.  
  202. //----- (00411365) --------------------------------------------------------
  203. int __cdecl sub_411365()
  204. {
  205. int result; // eax@1
  206.  
  207. sub_41103C(sub_411028);
  208. dword_415144 = dword_415158;
  209. result = _getmainargs(&dword_415134, &dword_415138, &dword_41513C, dword_415154, &dword_415144);
  210. dword_415140 = result;
  211. if ( result < 0 )
  212. result = j__amsg_exit(8);
  213. return result;
  214. }
  215. // 411028: using guessed type int sub_411028();
  216. // 41103C: using guessed type _DWORD __cdecl sub_41103C(_DWORD);
  217. // 4110FA: using guessed type int __cdecl j__amsg_exit(_DWORD);
  218. // 415134: using guessed type int dword_415134;
  219. // 415138: using guessed type int dword_415138;
  220. // 41513C: using guessed type int dword_41513C;
  221. // 415140: using guessed type int dword_415140;
  222. // 415144: using guessed type int dword_415144;
  223. // 415154: using guessed type int dword_415154;
  224. // 415158: using guessed type int dword_415158;
  225. // 4160AC: using guessed type int __cdecl _getmainargs(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
  226.  
  227. //----- (004114DE) --------------------------------------------------------
  228. int __usercall sub_4114DE<eax>(int a1<ebp>)
  229. {
  230. int v1; // ecx@1
  231. int v2; // eax@1
  232.  
  233. v1 = *(_DWORD *)(a1 - 20);
  234. v2 = **(_DWORD **)v1;
  235. *(_DWORD *)(a1 - 28) = v2;
  236. return j__XcptFilter(v2, v1);
  237. }
  238. // 4110FF: using guessed type int __cdecl j__XcptFilter(_DWORD, _DWORD);
  239.  
  240. //----- (004114F2) --------------------------------------------------------
  241. void __usercall sub_4114F2(int a1<ebp>)
  242. {
  243. int v1; // eax@1
  244.  
  245. v1 = *(_DWORD *)(a1 - 28);
  246. dword_41512C = *(_DWORD *)(a1 - 28);
  247. JUMPOUT(dword_415130, 0, loc_41150D);
  248. exit(v1);
  249. }
  250. // 41150D: using guessed type int loc_41150D();
  251. // 41512C: using guessed type int dword_41512C;
  252. // 415130: using guessed type int dword_415130;
  253.  
  254. //----- (004115DE) --------------------------------------------------------
  255. int __usercall start_0<eax>(int a1<ebp>)
  256. {
  257. signed __int32 v1; // edx@1
  258. signed int v2; // edi@1
  259. signed __int32 v3; // eax@2
  260. signed int v4; // esi@4
  261. int v5; // eax@19
  262.  
  263. sub_411032();
  264. j___SEH_prolog4(&unk_413FA0, 12);
  265. *(_DWORD *)(a1 - 4) = 0;
  266. v1 = *(_DWORD *)(__readfsdword(24) + 4);
  267. v2 = 0;
  268. while ( 1 )
  269. {
  270. v3 = _InterlockedCompareExchange((signed __int32 *)&unk_415520, v1, 0);
  271. if ( !v3 )
  272. break;
  273. if ( v3 == v1 )
  274. {
  275. v4 = 1;
  276. v2 = 1;
  277. goto LABEL_6;
  278. }
  279. }
  280. v4 = 1;
  281. LABEL_6:
  282. if ( dword_415530 == v4 )
  283. {
  284. j__amsg_exit(31);
  285. }
  286. else
  287. {
  288. if ( dword_415530 )
  289. {
  290. dword_415128 = v4;
  291. }
  292. else
  293. {
  294. dword_415530 = v4;
  295. if ( j__initterm_e(&unk_41330C, &unk_41371C) )
  296. {
  297. *(_DWORD *)(a1 - 4) = -2;
  298. return j___SEH_epilog4();
  299. }
  300. }
  301. }
  302. if ( dword_415530 == v4 )
  303. {
  304. j__initterm(&unk_413000, &unk_413208);
  305. dword_415530 = 2;
  306. }
  307. if ( !v2 )
  308. _InterlockedExchange((signed __int32 *)&unk_415520, 0);
  309. if ( dword_415548 && sub_4110F5(&dword_415548) )
  310. dword_415548(0, 2, 0);
  311. _initenv = (void *)dword_41513C;
  312. v5 = sub_4110C8(dword_415134, dword_415138, dword_41513C);
  313. dword_41512C = v5;
  314. if ( !dword_415130 )
  315. exit(v5);
  316. if ( !dword_415128 )
  317. cexit();
  318. *(_DWORD *)(a1 - 4) = -2;
  319. return j___SEH_epilog4();
  320. }
  321. // 411032: using guessed type int sub_411032(void);
  322. // 41105F: using guessed type int __cdecl j__initterm(_DWORD, _DWORD);
  323. // 4110B4: using guessed type int j___SEH_epilog4(void);
  324. // 4110C8: using guessed type int __cdecl sub_4110C8(_DWORD, _DWORD, _DWORD);
  325. // 4110D7: using guessed type _DWORD __cdecl j___SEH_prolog4(_DWORD, _DWORD);
  326. // 4110F5: using guessed type _DWORD __cdecl sub_4110F5(_DWORD);
  327. // 4110FA: using guessed type int __cdecl j__amsg_exit(_DWORD);
  328. // 411127: using guessed type int __cdecl j__initterm_e(_DWORD, _DWORD);
  329. // 415128: using guessed type int dword_415128;
  330. // 41512C: using guessed type int dword_41512C;
  331. // 415130: using guessed type int dword_415130;
  332. // 415134: using guessed type int dword_415134;
  333. // 415138: using guessed type int dword_415138;
  334. // 41513C: using guessed type int dword_41513C;
  335. // 415530: using guessed type int dword_415530;
  336. // 415548: using guessed type int (__cdecl *dword_415548)(_DWORD, _DWORD, _DWORD);
  337. // 41605C: using guessed type void *_initenv;
  338. // 41609C: using guessed type int cexit(void);
  339.  
  340. //----- (004115EA) --------------------------------------------------------
  341. int __stdcall sub_4115EA(int a1)
  342. {
  343. _DWORD *v1; // eax@1
  344. int v2; // eax@3
  345.  
  346. v1 = *(_DWORD **)a1;
  347. if ( **(_DWORD **)a1 == -529697949 )
  348. {
  349. if ( v1[4] == 3 )
  350. {
  351. v2 = v1[5];
  352. if ( v2 == 429065504 || v2 == 429065505 || v2 == 429065506 || v2 == 26820608 )
  353. terminate();
  354. }
  355. }
  356. return 0;
  357. }
  358.  
  359. //----- (0041163B) --------------------------------------------------------
  360. int __cdecl sub_41163B()
  361. {
  362. j___crtSetUnhandledExceptionFilter(sub_4110A5);
  363. return 0;
  364. }
  365. // 411014: using guessed type int __cdecl j___crtSetUnhandledExceptionFilter(_DWORD);
  366. // 4110A5: using guessed type int __stdcall sub_4110A5();
  367.  
  368. //----- (00411658) --------------------------------------------------------
  369. int __cdecl sub_411658()
  370. {
  371. return 0;
  372. }
  373.  
  374. //----- (00411670) --------------------------------------------------------
  375. int __cdecl sub_411670(int a1, unsigned int a2)
  376. {
  377. unsigned int v2; // edx@1
  378. int v3; // ecx@1
  379. int result; // eax@1
  380. unsigned int v5; // esi@2
  381.  
  382. v2 = 0;
  383. v3 = a1 + *(_DWORD *)(a1 + 60);
  384. result = v3 + *(_WORD *)(v3 + 20) + 24;
  385. if ( *(_WORD *)(v3 + 6) )
  386. {
  387. while ( 1 )
  388. {
  389. v5 = *(_DWORD *)(result + 12);
  390. if ( a2 >= v5 )
  391. {
  392. if ( a2 < v5 + *(_DWORD *)(result + 8) )
  393. break;
  394. }
  395. ++v2;
  396. result += 40;
  397. if ( v2 >= *(_WORD *)(v3 + 6) )
  398. goto LABEL_5;
  399. }
  400. }
  401. else
  402. {
  403. LABEL_5:
  404. result = 0;
  405. }
  406. return result;
  407. }
  408.  
  409. //----- (004116D0) --------------------------------------------------------
  410. unsigned int __usercall sub_4116D0<eax>(int a1<eax>, int a2)
  411. {
  412. int v2; // eax@2
  413. unsigned int result; // eax@3
  414. unsigned int v4; // [sp-10h] [bp-28h]@1
  415. unsigned int *v5; // [sp+0h] [bp-18h]@1
  416. int v6; // [sp+8h] [bp-10h]@1
  417. int (*v7)(); // [sp+Ch] [bp-Ch]@1
  418. unsigned int v8; // [sp+10h] [bp-8h]@1
  419. int v9; // [sp+14h] [bp-4h]@1
  420. int v10; // [sp+18h] [bp+0h]@1
  421.  
  422. v7 = sub_411041;
  423. v6 = a1;
  424. v8 = __security_cookie ^ (unsigned int)&unk_413FC0;
  425. v4 = (unsigned int)&v10 ^ __security_cookie;
  426. v5 = &v4;
  427. v9 = 0;
  428. if ( sub_411087(4194304) && (v2 = sub_411078(4194304, a2 - 4194304)) != 0 )
  429. {
  430. result = ~(unsigned __int8)(*(_DWORD *)(v2 + 36) >> 31) & 1;
  431. v9 = -2;
  432. }
  433. else
  434. {
  435. result = 0;
  436. }
  437. return result;
  438. }
  439. // 411041: using guessed type int sub_411041();
  440. // 411078: using guessed type _DWORD __cdecl sub_411078(_DWORD, _DWORD);
  441. // 411087: using guessed type _DWORD __cdecl sub_411087(_DWORD);
  442. // 415018: using guessed type int __security_cookie;
  443.  
  444. //----- (004117C0) --------------------------------------------------------
  445. bool __cdecl sub_4117C0(int a1)
  446. {
  447. bool result; // al@2
  448. int v2; // ecx@3
  449.  
  450. if ( *(_WORD *)a1 == 23117 )
  451. {
  452. v2 = a1 + *(_DWORD *)(a1 + 60);
  453. result = 0;
  454. if ( *(_DWORD *)v2 == 17744 )
  455. result = *(_WORD *)(v2 + 24) == 267;
  456. }
  457. else
  458. {
  459. result = 0;
  460. }
  461. return result;
  462. }
  463.  
  464. //----- (00411810) --------------------------------------------------------
  465. signed int __cdecl sub_411810()
  466. {
  467. signed int result; // eax@3
  468. DWORD v1; // ecx@4
  469. LARGE_INTEGER PerformanceCount; // [sp+8h] [bp-14h]@4
  470. struct _FILETIME SystemTimeAsFileTime; // [sp+10h] [bp-Ch]@1
  471. DWORD v4; // [sp+18h] [bp-4h]@4
  472.  
  473. SystemTimeAsFileTime.dwLowDateTime = 0;
  474. SystemTimeAsFileTime.dwHighDateTime = 0;
  475. if ( __security_cookie != -1153374642 && __security_cookie & 0xFFFF0000 )
  476. {
  477. result = ~__security_cookie;
  478. dword_41501C = ~__security_cookie;
  479. }
  480. else
  481. {
  482. GetSystemTimeAsFileTime(&SystemTimeAsFileTime);
  483. v4 = SystemTimeAsFileTime.dwLowDateTime ^ SystemTimeAsFileTime.dwHighDateTime;
  484. v4 = GetCurrentThreadId() ^ SystemTimeAsFileTime.dwLowDateTime ^ SystemTimeAsFileTime.dwHighDateTime;
  485. v4 ^= GetCurrentProcessId();
  486. QueryPerformanceCounter(&PerformanceCount);
  487. result = (signed int)&v4;
  488. v1 = (unsigned int)&v4 ^ v4 ^ PerformanceCount.s.LowPart ^ PerformanceCount.s.HighPart;
  489. if ( v1 == -1153374642 )
  490. {
  491. v1 = -1153374641;
  492. }
  493. else
  494. {
  495. if ( !(v1 & 0xFFFF0000) )
  496. {
  497. result = (v1 | 0x4711) << 16;
  498. v1 |= result;
  499. }
  500. }
  501. __security_cookie = v1;
  502. dword_41501C = ~v1;
  503. }
  504. return result;
  505. }
  506. // 415018: using guessed type int __security_cookie;
  507. // 41501C: using guessed type int dword_41501C;
  508.  
  509. //----- (004118D3) --------------------------------------------------------
  510. int __cdecl sub_4118D3()
  511. {
  512. return 0;
  513. }
  514.  
  515. //----- (004118D6) --------------------------------------------------------
  516. signed int __cdecl sub_4118D6()
  517. {
  518. signed int result; // eax@2
  519. void *v1; // esi@3
  520.  
  521. if ( Ptr )
  522. {
  523. result = 0;
  524. }
  525. else
  526. {
  527. v1 = (void *)calloc_crt(32, 4);
  528. Ptr = EncodePointer(v1);
  529. dword_415534 = Ptr;
  530. if ( v1 )
  531. {
  532. *(_DWORD *)v1 = 0;
  533. result = 0;
  534. }
  535. else
  536. {
  537. result = 24;
  538. }
  539. }
  540. return result;
  541. }
  542. // 416078: using guessed type int __cdecl calloc_crt(_DWORD, _DWORD);
  543.  
  544. //----- (00411921) --------------------------------------------------------
  545. int __usercall sub_411921<eax>(int a1<ebp>)
  546. {
  547. PVOID v1; // eax@1
  548. PVOID v2; // eax@3
  549.  
  550. j___SEH_prolog4(&unk_413FE0, 20);
  551. *(_DWORD *)(a1 - 36) = 0;
  552. v1 = DecodePointer(Ptr);
  553. *(_DWORD *)(a1 - 28) = v1;
  554. if ( v1 == (PVOID)-1 )
  555. {
  556. onexit(*(_onexit_t *)(a1 + 8));
  557. }
  558. else
  559. {
  560. j__lock(8);
  561. *(_DWORD *)(a1 - 4) = 0;
  562. *(_DWORD *)(a1 - 28) = DecodePointer(Ptr);
  563. *(_DWORD *)(a1 - 32) = DecodePointer(dword_415534);
  564. v2 = EncodePointer(*(PVOID *)(a1 + 8));
  565. *(_DWORD *)(a1 - 36) = j___dllonexit(v2, a1 - 28, a1 - 32);
  566. Ptr = EncodePointer(*(PVOID *)(a1 - 28));
  567. dword_415534 = EncodePointer(*(PVOID *)(a1 - 32));
  568. *(_DWORD *)(a1 - 4) = -2;
  569. sub_4119C1();
  570. }
  571. return j___SEH_epilog4();
  572. }
  573. // 411046: using guessed type int __cdecl j__lock(_DWORD);
  574. // 4110B4: using guessed type int j___SEH_epilog4(void);
  575. // 4110D7: using guessed type _DWORD __cdecl j___SEH_prolog4(_DWORD, _DWORD);
  576. // 411122: using guessed type int __cdecl j___dllonexit(_DWORD, _DWORD, _DWORD);
  577.  
  578. //----- (004119C1) --------------------------------------------------------
  579. int __cdecl sub_4119C1()
  580. {
  581. return j__unlock(8);
  582. }
  583. // 4110B9: using guessed type int __cdecl j__unlock(_DWORD);
  584.  
  585. //----- (004119F4) --------------------------------------------------------
  586. int __cdecl sub_4119F4(int a1)
  587. {
  588. return (sub_41108C(a1) != 0) - 1;
  589. }
  590. // 41108C: using guessed type int __cdecl sub_41108C(_DWORD);
  591.  
  592. //----- (00411A0E) --------------------------------------------------------
  593. void __cdecl sub_411A0E()
  594. {
  595. unsigned int i; // esi@1
  596.  
  597. for ( i = (unsigned int)&unk_413B94; i < (unsigned int)&unk_413C94; i += 4 )
  598. {
  599. if ( *(_DWORD *)i )
  600. (*(void (**)(void))i)();
  601. }
  602. }
  603.  
  604. //----- (00411B9A) --------------------------------------------------------
  605. int __thiscall sub_411B9A(void *this, char a2)
  606. {
  607. if ( this == (void *)__security_cookie )
  608. __asm { rep retn }
  609. return sub_41104B(a2);
  610. }
  611. // 41104B: using guessed type _DWORD __cdecl sub_41104B(char);
  612. // 415018: using guessed type int __security_cookie;
  613.  
  614. //----- (00411BB2) --------------------------------------------------------
  615. int __cdecl sub_411BB2(int a1)
  616. {
  617. dword_41547C = IsDebuggerPresent();
  618. j__crt_debugger_hook(1);
  619. j___crtUnhandledException(a1);
  620. if ( !dword_41547C )
  621. j__crt_debugger_hook(1);
  622. return j___crtTerminateProcess(-1073740791);
  623. }
  624. // 411064: using guessed type int __cdecl j___crtTerminateProcess(_DWORD);
  625. // 411082: using guessed type int __cdecl j__crt_debugger_hook(_DWORD);
  626. // 4110A0: using guessed type int __cdecl j___crtUnhandledException(_DWORD);
  627. // 41547C: using guessed type int dword_41547C;
  628.  
  629. //----- (00411BFE) --------------------------------------------------------
  630. int __usercall sub_411BFE<eax>(int a1<ebx>, int a2<edi>, int a3<esi>, char a4)
  631. {
  632. BOOL v4; // eax@1
  633. int v5; // edx@1
  634. signed int v6; // ecx@1
  635. int v12; // [sp-4h] [bp-328h]@1
  636. int v13; // [sp+324h] [bp+0h]@0
  637. int v14; // [sp+328h] [bp+4h]@3
  638.  
  639. v4 = j_IsProcessorFeaturePresent(0x17u);
  640. _CF = 0;
  641. _OF = 0;
  642. _ZF = v4 == 0;
  643. _SF = v4 < 0;
  644. if ( v4 )
  645. {
  646. v6 = 2;
  647. __asm { int 29h ; DOS 2+ internal - FAST PUTCHAR }
  648. }
  649. dword_415260 = v4;
  650. dword_41525C = v6;
  651. dword_415258 = v5;
  652. dword_415254 = a1;
  653. dword_415250 = a3;
  654. dword_41524C = a2;
  655. word_415278 = __SS__;
  656. word_41526C = __CS__;
  657. word_415248 = __DS__;
  658. word_415244 = __ES__;
  659. word_415240 = __FS__;
  660. word_41523C = __GS__;
  661. __asm { pushf }
  662. dword_415270 = v12;
  663. dword_415264 = v13;
  664. dword_415268 = v14;
  665. dword_415274 = (int)&a4;
  666. dword_4151B0 = 65537;
  667. dword_41516C = v14;
  668. dword_415160 = -1073740791;
  669. dword_415164 = 1;
  670. dword_415170 = 1;
  671. dword_415174 = 2;
  672. return sub_411019(off_41387C);
  673. }
  674. // 411019: using guessed type _DWORD __cdecl sub_411019(_DWORD);
  675. // 41387C: using guessed type int off_41387C[2];
  676. // 415160: using guessed type int dword_415160;
  677. // 415164: using guessed type int dword_415164;
  678. // 41516C: using guessed type int dword_41516C;
  679. // 415170: using guessed type int dword_415170;
  680. // 415174: using guessed type int dword_415174;
  681. // 4151B0: using guessed type int dword_4151B0;
  682. // 41523C: using guessed type __int16 word_41523C;
  683. // 415240: using guessed type __int16 word_415240;
  684. // 415244: using guessed type __int16 word_415244;
  685. // 415248: using guessed type __int16 word_415248;
  686. // 41524C: using guessed type int dword_41524C;
  687. // 415250: using guessed type int dword_415250;
  688. // 415254: using guessed type int dword_415254;
  689. // 415258: using guessed type int dword_415258;
  690. // 41525C: using guessed type int dword_41525C;
  691. // 415260: using guessed type int dword_415260;
  692. // 415264: using guessed type int dword_415264;
  693. // 415268: using guessed type int dword_415268;
  694. // 41526C: using guessed type __int16 word_41526C;
  695. // 415270: using guessed type int dword_415270;
  696. // 415274: using guessed type int dword_415274;
  697. // 415278: using guessed type __int16 word_415278;
  698.  
  699. //----- (00411D46) --------------------------------------------------------
  700. int __usercall sub_411D46<eax>(int a1<ebx>, int a2<edi>, int a3<esi>, int a4)
  701. {
  702. BOOL v4; // eax@1
  703. int v5; // edx@1
  704. int v6; // ecx@1
  705. int v12; // [sp-4h] [bp-320h]@1
  706. int v13; // [sp+31Ch] [bp+0h]@0
  707. int v14; // [sp+320h] [bp+4h]@3
  708.  
  709. v4 = j_IsProcessorFeaturePresent(0x17u);
  710. _CF = 0;
  711. _OF = 0;
  712. _ZF = v4 == 0;
  713. _SF = v4 < 0;
  714. if ( v4 )
  715. {
  716. v6 = a4;
  717. __asm { int 29h ; DOS 2+ internal - FAST PUTCHAR }
  718. }
  719. dword_415260 = v4;
  720. dword_41525C = v6;
  721. dword_415258 = v5;
  722. dword_415254 = a1;
  723. dword_415250 = a3;
  724. dword_41524C = a2;
  725. word_415278 = __SS__;
  726. word_41526C = __CS__;
  727. word_415248 = __DS__;
  728. word_415244 = __ES__;
  729. word_415240 = __FS__;
  730. word_41523C = __GS__;
  731. __asm { pushf }
  732. dword_415270 = v12;
  733. dword_415264 = v13;
  734. dword_415268 = v14;
  735. dword_415274 = (int)&a4;
  736. dword_41516C = v14;
  737. dword_415160 = -1073740791;
  738. dword_415164 = 1;
  739. dword_415170 = 1;
  740. dword_415174 = a4;
  741. return sub_411019(off_41387C);
  742. }
  743. // 411019: using guessed type _DWORD __cdecl sub_411019(_DWORD);
  744. // 41387C: using guessed type int off_41387C[2];
  745. // 415160: using guessed type int dword_415160;
  746. // 415164: using guessed type int dword_415164;
  747. // 41516C: using guessed type int dword_41516C;
  748. // 415170: using guessed type int dword_415170;
  749. // 415174: using guessed type int dword_415174;
  750. // 41523C: using guessed type __int16 word_41523C;
  751. // 415240: using guessed type __int16 word_415240;
  752. // 415244: using guessed type __int16 word_415244;
  753. // 415248: using guessed type __int16 word_415248;
  754. // 41524C: using guessed type int dword_41524C;
  755. // 415250: using guessed type int dword_415250;
  756. // 415254: using guessed type int dword_415254;
  757. // 415258: using guessed type int dword_415258;
  758. // 41525C: using guessed type int dword_41525C;
  759. // 415260: using guessed type int dword_415260;
  760. // 415264: using guessed type int dword_415264;
  761. // 415268: using guessed type int dword_415268;
  762. // 41526C: using guessed type __int16 word_41526C;
  763. // 415270: using guessed type int dword_415270;
  764. // 415274: using guessed type int dword_415274;
  765. // 415278: using guessed type __int16 word_415278;
  766.  
  767. // ALL OK, 23 function(s) have been successfully decompiled
  768.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:7:21: fatal error: windows.h: No such file or directory
 #include <windows.h>
                     ^
compilation terminated.
stdout
Standard output is empty