Get Started

Program Anatomy: An ELF Reader From Scratch

A compiled program is a set of tables that point at each other. A reader you wrote gives output you can check byte by byte.

120 minutesBuildPython (stdlib), C (fixture only)Members

Learning Objectives

  • State the authorization rule for every target in this track and the four limits of 17 U.S.C. 1201(f).
  • Read the ELF header, the section header table, and both string tables with struct.unpack.
  • Decode .symtab entries and .rela records with the names from the gABI and the x86-64 psABI.
  • Return the exact bytes of a named function and map every file offset to the structure that owns it.
  • Read program headers and map a virtual address to a file offset through PT_LOAD.
  • Read the load commands of a Mach-O object and name the ELF idea that each one matches.