fix several issues relating to elf and registers and add mmap

This commit is contained in:
Matheus
2022-08-18 17:50:34 -03:00
parent fc6d0000c5
commit 0984a6458d
9 changed files with 243 additions and 34 deletions
+8 -4
View File
@@ -2,12 +2,13 @@ section .rodata
extern syscall_libc_log
func_count equ 1
extern syscall_mmap
func_count equ 2
func_table:
dq syscall_libc_log
dq syscall_mmap
section .text
global asm_syscall_entry
@@ -45,11 +46,14 @@ asm_syscall_entry:
push r8
push r9
push r10
; system V C abi expects the third param to be in rcx
; but the param is in rdx because of the syscall instruction
mov rcx, rdx
mov rcx, r10
call [func_table + rax * 8]