wozname
wozname

Reputation: 223

What COFF (windows .obj object file) viewers are available?

I am only aware of 2:

Upvotes: 13

Views: 7958

Answers (3)

0xC0000022L
0xC0000022L

Reputation: 21259

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.

Upvotes: 0

John Knoeller
John Knoeller

Reputation: 34128

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

Upvotes: 4

kungfooman
kungfooman

Reputation: 4893

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

Upvotes: 1

Related Questions