I want execve("/bin/cat",["/bin/cat","/test/file"],NULL)
.
Here is my asm
xor %rdx, %rdx
push %rdx
sub $0x16, %rsp
movb $0x2f, 7(%rsp)
movl $0x2f6e6962, 8(%rsp)
movl $0x746163, 12(%rsp)
leaq 7(%rsp), %rdi
pushq %rdx
push %rdi
mov %rsp, %rsi
movb $0x3b, %al
syscall
This asm, I can get only `execve("/bin/cat",["/bin/cat"],NULL) only.
How can I pass param '/test/file' in rsi?
execve("/bin/cat",["/bin/cat","/test/file",NULL)
the '[' is an invalid character in the second parameter. – user3629249 Jul 9 '19 at 15:06gcc
to compile, to use the-S
option on a C source file. This will result in a file containing the assembly instructions needed to perform theexecve()
function. Then copy the needed instructions into your file – user3629249 Jul 9 '19 at 15:09