Skip to content

Commit

Permalink
fork syscall assembly demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Lexterl33t committed Jul 12, 2020
0 parents commit 311a855
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
Binary file added .sys_fork.s.swp
Binary file not shown.
Binary file added sys_fork
Binary file not shown.
Binary file added sys_fork.o
Binary file not shown.
30 changes: 30 additions & 0 deletions sys_fork.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BITS 64

extern printf

global _main

section .rodata
print_result db 'pid => %d', 10, 0
section .text

_main:
jmp _print_pid


_print_pid:
mov rax, 57
syscall
mov rdi, print_result
mov rsi, rax
xor rax, rax
call printf
syscall
jmp _exit


_exit:
mov rax, 0x3C
mov rdi, 0
syscall

0 comments on commit 311a855

Please sign in to comment.