Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %define MAGIC_LOC 0x1585
- %define MAGIC_NUMBER 0x1567
- 00000000 83C05C add ax,byte +0x5c ; ax = location + 0x5c
- 00000003 EB57 jmp short 0x5c ; jump to actual code
- ; step 1
- ; move es to arena
- 0000005C 1E push ds
- 0000005D 07 pop es ; es -> arena
- ; step 2
- ; waste int 0x87
- ; search ax:dx
- ; replace with bx:cx
- 0000005E CD87 int 0x87
- ; step 3
- ; get input from user
- 00000060 8B0E8515 get_input: mov cx,[MAGIC_LOC] ; get input from survivor
- 00000064 80F900 cmp cl,0x0
- 00000067 75F7 jnz get_input
- ; step 4
- ; initialize di
- 00000069 BF6715 mov di, MAGIC_NUMBER ; magic number
- ; remember:
- ;; ax -> our location + 0x5c
- ;; es -> arena
- ;; di -> some magic number
- ;; cx -> user input (ends with 0x00)
- ; step 5
- 0000006C 91 xchg ax,cx
- ; move user input to ax
- ; move our main code location to cx
- 0000006D BB2100 mov bx,0x21
- 00000070 F7F3 div bx
- ;; div bx:
- ;; dx = ax % bx
- ;; ax = ax / bx
- ;; ax -> user input / 0x21
- ;; dx -> user input % 0x21
- ; step 6
- ; jump according to user params
- 00000072 01CA add dx,cx ; dx -> our location + (user input % 0x21)
- 00000074 91 xchg ax,cx ; ax -> our location, cx -> user input / 0x21
- 00000075 FFE2 jmp dx
- ; jump to location stored in dx
- ; es -> arena
- ; di -> some magic number
- 00000077 B866AB mov ax,0xab66
- ; stosw:
- ; mov [es:di], ax
- ; add di, 2
- 0000007A BB9090 mov bx,0x9090
- 0000007D F7F3 div bx
- 0000007F 89D1 mov cx,dx
- 00000081 EBFE jmp short 0x81
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement