This is the most common type of Mach-O files. It is composed of the following parts:
- Header: Contains general information about the file. Here is its structure according to the official source code:
struct mach_header {
unsigned long magic; /* mach magic number identifier */
cpu_type_t cputype; /* cpu specifier */
cpu_subtype_t cpusubtype; /* machine specifier */
unsigned long filetype; /* type of file */
unsigned long ncmds; /* number of load commands */
unsigned long sizeofcmds; /* the size of all the load commands */
unsigned long flags; /* flags */
};
The difference between 32-bit and 64-bit versions of this header is mainly in the extra reserved field added to the end of this structure, and the slightly different magic values used: 0xfeedface for 32-bit and 0xfeedfacf for 64-bit.
- Load commands: These can perform multiple actions, most importantly define the segments present in the file, where each block contains information about a particular...