Advertisement
Guest User

cmps/movs-stackoverflow_

a guest
Jun 19th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. .model small
  2. .stack 32
  3. .data
  4. head1 db "Dipsticks",10,'$'
  5. head2 db 4 Dup(' '), '$'
  6. ;; change the value above for a buffer overflow attack
  7. ; 9 writes it perfectly
  8. ; 8 removes the E in Equals --> qual
  9. ;7 removes the Eq in Equals and prints out S from dispsticks in front
  10. msg1 db "Equal",10,'$'
  11. msg2 db "Not Equals",10,'$'
  12.  
  13. .code
  14. shamoo proc far
  15. mov ax, @data
  16. mov ds, ax
  17. mov es, ax
  18.  
  19. cld
  20. mov cx, 10
  21. lea si, head1
  22. lea di, head2
  23. REP MOVsB
  24.  
  25.  
  26. cld
  27. mov cx, 10
  28. lea si, head1
  29. lea di, head2
  30. REPE CMPSB
  31.  
  32. JE L1
  33. LEA Dx, msg2
  34. mov ah, 09h
  35. int 21h
  36. jmp a30
  37.  
  38. L1:
  39. lea dx, msg1
  40. mov ah, 09h
  41. int 21h
  42.  
  43. a30:
  44. mov ax, 4c00h
  45. int 21h
  46.  
  47. shamoo endp
  48. end shamoo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement