12345678910111213141516171819202122232425262728293031323334353637 |
- .file "child64.s"
-
- .section .text
- .global _start
-
- _start:
- mov $0x9, %rax # MMAP
- xor %rdi, %rdi
- mov $0x1000, %rsi # 1 page map
- mov $(0x1|0x2), %rdx # PROT_READ | PROT_WRITE
- mov $(0x20 | 0x1), %r10 # MAP_ANONYMOUS | MAP_SHARED
- mov $-1, %r8 # fd
- xor %r9, %r9
- syscall
-
- cmp $0, %rax
- jle .errmap
-
- push %rax
- xor %rax, %rax
- push %rax
-
-
- mov $-1, %r15
- mov $34, %rax # sys_pause
- syscall
-
- jmp *(%rsp)
-
- mov $60, %rax
- xor %rdi, %rdi
- syscall
-
- .errmap:
- mov $60, %rax # sys_exit
- mov $1, %rdi
- syscall
|