Guest User

Untitled

a guest
Jan 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. section .bss
  2. c: resb 1
  3. section .text
  4. global _start
  5.  
  6. _start:
  7.  
  8. _loop:
  9. mov eax, 3 ; read() syscall
  10. mov ebx, 0 ; read from stdin
  11. mov ecx, c
  12. mov edx, 1 ; read one byte at a time
  13. int 0x80
  14.  
  15. cmp eax, 1 ; check number of bytes read
  16. jne _exit
  17.  
  18. mov eax, 341 ; rot 13 stuff
  19. mov ebx, [c]
  20. int 0x80
  21. mov [c], al ; store rot13'd char in c
  22.  
  23. mov eax, 4 ; write() syscall
  24. mov ebx, 1 ; wrie to stdout
  25. mov ecx, c
  26. mov edx, 1 ; write one byte at a time
  27. int 80h
  28.  
  29. cmp eax, 1 ; check number of bytes written
  30. jne _exit
  31.  
  32. jmp _loop
  33.  
  34. _exit:
  35. mov eax,1
  36. int 80h
  37. ; vim: set ft=nasm:
Add Comment
Please, Sign In to add comment