用于Mac OS X readelf样的工具? [英] readelf-like tool for Mac OS X?
问题描述
有阅读Mac OS X的二进制文件,将打印有关搬迁表和符号信息的工具偏移类似这样 readelf
输出?
Is there a tool for reading Mac OS X binaries that would print information about relocation tables and symbol offsets similar to this readelf
output?
readelf -r app
Relocation section '.rel.dyn' at offset 0x5ec contains 2 entries:
Offset Info Type Sym.Value Sym. Name
08049d58 00001706 R_386_GLOB_DAT 00000000 __gmon_start__
08049d60 00000305 R_386_COPY 08049d60 _ZSt4cout
Relocation section '.rel.plt' at offset 0x5fc contains 13 entries:
Offset Info Type Sym.Value Sym. Name
08049d24 00000107 R_386_JUMP_SLOT 0804868c print
08049d28 00000207 R_386_JUMP_SLOT 0804869c _ZNSt8ios_base4InitC1E
08049d2c 00000507 R_386_JUMP_SLOT 080486ac _ZStlsISt11char_traits
08049d30 00000607 R_386_JUMP_SLOT 080486bc _ZNSolsEPFRSoS_E
08049d34 00000707 R_386_JUMP_SLOT 08048664 _init
08049d38 00000807 R_386_JUMP_SLOT 080486dc sleep
08049d3c 00000907 R_386_JUMP_SLOT 080486ec _ZNKSsixEj
08049d40 00000b07 R_386_JUMP_SLOT 080486fc _ZNKSs4sizeEv
08049d44 00000c07 R_386_JUMP_SLOT 0804870c __libc_start_main
08049d48 00000d07 R_386_JUMP_SLOT 08048ae4 _fini
08049d4c 00001307 R_386_JUMP_SLOT 0804872c _ZSt4endlIcSt11char_tr
08049d50 00001507 R_386_JUMP_SLOT 0804873c __gxx_personality_v0
08049d54 00001607 R_386_JUMP_SLOT 0804874c _ZNSt8ios_base4InitD1E
在这个例子中,打印
是一个共享库加载的功能(我写的),在运行时。 readelf
能够显示其在应用程序内的位置信息
二进制文件。
In this example, print
is a function loaded from a shared library (I wrote) at runtime. readelf
is able to display information about its location inside the app
binary.
推荐答案
使用 MacPorts的:
- 安装MacPorts的。
- 使用MacPorts的
端口安装的binutils
-
gobjdump -p /路径/要/应用
- Install macports.
- Using macports
port install binutils
gobjdump -p /path/to/app
使用家酿:
- 安装自制
- 请
BREW更新和放大器;&安培;酿造安装的binutils
-
gobjdump -p /路径/要/应用
- Install Homebrew
- Do
brew update && brew install binutils
gobjdump -p /path/to/app
有,当然有很多其他的命令行选项。需要注意的是binutils的端口告诫说,安装它可能会导致其它端口发生故障打造。周围有它的端口安装的东西/端口卸载/看还是可以派上用场了。
There are, of course, many other command-line options. Note that the binutils port cautions that installing it may cause other ports to fail to build. Having it around to port install/look at something/port uninstall can still be handy.
这是相当惊人的,有没有做到这一点一些本地的工具。
It's rather amazing that there isn't already some native tool to do this.
这篇关于用于Mac OS X readelf样的工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!