下面是我的代码:
@execve takes 3 arguments (r0,r1,r2)
mov r7,#11 @syscall number for execve
ldr r0,=addr_of_string
sub r1,r1,r1 @so that r1 can get zero
sub r2,r2,r2 @same for r2
svc #0
end:
mov r7,#1
svc 0
.data
addr_of_string: .asciz "\bin\ls"它成功编译并成功链接,但当我执行它时,我得到:
通过exec系统调用传递的argv为空
发布于 2018-03-27 11:02:54
Why can the execve system call run "/bin/sh" without any argv arguments, but not "/bin/ls"?
上面的线程说,因为/bin/ls是gnu coreutils包的一部分,所以它们调用' set‘程序名来设置它。
发布于 2018-03-27 11:23:34
Why can the execve system call run "/bin/sh" without any argv arguments, but not "/bin/ls"?
上面的线程说明,因为/bin/ls是gnu coreutil包的一部分,所以必须在调用之前设置它。
https://stackoverflow.com/questions/49496621
复制相似问题