Advertisement
Guest User

Untitled

a guest
May 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. BITS 64
  2.  
  3. %define __NR_read 3
  4. %define __NR_write 4
  5.  
  6. GLOBAL  _start
  7.  
  8. SECTION .bss
  9.  
  10. %define bufsize 10240
  11. buffer  resb    bufsize
  12.  
  13. SECTION .text
  14.  
  15. _start:
  16.  
  17.         mov     eax,__NR_read   ; "read" function number
  18.         xor     ebx,ebx         ; console read file descriptior (0)
  19.         mov     ecx,buffer      ; buffer address
  20.         mov     edx,bufsize     ; buffer size
  21.         int     0x80            ; read from console (returns read bytes count in eax)
  22.  
  23.         mov     edx, 2048    ; number of bytes to write
  24.         mov     eax,__NR_write  ; "write" function number
  25.         mov     ebx,1           ; console write file descriptior
  26.         ; buffer address (ecx) is not changed
  27.         int     0x80            ; write to console
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement