Advertisement
libchm

asm mini ELF64

Feb 12th, 2024
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | Source Code | 0 0
  1. .intel_syntax noprefix
  2. .text
  3. .globl _start, syscall5
  4.  
  5. _start:
  6. xor rbp,rbp
  7. pop rdi
  8. mov rsi,rsp
  9. and rsp,-16
  10. call main
  11.  
  12. mov rdi,rax /* syscall param 1 = rax (ret value of main) */
  13. mov rax,60 /* SYS_exit */
  14. syscall
  15.  
  16. ret /* should never be reached, but if the OS somehow fails
  17. to kill us, it will cause a segmentation fault */
  18.  
  19. syscall5:
  20. mov rax,rdi
  21. mov rdi,rsi
  22. mov rsi,rdx
  23. mov rdx,rcx
  24. mov r10,r8
  25. mov r8,r9
  26. syscall
  27. ret
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement