My code:
section .data
    binsh: db "/bin/sh"
section .text
global start
start
    mov rax, 59 ; move syscall execve (59) to rax
    mov rdi, binsh ; command
    mov rsi, 0 ; argv
    mov rdx, 0 ; envp
    int 0x80
    mov rax, 60 ; move syscall exit (60) to rax
    mov rdi, 0 ; exit 0
    int 0x80
This does not work because i dont know how to use the execve syscall.
strace is showing this:
execve("./first_assembler", ["./first_assembler"], [/* 67 vars */]) = 0
execve("/bin/sh", NULL, NULL)           = -1 EFAULT (Bad address)
exit(0)                                 = ?
<... exit resumed> strace: _exit returned!
)                    = ?
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV (core dumped) +++
What is the correct usage of the execve syscall?
