安卓 adb shell 使用strace

https://stackoverflow.com/questions/34762544/strace-in-android

http://forum.xda-developers.com/showthread.php?t=2516002

这个链接里边的下载链接改变内容了,可能域名过期了

 

mmma -j6 external/strace

https://source.android.com/docs/core/tests/debug/strace?hl=zh-cn

https://www.jianshu.com/p/6bdea0e66457

mmma -j6 external/strace

aosp没提供编译好的,要自己编译,问题是我不会编译

 

 

therealsaumil

https://github.com/therealsaumil/static-arm-bins

https://github.com/therealsaumil/static-arm-bins/blob/master/strace-android-static

这里有一版,但是在我手机(安卓10)上用着有问题,execve("/system/bin/df", ["df", "-h"], [/* 24 vars */]) = 0之后就不动了,或者显示 pid 28947 unknown syscall trap 0xd4

RMX1901CN:/ $ file /data/local/tmp/strace-android-static
/data/local/tmp/strace-android-static: ELF executable, 32-bit LSB arm, static, stripped

 

andrew-d

https://mabin004.github.io/2019/06/27/Android%E4%B8%8A%E5%88%A9%E7%94%A8Strace%E8%B7%9F%E8%B8%AA%E7%B3%BB%E7%BB%9F%E8%B0%83%E7%94%A8/

“得到binary后,push到/data/local/tmp下更改权限,关闭SELinux后即可使用。”自测不用关SELinux

https://github.com/andrew-d/static-binaries/blob/master/binaries/linux/arm/strace

 

jtrace

https://newandroidbook.com/tools/jtrace.html

该工具的最新稳定版本,作为带有二进制文件的 tar 文件(目前为 ARM64 和 x86_64),始终可以在此页面获取。

说是比strace针对安卓添加了一些功能

 

系统自带

/system/bin/strace

小米miui是自带的,但是oppo不自带。。。小米这个strace用着没问题,叫我移到oppo里用了

-rwxr-xr-x 1 root shell  809744 2009-01-01 08:00 strace

cas:/ $ file strace
strace: cannot open

 

 

手册

https://man7.org/linux/man-pages/man1/strace.1.html

源码

https://github.com/strace/strace

 

 

一些在电脑端linux里交叉编译的文章

windows上估计是不太好弄,还是得用虚拟机装个Ubuntu

Linux的软件就是很多没编译好的二进制,比较麻烦,而安卓上显然没有apt/yum这种二进制包管理器。比较类似的一个选择是用termux和它的包管理器

https://blog.lilydjwg.me/2013/5/8/compile-zsh-and-strace-for-android.39183.html

http://muzso.hu/2012/04/21/how-to-compile-strace-for-use-on-an-android-phone-running-an-arm-cpu

 

 

1)用交叉编译器编译libelf

2) 尝试从 Debian 存档中获取 libelf 的arm版本,使用 dpkg -x 将其解压到私有目录,然后尝试链接该目录。

 

posted @ 2024-02-17 12:43  hrdom  阅读(149)  评论(0编辑  收藏  举报