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.

asm_env_stamps.s 613B

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