DHAMP.b 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. /*
  2. * Input file : ./tests/inputs/DHAMP.EXE
  3. * File type : EXE
  4. */
  5. #include "dcc.h"
  6. int proc_2 (long arg0, long arg1)
  7. /* Takes 8 bytes of parameters.
  8. * High-level language prologue code.
  9. * C calling convention.
  10. */
  11. {
  12. char loc1; /* al */
  13. int loc2; /* bx */
  14. do {
  15. arg0 = (arg0 + 1);
  16. loc1 = es[bx];
  17. arg1 = (arg1 + 1);
  18. es[bx] = loc1;
  19. } while ((loc1 != 0));
  20. return (loc2);
  21. }
  22. int proc_3 (long arg0, long arg1)
  23. /* Takes 8 bytes of parameters.
  24. * High-level language prologue code.
  25. * C calling convention.
  26. */
  27. {
  28. int loc1; /* ax */
  29. while ((es[bx] == es[bx])) {
  30. if (es[bx] == 0) {
  31. loc1 = 0;
  32. return (loc1);
  33. }
  34. else {
  35. arg0 = (arg0 + 1);
  36. arg1 = (arg1 + 1);
  37. }
  38. } /* end of while */
  39. loc1 = (es[bx] - es[bx]);
  40. }
  41. int proc_1 (int arg0, int arg1, int arg2, int arg3)
  42. /* Takes 8 bytes of parameters.
  43. * High-level language prologue code.
  44. * C calling convention.
  45. */
  46. {
  47. int loc1; /* si */
  48. int loc2; /* di */
  49. loc1 = 0;
  50. loc2 = 0;
  51. while ((loc1 < 0x2328)) {
  52. proc_2 (arg1, arg0, 311);
  53. proc_2 (arg3, arg2, 328);
  54. loc2 = (loc2 + proc_3 (arg1, arg0, arg3, arg2));
  55. loc1 = (loc1 + 1);
  56. } /* end of while */
  57. return (loc2);
  58. }
  59. int proc_4 ()
  60. /* Takes no parameters.
  61. * High-level language prologue code.
  62. */
  63. {
  64. int loc1;
  65. int loc2;
  66. int loc3;
  67. int loc4;
  68. loc3 = 0;
  69. while ((loc3 < 0x3e8)) {
  70. loc1 = 0;
  71. loc4 = 0;
  72. loc2 = 1;
  73. while ((loc4 < 179)) {
  74. loc1 = (loc1 + loc2);
  75. loc2 = (loc2 + 2);
  76. loc4 = (loc4 + 1);
  77. } /* end of while */
  78. loc3 = (loc3 + 1);
  79. } /* end of while */
  80. return (loc1);
  81. }
  82. int proc_5 (int arg0)
  83. /* Takes 2 bytes of parameters.
  84. * High-level language prologue code.
  85. * C calling convention.
  86. */
  87. {
  88. int loc1; /* si */
  89. int loc2; /* ax */
  90. loc1 = arg0;
  91. if (loc1 > 2) {
  92. loc2 = (proc_5 ((loc1 - 1)) + proc_5 ((loc1 + 0xfffe)));
  93. }
  94. else {
  95. loc2 = 1;
  96. }
  97. return (loc2);
  98. }
  99. long proc_6 (int arg0, int arg1)
  100. /* Takes 4 bytes of parameters.
  101. * High-level language prologue code.
  102. * C calling convention.
  103. */
  104. {
  105. long loc1;
  106. int loc2; /* si */
  107. if ((arg0 | arg1) == 0) {
  108. loc2 = 0;
  109. while ((loc2 < 0x2328)) {
  110. loc1 = (loc1 + [23798]);
  111. [23798] = ([23798] + 2);
  112. loc2 = (loc2 + 1);
  113. } /* end of while */
  114. }
  115. else {
  116. loc2 = 0;
  117. while ((loc2 < 0x2328)) {
  118. [23798] = ([23798] - 2);
  119. loc1 = (loc1 - [23798]);
  120. loc2 = (loc2 + 1);
  121. } /* end of while */
  122. }
  123. return (loc1);
  124. }
  125. void proc_8 (int arg0)
  126. /* Takes 8 bytes of parameters.
  127. * High-level language prologue code.
  128. * Untranslatable routine. Assembler provided.
  129. * C calling convention.
  130. * Contains instructions not normally used by compilers.
  131. * Contains coprocessor instructions.
  132. */
  133. {
  134. PUSH bp
  135. MOV bp, sp
  136. ESC FLD qword ptr [126h]
  137. ESC FLD qword ptr [bp+6]
  138. ESC FCOMPP
  139. ESC FSTSW qword ptr [62Ch]
  140. INT 3Dh /* Unknown int */
  141. MOV ah, [62Dh]
  142. SAHF
  143. JAE L1
  144. ESC FLD qword ptr [bp+6]
  145. ESC FCHS
  146. L2: POP bp
  147. RETF
  148. L1: ESC FLD qword ptr [bp+6]
  149. JMP L2 ;Synthetic inst
  150. }
  151. void proc_7 (int arg0, int arg1, int arg2, int arg3)
  152. /* Takes 8 bytes of parameters.
  153. * High-level language prologue code.
  154. * Untranslatable routine. Assembler provided.
  155. * C calling convention.
  156. * Contains instructions not normally used by compilers.
  157. * Contains coprocessor instructions.
  158. */
  159. {
  160. PUSH bp
  161. MOV bp, sp
  162. SUB sp, 10h
  163. ESC FLD qword ptr [bp+6]
  164. ESC FDIV qword ptr [127h]
  165. ESC FSTP qword ptr [bp-8]
  166. INT 3Dh /* Unknown int */
  167. MOV ax, [bp+0Ch]
  168. MOV [bp-0Ah], ax
  169. MOV ax, [bp+0Ah]
  170. MOV [bp-0Ch], ax
  171. MOV ax, [bp+8]
  172. MOV [bp-0Eh], ax
  173. MOV ax, [bp+6]
  174. MOV [bp-10h], ax
  175. L1: ESC FLD qword ptr [12Fh]
  176. ESC FMUL qword ptr [bp-8]
  177. ESC FCOMP qword ptr [bp-10h]
  178. ESC FSTSW qword ptr [62Ch]
  179. INT 3Dh /* Unknown int */
  180. MOV ah, [62Dh]
  181. SAHF
  182. JB L2
  183. ESC FLD qword ptr [bp-8]
  184. MOV sp, bp
  185. POP bp
  186. RETF
  187. L2: ESC FLD qword ptr [bp+6]
  188. ESC FDIV qword ptr [bp-8]
  189. ESC FSUB qword ptr [bp-8]
  190. ESC FSTP qword ptr [bp-10h]
  191. INT 3Dh /* Unknown int */
  192. PUSH word ptr [bp-0Ah]
  193. PUSH word ptr [bp-0Ch]
  194. PUSH word ptr [bp-0Eh]
  195. PUSH word ptr [bp-10h]
  196. CALL far ptr proc_8
  197. ADD sp, 8
  198. ESC FSTP qword ptr [bp-10h]
  199. INT 3Dh /* Unknown int */
  200. ESC FLD qword ptr [bp+6]
  201. ESC FDIV qword ptr [bp-8]
  202. ESC FADD qword ptr [bp-8]
  203. ESC FDIV qword ptr [127h]
  204. ESC FSTP qword ptr [bp-8]
  205. INT 3Dh /* Unknown int */
  206. JMP L1 ;Synthetic inst
  207. }
  208. void proc_9 (int arg0)
  209. /* Takes 8 bytes of parameters.
  210. * High-level language prologue code.
  211. * C calling convention.
  212. * Contains instructions not normally used by compilers.
  213. * Contains coprocessor instructions.
  214. */
  215. {
  216. int loc1;
  217. int loc2;
  218. int loc3; /* ax */
  219. loc2 = 100;
  220. loc3 = loc2;
  221. loc2 = (loc2 - 1);
  222. while (((loc3 | loc3) != 0)) {
  223. loc3 = loc2;
  224. loc2 = (loc2 - 1);
  225. } /* end of while */
  226. }
  227. int proc_10 ()
  228. /* Takes no parameters.
  229. * High-level language prologue code.
  230. * Contains instructions not normally used by compilers.
  231. */
  232. {
  233. int loc1;
  234. int loc2;
  235. int loc3;
  236. int loc4;
  237. int loc5;
  238. int loc6; /* bx */
  239. int loc7; /* dx */
  240. int loc8; /* ax */
  241. loc6 = proc_2 (&loc1, 345, , );
  242. fopen ("zyxw.vut", 368);
  243. loc2 = loc7;
  244. loc3 = loc8;
  245. if ((loc7 | loc8) == 0) {
  246. printf ("Cannot open file");
  247. exit (0xffff);
  248. }
  249. l1:
  250. if (++loc5 >= 0x3e8) {
  251. fclose (loc3, loc2);
  252. return (loc5);
  253. }
  254. else {
  255. loc4 = 0;
  256. while ((ss[bp+si-0x64] != 0)) {
  257. if (++es[bx] < 0) {
  258. es[bx+0xc] = (es[bx+0xc] + 1);
  259. loc6 = (loc6 - 1);
  260. es[bx] = ss[bp+si-0x64];
  261. }
  262. else {
  263. _fputc (ss[bp+si-0x64], loc3, loc2);
  264. }
  265. loc4 = (loc4 + 1);
  266. } /* end of while */
  267. goto L1;
  268. }
  269. }
  270. void main ()
  271. /* Takes no parameters.
  272. * High-level language prologue code.
  273. * Contains instructions not normally used by compilers.
  274. * Contains coprocessor instructions.
  275. */
  276. {
  277. int loc1;
  278. int loc2;
  279. int loc3;
  280. int loc4;
  281. int loc5;
  282. int loc6;
  283. int loc7;
  284. int loc8;
  285. int loc9;
  286. int loc10;
  287. int loc11;
  288. int loc12; /* ax */
  289. int loc13; /* bx */
  290. loc11 = 0;
  291. printf ("Start...%c\n\n", 7);
  292. while ((loc11 < 6)) {
  293. loc12 = loc11;
  294. if (loc12 <= 5) {
  295. loc13 = (loc12 << 1);
  296. var06278 = proc_1 (&loc2, &loc1, , );
  297. printf ("\ncresult = %d\n", var06278);
  298. }
  299. loc11 = (loc11 + 1);
  300. } /* end of while */
  301. printf ("\n\n...End%c", 7);
  302. }