Hello,
I try to understand the difference between syscalls executed in C and in nasm (or any other assembler like gnu asm).
It seems to me, that syscalls account of the libs in C can be much more flexible than in nasm.
For example a list of the exe-syscalls in C from the man pages:
#include
extern char **environ;
int execl( const char *path, const char *arg, ...);
int execlp( const char *file, const char *arg, ...);
int execle( const char *path, const char *arg,
..., NULL, char * const envp[]);
int execv( const char *path, char *const argv[]);
int execvp( const char *file, char *const argv[]);
But if I try to use this in nasm, it seems, I only have the choice to use
execve like below, but for me it's not clear, how to use the other types like execvp, execle, execv, execlp and execl. It seems, the syscall-list only give me the possibillity to use syscall 11 for execve.
I didn't find any ohther similary form. Is there no possibillity to use variations of those syscalls like in C? Cause if I only put 11 in eax, I get the execve-syscall, but not for example execl.
Does anyone know, how to solve that problem? Perhaps it's very simle?
Thanks a lot for any help
; Example of syscall execve (11) in nasm
section .data
name db '/bin/sh', 0
....
....
....
; execve("/bin/sh",["/bin/sh", NULL], NULL)
mov eax, 11
mov ebx, name
push 0
push name
mov ecx, esp
mov edx, 0
int 0x80