Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. section .bss
  2. buff: resb 8192
  3. buffsize: equ $-buff
  4. section .text
  5.   global _start
  6. _start:
  7. ;open file
  8. mov eax, 5
  9. pop ebx
  10. pop ebx
  11. pop ebx
  12. mov ecx, 0
  13. int 80h
  14. ;errors?
  15. test eax, eax
  16. jns file_function
  17. mov ebx, eax
  18. mov eax, 1
  19. int 80h
  20. ;read file
  21. file_function:
  22. mov ebx, eax
  23. mov eax, 3
  24. mov ecx, buff
  25. mov edx, buffsize
  26. int 80h
  27. ;errors?
  28. test eax, eax
  29. ;jz nextfile
  30. js errors
  31. ;print
  32. mov edx, eax
  33. mov eax, 4
  34. mov ebx, 1
  35. int 80h
  36. ;exit
  37. mov eax, 1
  38. mov ebx, 0
  39. int 80h
  40. errors:
  41. mov ebx, eax
  42. mov eax, 1
  43. int 80h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement