Universal binaries: one container, multiple Mach-O images
A universal, or “fat,” binary is a container that selects among architecture-specific Mach-O slices.
The outer structure describes each slice with architecture identity, file offset, size, and alignment information. The slice itself is then parsed as an ordinary Mach-O image.
This gives you a clean two-stage parser:
- identify and parse the universal container;
- select a slice;
- parse that slice using the normal Mach-O parser.
Do not assume every slice is behaviorally identical. Source-level intent may be shared while compiler output, runtime calls, optimizations, pointer-authentication features, or architecture-specific assembly differ.
A useful comparison exercise is to analyze matching functions in x86_64 and arm64 slices and separate:
- semantic similarities;
- ABI differences;
- compiler/code-generation differences;
- architecture-specific security features.