1234567891011121314151617181920212223242526272829303132333435363738394041 |
- .file "child64.s"
-
- .section .text
- .global _start
-
- _start:
- mov $0x4242, %r15 # stamp1
- mov $-1, %r14 # stamp 2
-
- mov $0x9, %rax # MMAP
- xor %rdi, %rdi
- mov $0x1000, %rsi # 1 page map
- #mov $(0x1|0x2), %rdx # PROT_READ | PROT_WRITE
- mov $(0x1|0x4), %rdx # PROT_READ | PROT_EXEC
- 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
|