SHARE
TWEET

Untitled

a guest Oct 21st, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. call open_file
  2.  
  3.     mov %rax, %rdi
  4.     call read_file
  5.  
  6.     mov %rax, %rdx
  7.     call print_buf
  8.  
  9.     call exit
  10.  
  11. parse_args:
  12.     pop %r13
  13.     cmp $1,
  14.  
  15. ask_filename:
  16.     mov $1, %rax
  17.     mov $1, %rdi
  18.     mov $ask, %rsi
  19.     mov $asklen, %rdx
  20.     syscall
  21.    
  22.     mov $0, %rax
  23.     mov $0, %rdi
  24.     mov $filename, %rsi
  25.     mov $filenamelen, %rdx
  26.     syscall
  27.  
  28.     mov $filename, %r15
  29.     add %rax, %r15
  30.     dec %r15
  31.     movb $0, (%r15)
  32.     mov $filename, %rdi
  33.  
  34.     jmp main
  35.  
  36. open_file:
  37.     mov $2, %rax
  38.     mov $0, %rsi
  39.     syscall
  40.     ret
  41.  
  42. read_file:
  43.     mov $0, %rax
  44.     mov $buffer, %rsi
  45.     mov $bufferlen, %rdx
  46.     syscall
  47.     ret
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top