Quantcast
Channel: 看雪安全论坛
Viewing all articles
Browse latest Browse all 9556

【求助】android 下面 system 函数 使用的问题 --- 解决了结贴

$
0
0
我在ubuntu下写了个

testsysfun.c


里面的内容如下:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>

int main(int argc, char *argv[])
{

int iError;

iError = 0;

printf("Test...1 \n");


iError = system("pwd");


printf("ls iError = %d \n",iError>>8);

printf("ls Error String = %s \n",strerror(iError>>8));


printf("Test...211111 \n");

return 0;
}



然后用

arm-none-linux-gnueabi-gcc -static testsysfun.c -o testsysfun

编译过了


生成了 testsysfun 的可执行程序


我把它adb push到真机上,真机系统是4.0.4的并且已经ROOT了


结果运行出来,错误127

输出错误信息是

Key has expired



求大神们解救啊。为啥用system函数调用一个"pwd"命令会出现错误127啊?

百度了好多都找不到原因

还有,不一定是pwd 命令不行,ls也不行,也是127错误

如果编译成linux版本,在ubuntu下运行是可以的。。。

截图如下:

附件 86401


先谢谢各位大神啦。。。

上传的图像
文件类型: jpg 1.jpg (53.4 KB)

Viewing all articles
Browse latest Browse all 9556

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>