Linux(特别是 Ubuntu)上是否有用于将数字地址转换为二进制图像符号的 atos 二进制文件?它似乎只能在 OS X 上使用。
来自 facebook 的 Atosl - https://github.com/facebook/atosl
要让它在 ubuntu 上运行:
sudo apt-get install libdwarf-dev binutils-dev
git clone [email protected]:facebook/atosl.git
cd atosl
make
没有什么可以自动翻译地址;您需要选择
nm
或 objdump
的输出。
binutils 中名为 addr2line 的类似工具。
为了在 Linux 中使用 atos 分析 iOS 二进制文件(也应该适用于 MacOS 二进制文件),我将 [Darling][1] 与 Xcode 11.3.1 结合使用。
注意:需要旧的 Xcode 版本,因为新版本依赖于 Darling 中不是最新的系统库。也许比 11.3.1 更新的版本应该可以工作,但这是我第一次也是最后一次尝试。
使用说明:
/Applications/Xcode.app/Contents/Developer/usr/bin/atos
rpath
,从而删除 Xcode 以仅使用 atos:
mkdir -p atos-bin/Developer/usr/bin/
mkdir -p atos-bin/SharedFrameworks/
cd atos-bin
cp /Applications/Xcode.app/Contents/Developer/usr/bin/atos Developer/usr/bin/
cp -r /Applications/Xcode.app/Contents/SharedFrameworks/SymbolicationDT.framework SharedFrameworks
cp -r /Applications/Xcode.app/Contents/SharedFrameworks/CoreSymbolicationDT.framework SharedFrameworks
# run atos
./Developer/usr/bin/atos
[1]: https://github.com/darlinghq/darling
[2]: https://docs.darlinghq.org/installing-software.html
[3]: https://developer.apple.com/download/all/
[4]: https://github.com/saagarjha/unxip