4

I may not be asking this in the correct place, but is there somewhere I can research what the structure of an executable binary files is? As in, how the code is organized, where the symbols are stored, etc.

3
  • 8
    What kind of binary file? Do you mean an executable file? For which platform(s)? Commented Feb 26, 2012 at 18:25
  • 1
    I think you need to specify a bit more what kind of binary file you're looking for. I'm guessing an executable, but what format? ELF? DWARF? a.out? Commented Feb 26, 2012 at 18:25
  • Yes, I'm talking executable. I actually didn't know what the different formats were, but judging by one of the answers I'm mostly looking for ELF and Mach-O. Commented Feb 26, 2012 at 18:34

4 Answers 4

10

Depends on what platform you're interested in!

Windows uses the PE binary format.

Linux uses ELF.

Mac OS (and iOS) use Mach-O.

Some older UNIX systems use a.out.

Sign up to request clarification or add additional context in comments.

1 Comment

oswalt.dev/2020/11/anatomy-of-a-binary-executable has some discussion and hexdumps + readelf output on Linux ELF executables, including some about the x86-64 machine code in the .text section.
3

The structure of a binary file is defined by the application which created it. For example the code you write in Java or C and write it into a file, can be only read back by a code which knows the structure of how it was written.

In the case of executable files, there are different kinds which varies depending on operating systems. For example to check the structure of the Executable and Linking Format (ELF) files see man elf : http://www.kernel.org/doc/man-pages/online/pages/man5/elf.5.html

Comments

1

You need to understand what an ELF file is! Here is your starting point.

And this article neatly explains how to dissect ELF files using readelf and objdump

Comments

0

This article does a really easy to follow overview of executable binaries.

1 Comment

Stack Overflow doesn't allow link-only answers. If you have a useful link, it should be at most a comment. That article does look pretty good, for ELF executables for Linux. Your "answer" didn't specify that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.