有哪些 COFF(Windows .obj 目标文件)查看器可用?

发布于 2024-08-22 02:15:01 字数 186 浏览 8 评论 0原文

我只知道 2:

I am only aware of 2:

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

孤千羽 2024-08-29 02:15:01

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

把回忆走一遍 2024-08-29 02:15:01

只需将 COFF 格式转换为 ELF 并使用一些 ELF 查看器:

objcopy.exe --input-target=pe-i386 --output-target=elf32-i386 somefile.o somefile.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:

objcopy.exe --input-target=pe-i386 --output-target=elf32-i386 somefile.o somefile.elf

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

再见回来 2024-08-29 02:15:01

嗯,奇怪的是这个选项没有被提及,但是 Binutils 构建了对 COFF 和你的目标架构的支持完全能够向您显示 COFF 文件内容(并且在您询问时)。

这包括 nmobjdump 等工具 - 具体取决于您的情况正在尝试——还有stripobjcopyld

如果您需要大量细节 llvm-readobj可能最接近您正在寻找的内容它非常详细且具有描述性;至少如果您对 COFF 文件中的内容有一个粗略的了解。

另一方面,LLVM 还带来了 Binutils 工具的克隆,但带有前缀 llvm- 。因此,您可能会找到 llvm-objdumpllvm-objcopyllvm-stripllvm-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 -- also strip, 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 find llvm-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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文