objdump is a program for displaying various information about object files. For instance, it can be used as a disassembler to view an executable in assembly form. It is part of the GNU Binutils for fine-grained control over executables and other binary data.
For example,
This performs disassembly on the file «file.bin», with the assembly code shown in Intel syntax. We then redirect it to grep, which searches the main function and displays 20 lines of its code.
Example output:
objdump uses the BFD library to read the contents of object files.
Similar utilities are Borland TDUMP, Microsoft DUMPBIN, and (also included in the binutils package), readelf that can only read ELF files and it does not use the BFD library.