A shell that runs x86_64 assembly
c
x86-64
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

child.s 511B

12345678910111213141516171819202122232425262728293031323334353637
  1. .file "child64.s"
  2. .section .text
  3. .global _start
  4. _start:
  5. mov $0x9, %rax # MMAP
  6. xor %rdi, %rdi
  7. mov $0x1000, %rsi # 1 page map
  8. mov $(0x1|0x2), %rdx # PROT_READ | PROT_WRITE
  9. mov $(0x20 | 0x1), %r10 # MAP_ANONYMOUS | MAP_SHARED
  10. mov $-1, %r8 # fd
  11. xor %r9, %r9
  12. syscall
  13. cmp $0, %rax
  14. jle .errmap
  15. push %rax
  16. xor %rax, %rax
  17. push %rax
  18. mov $-1, %r15
  19. mov $34, %rax # sys_pause
  20. syscall
  21. jmp *(%rsp)
  22. mov $60, %rax
  23. xor %rdi, %rdi
  24. syscall
  25. .errmap:
  26. mov $60, %rax # sys_exit
  27. mov $1, %rdi
  28. syscall