Advertisement
Guest User

ZOMA Decompiled

a guest
Jan 8th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. %define MAGIC_LOC 0x1585
  3. %define MAGIC_NUMBER 0x1567
  4.  
  5. 00000000  83C05C            add ax,byte +0x5c ; ax = location + 0x5c
  6. 00000003  EB57              jmp short 0x5c ; jump to actual code
  7.  
  8.  
  9.  
  10. ; step 1
  11. ; move es to arena
  12. 0000005C  1E                push ds
  13. 0000005D  07                pop es ; es -> arena
  14.  
  15.  
  16. ; step 2
  17. ; waste int 0x87
  18. ; search ax:dx
  19. ; replace with bx:cx
  20. 0000005E  CD87              int 0x87
  21.  
  22.  
  23. ; step 3
  24. ; get input from user
  25. 00000060  8B0E8515          get_input: mov cx,[MAGIC_LOC] ; get input from survivor
  26. 00000064  80F900            cmp cl,0x0
  27. 00000067  75F7              jnz get_input
  28.  
  29.  
  30. ; step 4
  31. ; initialize di
  32. 00000069  BF6715            mov di, MAGIC_NUMBER ; magic number
  33.  
  34. ; remember:
  35. ;; ax -> our location + 0x5c
  36. ;; es -> arena
  37. ;; di -> some magic number
  38. ;; cx -> user input (ends with 0x00)
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. ; step 5
  49. 0000006C  91                xchg ax,cx
  50. ; move user input to ax
  51. ; move our main code location to cx
  52. 0000006D  BB2100            mov bx,0x21
  53. 00000070  F7F3              div bx
  54. ;; div bx:
  55. ;; dx = ax % bx
  56. ;; ax = ax / bx
  57.  
  58. ;; ax -> user input / 0x21
  59. ;; dx -> user input % 0x21
  60.  
  61.  
  62. ; step 6
  63. ; jump according to user params
  64. 00000072  01CA              add dx,cx ; dx -> our location + (user input % 0x21)
  65. 00000074  91                xchg ax,cx ; ax -> our location, cx -> user input / 0x21
  66. 00000075  FFE2              jmp dx
  67. ; jump to location stored in dx
  68.  
  69.  
  70. ; es -> arena
  71. ; di -> some magic number
  72. 00000077  B866AB            mov ax,0xab66
  73. ; stosw:
  74. ; mov [es:di], ax
  75. ; add di, 2
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83. 0000007A  BB9090            mov bx,0x9090
  84. 0000007D  F7F3              div bx
  85. 0000007F  89D1              mov cx,dx
  86. 00000081  EBFE              jmp short 0x81
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement