otool用法
- 单个参数
-l: print the load commandsotool -l iOSBinaryFile-L: print shared Libraries usedotool -L iOSBinaryFile-o: print the Objective-C segment-V: print disassembled operands symbolically
- 参数组合
-oVotool -oV iOSBinaryFile-tVotool -tV iOSBinaryFile
- 用途
- 用otool去手动计算地址转函数
otool -arch <arch> -l <path_to_dsym> | grep __TEXT -m 2 -A 1 | grep vmaddr
- 用otool去手动计算地址转函数
常见问题
is not an object file
otool只支持查看Mach-O格式的文件,不支持其他格式的文件。
比如如果用otool查看ELF格式的话,会报错:
➜ arm64-v8a otool -L libtacker.so
libtacker.so: is not an object file
➜ arm64-v8a otool -oV libtacker.so
libtacker.so: is not an object file