有哪些 COFF(Windows .obj 目标文件)查看器可用?
我只知道 2:
- dumpbin 包含在 Visual Studio
- PEView 中,来自 http://wjradburn.com/software/
I am only aware of 2:
- dumpbin which is included with Visual Studio
- PEView from http://wjradburn.com/software/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有 DbgHelp,但它更适合PE 文件而不是目标文件。它旨在用作 API 而不是工具。
COFF 格式本身起源于 unix https://en.wikipedia.org/wiki/COFF尽管微软已经对该格式进行了一些扩展,并且 UNIX 似乎已经放弃了该格式而转而使用 ELF。但是您可能会在 Unix 世界中找到一些有用的工具,例如 SCO 的转储工具 http://docsrv.sco.com:507/en/man/html.CP/dump.CP.html
There is DbgHelp, but it's geared more toward the PE file rather than the object file. And Its intended to be used as an API rather than a tool.
the COFF format itself originated on unix https://en.wikipedia.org/wiki/COFF although Microsoft has extended the format somewhat and the unix seems to have abandoned that format in favor of ELF. But you might find some useful tools in the Unix world, for instance this dump tool from SCO http://docsrv.sco.com:507/en/man/html.CP/dump.CP.html
只需将 COFF 格式转换为 ELF 并使用一些 ELF 查看器:
例如,在 Python 中,您可以使用这个单文件实现,它仅取决于结构模块: http://www.tinyos.net/tinyos-2.1.0/tools/platforms/msp430/pybsl/elf .py
Just convert the COFF format to ELF and use some ELF viewer:
For example in Python you can then use this one-file-implementation, which only depends on the struct module: http://www.tinyos.net/tinyos-2.1.0/tools/platforms/msp430/pybsl/elf.py
嗯,奇怪的是这个选项没有被提及,但是 Binutils 构建了对 COFF 和你的目标架构的支持完全能够向您显示 COFF 文件内容(并且在您询问时)。
这包括
nm
、objdump
等工具 - 具体取决于您的情况正在尝试——还有strip
、objcopy
、ld
。如果您需要大量细节,
llvm-readobj
可能最接近您正在寻找的内容它非常详细且具有描述性;至少如果您对 COFF 文件中的内容有一个粗略的了解。另一方面,LLVM 还带来了 Binutils 工具的克隆,但带有前缀 llvm- 。因此,您可能会找到
llvm-objdump
、llvm-objcopy
、llvm-strip
、llvm-nm
等 。使用现代版本的 Visual Studio(自 VS2019、IIRC 起),您可以从 Visual Studio 安装程序安装完整的 Clang/LLVM 工具链,其中包含这些工具 - 或者也可以从 Clang/LLVM 项目网站。
Binutils 和 LLVM 也完全能够处理由库管理器 (
lib.exe
) 生成的.lib
文件格式; ar 和 7-Zip 可用于解压它们。如果您需要某些高级功能来操作目标文件或库,您可能需要查看 objconv< /a>,不过。荣誉奖:一些十六进制编辑器,例如 ImHex,也能够显示更结构化的 COFF 视图文件。
Hmm, its odd this option hadn't been mentioned, but Binutils built with support for COFF and your target architecture are perfectly capable of showing you COFF file contents (and were at the time you asked).
This includes tools like
nm
,objdump
and -- depending on what it is you are trying -- alsostrip
,objcopy
,ld
.If you're after a lot of detail,
llvm-readobj
may be closest to what you are looking for it is very detailed and descriptive at the same time; at least if you have a rough idea about what's in a COFF file.On the other hand LLVM also brings clones of tools from Binutils but prefixed
llvm-
. So you are likely to findllvm-objdump
,llvm-objcopy
,llvm-strip
,llvm-nm
etc.With modern versions of Visual Studio (since VS2019, IIRC), you can install the full Clang/LLVM toolchain from the Visual Studio Installer, which contains these tools -- otherwise it can also be found prepackaged from the Clang/LLVM project website.
Binutils and LLVM are also perfectly capable of dealing with the
.lib
file format produced by the Library Manager (lib.exe
);ar
and 7-Zip can be used to unpack them. If you need certain advanced functionality to manipulate object files or libraries, you may want to have a look at objconv, though.Honorable mention: some hex editors, like ImHex, also have the ability to show a more structured view of COFF files.