Advertisement
MichaelPetch

key1

Dec 10th, 2020 (edited)
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. ; Assemble with:
  2. ; nasm -f bin key.asm -o key
  3.  
  4. start:
  5. mov bx, [0x0DED] ; Get the WORD from [0x0DED]
  6. neg bx ; Negate it
  7. nop ; Need to wait at least one more instruction (3 total)
  8. ; before trying to read 0x0DED again
  9. add bx, [0x0DED] ; Add the current WORD value at [0x0DED] with BX
  10. ; safeAX = -BX+[0x0DED] = [0x0DED]-BX
  11. ; or safeAX = (-prevsafeAX)+[currentsafeAX] = [currentsafeAX]-(prevsafeAX)
  12. mov byte [bx], 060h ; Overwrite the first instruction of safe with 060h
  13. ; to terminate the safe.
  14. jmp $ ; Infinite loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement