Skip to the content ForoHackers
Log inJoin

Binary analysis: start here

Binary analysis
#3291 · · Quote · Report

Binary analysis is the study of compiled programs and their formats to learn what they contain and how they behave, often without the source. It serves bug finding, compatibility, auditing third-party code and malware triage. The skills are file formats, processor architectures and tools that read or run code safely, applied to your own software and training material.

Key concepts

  • Executable formats: ELF, PE and Mach-O describe sections, symbols, imports and entry points.
  • Linking: static and dynamic linking decide which code is inside the file and which is found at run time.
  • Static analysis: recover control-flow graphs, strings, constants and data structures without running anything.
  • Dynamic analysis: tracing, debugging and instrumentation record what really happens, including paths static analysis misses.
  • Mitigations: stack protection, ASLR, non-executable memory and control-flow integrity change what a binary can resist.

Vocabulary

  • Control-flow graph: basic blocks of code joined by jumps and calls.
  • Symbol table: names attached to addresses, often stripped from release builds.
  • Binary diffing: comparing two versions to see what changed, for example in a patch.
  • Emulation: running code in a simulated processor, for architectures you do not have.

What to study, in order

  1. Compile a small C program and inspect it with the standard command-line tools for headers, sections and symbols.
  2. Learn how a process is laid out in memory: code, data, heap, stack and shared libraries.
  3. Read assembly for loops, calls and conditionals until you can follow one function cold.
  4. Use a debugger and a tracer on a program of yours, then a disassembler on the same binary stripped.
  5. Diff two builds of your own program and explain every change.

Related tags

#reverse-engineering #assembly #memory-management #compilers #static-analysis

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply