Playground project to learn more about the Mach-O file format.

How to run

swift run MachO-Reader <path-to-binary>

You should see a similar output: image


  1. Parsing Mach-O Files
  2. llios
  3. Hello, Mach-O
  4. Swift metadata
  5. Machismo

Source files

Mach-O implementation details can be in Xcode’s folder. In my case this is the path:


These are some useful relative paths:

  1. /usr/include/mach-o/loader.h
  2. /usr/include/mach/vm_prot.h


View Github