OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
AppleMachoImage.h
Go to the documentation of this file.
1
13#ifndef APPLE_MACHO_IMAGE_H
14#define APPLE_MACHO_IMAGE_H
15
16#define MACH_CPU_ARCH_ABI64 BIT24
17#define MACH_CPU_ARCH_ABI64_32 BIT25
18
19//
20// Capability bits used in the definition of MACH_CPU_SUBTYPE.
21//
22#define MACH_CPU_SUBTYPE_MASK 0xFF000000U
23#define MACH_CPU_SUBTYPE_LIB64 BIT17
24
25#define MACH_CPU_SUBTYPE_INTEL_MODEL_SHIFT 4U
26#define MACH_CPU_SUBTYPE_INTEL_FAMILY_MAX 0x0FU
27#define MACH_CPU_SUBTYPE_INTEL_MODEL_ALL 0U
28
29#define MACH_CPU_SUBTYPE_INTEL(f, Model) \
30 ((f) + ((Model) << MACH_CPU_SUBTYPE_INTEL_MODEL_SHIFT))
31
32#define MACH_CPU_SUBTYPE_INTEL_FAMILY(Identifier) \
33 ((Identifier) & MACH_CPU_SUBTYPE_INTEL_FAMILY_MAX)
34
35#define MACH_CPU_SUBTYPE_INTEL_MODEL(Identifier) \
36 ((Identifier) >> MACH_CPU_SUBTYPE_INTEL_MODEL_SHIFT)
37
38#define FORMALIZE_CPU_SUBTYPE(CpuSubtype) ((CpuSubtype) & ~CPU_SUBTYPE_MASK)
39
40#define MACH_CPU_TYPE_64(CpuType) ((CpuType) | MACH_CPU_ARCH_ABI64)
41
42#define MACH_CPU_TYPE_64_32(CpuType) ((CpuType) | MACH_CPU_ARCH_ABI64_32)
43
49#if !defined (MACH_LITTLE_ENDIAN) && !defined (MACH_BIG_ENDIAN)
50 #if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
51#define MACH_LITTLE_ENDIAN
52 #endif
53#endif
54
58enum {
70
76 MachCpuTypeVeo = 255
77};
78
79typedef INT32 MACH_CPU_TYPE;
80
81enum {
83 //
84 // Any
85 //
89 //
90 // VAX Subtypes
91 //
105 //
106 // MC680 Subtypes
107 //
112 //
113 // x86 Subtypes
114 //
117 //
118 // x86_64 Subtypes
119 //
122 //
123 // i386 Subytpes
124 //
146 //
147 // Mips subtypes
148 //
157 //
158 // MC98000 Subtypes
159 //
162 //
163 // HPPA Subtypes
164 //
168 //
169 // ARM Subtypes
170 //
184 //
185 // ARM64 Subytypes
186 //
189 //
190 // ARM64_32 Subtypes
191 //
194 //
195 // MC88000 Subytpes
196 //
200 //
201 // SPARC Subtypes
202 //
204 //
205 // i860 Subtypes
206 //
209 //
210 // PowerPC Subtypes
211 //
225 //
226 // VEO Subtypes
227 //
234
235typedef INT32 MACH_CPU_SUBTYPE;
236
240enum {
242 //
243 // PowerPC Family
244 //
248 //
249 // Intel Family
250 //
266 //
267 // The following synonyms are deprecated:
268 //
275 //
276 // ARM Family
277 //
278 MachCpuFamilyArm9 = 0xE73283AE,
279 MachCpuFamilyArm11 = 0x8FF620D8,
281 MachCpuFamilyArm12 = 0xBD1B0AE9,
282 MachCpuFamilyArm13 = 0x0CC90E64,
283 MachCpuFamilyArm14 = 0x96077EF1,
284 MachCpuFamilyArm15 = 0xA8511BCA,
293};
294
295typedef UINT32 MACH_CPU_FAMILY;
297typedef INT32 MACH_VM_PROTECTION;
298
307typedef union {
308 UINT32 Offset;
309 UINT32 Address32;
311
323
352
353//
354// Mach Load Commands
355//
356
366#define MACH_LC_REQUIRE_DYLD BIT31
370#define MACH_LOAD_COMMAND_SEGMENT 1U
374#define MACH_LOAD_COMMAND_SYMTAB 2U
378#define MACH_LOAD_COMMAND_SYMSEG 3U
382#define MACH_LOAD_COMMAND_THREAD 4U
386#define MACH_LOAD_COMMAND_UNIX_THREAD 5U
390#define MACH_LOAD_COMMAND_LOAD_FIXED_VM_LIB 6U
394#define MACH_LOAD_COMMAND_IDENTIFICATION_VM_LIB 7U
398#define MACH_LOAD_COMMAND_IDENTIFICATION 8U
402#define MACH_LOAD_COMMAND_FIXED_VM_FILE 9U
406#define MACH_LOAD_COMMAND_PRE_PAGE 10U
410#define MACH_LOAD_COMMAND_DYSYMTAB 11U
414#define MACH_LOAD_COMMAND_LOAD_DYLIB 12U
418#define MACH_LOAD_COMMAND_IDENTITY_DYLIB 13U
422#define MACH_LOAD_COMMAND_LOAD_DYLD 14U
426#define MACH_LOAD_COMMAND_IDENTIFICATION_DYLD 15U
430#define MACH_LOAD_COMMAND_PREBOUNT_SYLIB 16U
434#define MACH_LOAD_COMMAND_ROUTINES 17U
438#define MACH_LOAD_COMMAND_SUB_FRAMEWORK 18U
442#define MACH_LOAD_COMMAND_SUB_UMBRELLA 19U
446#define MACH_LOAD_COMMAND_SUB_CLIENT 20U
450#define MACH_LOAD_COMMAND_SUB_LIBRARY 21U
454#define MACH_LOAD_COMMAND_TWO_LEVEL_HINTS 22U
458#define MACH_LOAD_COMMAND_PREBIND_CHECKSUM 23U
463#define MACH_LOAD_COMMAND_LLOAD_WEAK_DYLIB (24U | MACH_LC_REQUIRE_DYLD)
467#define MACH_LOAD_COMMAND_SEGMENT_64 25U
471#define MACH_LOAD_COMMAND_ROUTINES_64 26U
475#define MACH_LOAD_COMMAND_UUID 27U
479#define MACH_LOAD_COMMAND_RUN_PATH (28U | MACH_LC_REQUIRE_DYLD)
483#define MACH_LOAD_COMMAND_CODE_SIGNATURE 29U
487#define MACH_LOAD_COMMAND_SEGMENT_SPLIT_INFO 30U
491#define MACH_LOAD_COMMAND_REEXPORT_DYLIB (31U | MACH_LC_REQUIRE_DYLD)
495#define MACH_LOAD_COMMAND_LAZY_LOAD_DYLIB 32U
499#define MACH_LOAD_COMMAND_ENCRYPTION_INFO 33U
503#define MACH_LOAD_COMMAND_DYLD_INFO 34U
507#define MACH_LOAD_COMMAND_DYLD_INFO_ONLY (34U | MACH_LC_REQUIRE_DYLD)
511#define MACH_LOAD_COMMAND_LOAD_UPWARD_DYLIB (35U | MACH_LC_REQUIRE_DYLD)
515#define MACH_LOAD_COMMAND_VERSION_MIN_MAC_OS_X 36U
519#define MACH_LOAD_COMMAND_VERSION_MIN_IPHONE_OS 37U
523#define MACH_LOAD_COMMAND_FUNCTION_STARTS 38U
527#define MACH_LOAD_COMMAND_DYLD_ENVIRONMENT 39U
531#define MACH_LOAD_COMMAND_MAIN (40U | MACH_LC_REQUIRE_DYLD)
535#define MACH_LOAD_COMMAND_DATA_IN_CODE 41U
539#define MACH_LOAD_COMMAND_SOURCE_VERSION 42U
543#define MACH_LOAD_COMMAND_DYLIB_CODE_SIGN_DRS 43U
547#define MACH_LOAD_COMMAND_ENCRYPTION_INFO_64 44U
551#define MACH_LOAD_COMMAND_LINKER_OPTION 45U
555#define MACH_LOAD_COMMAND_LINKER_OPTIMIZATION_HINT 46U
559#define MACH_LOAD_COMMAND_VERSION_MIN_TV_OS 47U
563#define MACH_LOAD_COMMAND_VERSION_MIN_WATCH_OS 48U
567#define MACH_LOAD_COMMAND_NOTE 49U
571#define MACH_LOAD_COMMAND_BUILD_VERSION 50U
575#define MACH_LOAD_COMMAND_DYLD_EXPORTS_TRIE (51U | MACH_LC_REQUIRE_DYLD)
579#define MACH_LOAD_COMMAND_DYLD_CHAINED_FIXUPS (52U | MACH_LC_REQUIRE_DYLD)
583#define MACH_LOAD_COMMAND_FILESET_ENTRY (53U | MACH_LC_REQUIRE_DYLD)
584
586
587#define MACH_LOAD_COMMAND_HDR_ \
588 MACH_LOAD_COMMAND_TYPE CommandType; /* type of load command */ \
589 UINT32 CommandSize; /* total size of command in bytes
590 (includes sizeof section structs) */
592#define NEXT_MACH_LOAD_COMMAND(Command) \
593 ((MACH_LOAD_COMMAND *)((UINTN)(Command) + (Command)->CommandSize))
595typedef struct {
598
599//
600// Constants for the Flags field of the MACH_SEGMENT_COMMAND struct
601//
602
607#define MACH_SEGMENT_FLAG_HIGH_VIRTUAL_MEMORY BIT0
612#define MACH_SEGMENT_FLAG_FIXED_VM_LIB BIT1
617#define MACH_SEGMENT_FLAG_NO_RELOCATION BIT2
623#define MACH_SEGMENT_FLAG_PROTECTED_VERSION_1 BIT3
625#define MACH_SEGMENT_VM_PROT_NONE 0U
627#define MACH_SEGMENT_VM_PROT_READ BIT0
628#define MACH_SEGMENT_VM_PROT_WRITE BIT1
629#define MACH_SEGMENT_VM_PROT_EXECUTE BIT2
631typedef UINT32 MACH_SEGMENT_FLAGS;
632
636enum {
661
662 //
663 // For the two types of symbol pointers sections and the symbol stubs section
664 // they have indirect symbol table entries. For each of the entries in the
665 // section the indirect symbol table entries, in corresponding order in the
666 // indirect symbol table, start at the index stored in the reserved1 field
667 // of the section structure. Since the indirect symbol table entries
668 // correspond to the entries in the section the number of indirect symbol
669 // table entries is inferred from the size of the section divided by the size
670 // of the entries in the section. For symbol pointers sections the size of
671 // the entries in the section is 4 bytes and for symbol stubs sections the
672 // byte size of the stubs is stored in the reserved2 field of the section
673 // structure.
674 //
675
720
721 //
722 // Section types to support thread local variables
723 //
724
749};
750
751//
752// Constants for the section attributes part of the Flags field of a section
753// structure.
754//
755
759#define MACH_SECTION_ATTRIBUTES_SYSYTEM 0x00FFFF00U
763#define MACH_SECTION_ATTRIBUTES_USER 0xFF000000U
767#define MACH_SECTION_ATTRIBUTE_LOCAL_RELOCATION BIT8
771#define MACH_SECTION_ATTRIBUTE_EXTERNAL_RELOCATION BIT9
775#define MACH_SECTION_ATTRIBUTE_SOME_INSTRUCTIONS BIT10
776
777//
778// The flags field of a section structure is separated into two parts a section
779// type and section attributes.The section types are mutually exclusive (it
780// can only have one type) but the section attributes are not (it may have more
781// than one attribute).
783#define MACH_SECTION_TYPE_MASK 0x000000FFU
784#define MACH_SECTION_ATTRIBUTES_MASK 0xFFFFFF00U
785
796#define MACH_SECTION_ATTRIBUTE_DEBUG BIT25
800#define MACH_SECTION_ATTRIBUTE_SELF_MODIFYING_CODE BIT26
804#define MACH_SECTION_ATTRIBUTE_LIVE_SUPPORT BIT27
808#define MACH_SECTION_ATTRIBUTE_NO_DEAD_STRIP BIT28
813#define MACH_SECTION_ATTRIBUTE_STRIP_STATIC_SYMBOLS BIT29
818#define MACH_SECTION_ATTRIBUTE_NO_TOC BIT30
822#define MACH_SECTION_ATTRIBUTE_PURE_INSTRUCTIONS BIT31
823
855typedef struct {
856 CHAR8 SectionName[16];
857 CHAR8 SegmentName[16];
858 UINT32 Address;
859 UINT32 Size;
860 UINT32 Offset;
861 UINT32 Alignment;
862 UINT32 RelocationsOffset;
863 UINT32 NumRelocations;
864 UINT32 Flags;
865 UINT32 Reserved1;
866 UINT32 Reserved2;
868
872typedef struct {
873 CHAR8 SectionName[16];
874 CHAR8 SegmentName[16];
875 UINT64 Address;
876 UINT64 Size;
877 UINT32 Offset;
878 UINT32 Alignment;
879 UINT32 RelocationsOffset;
880 UINT32 NumRelocations;
881 UINT32 Flags;
882 UINT32 Reserved1;
883 UINT32 Reserved2;
884 UINT32 Reserved3;
887typedef union {
888 MACH_SECTION Section32;
889 MACH_SECTION_64 Section64;
892#define NEXT_MACH_SEGMENT(Segment) \
893 (MACH_SEGMENT_COMMAND *)((UINTN)(Segment) + (Segment)->Command.Size)
894
909typedef struct {
911 CHAR8 SegmentName[16];
912 UINT32 VirtualAddress;
913 UINT32 Size;
914 UINT32 FileOffset;
915 UINT32 FileSize;
916 MACH_VM_PROTECTION MaximumProtection;
917 MACH_VM_PROTECTION InitialProtection;
918 UINT32 NumSections;
920 MACH_SECTION Sections[];
923#define NEXT_MACH_SEGMENT_64(Segment) \
924 (MACH_SEGMENT_COMMAND_64 *)((UINTN)(Segment) + (Segment)->Hdr.Size)
925
934typedef struct {
936 CHAR8 SegmentName[16];
937 UINT64 VirtualAddress;
938 UINT64 Size;
939 UINT64 FileOffset;
940 UINT64 FileSize;
941 MACH_VM_PROTECTION MaximumProtection;
942 MACH_VM_PROTECTION InitialProtection;
943 UINT32 NumSections;
945 MACH_SECTION_64 Sections[];
948typedef union {
950 MACH_SEGMENT_COMMAND_64 Segment64;
952
960typedef struct {
962 MACH_FIXED_VM_LIB FixedVmLib;
964
972typedef struct {
974 MACH_DYLIB Dylib;
976
987typedef struct {
989 MACH_LOAD_COMMAND_STRING Umbrella;
991
1002typedef struct {
1006
1020typedef struct {
1022 MACH_LOAD_COMMAND_STRING SubUmbrella;
1024
1041typedef struct {
1043 MACH_LOAD_COMMAND_STRING SubLibrary;
1045
1055typedef struct {
1058 UINT32 NumModules;
1059 MACH_LOAD_COMMAND_STRING LinkedModules[];
1061
1070typedef struct {
1074
1075enum {
1089 //
1090 // 14 and 15 are used for the internal x86SavedState flavours.
1097 MachX86Avx512State = 21,
1098};
1099
1103#define MACH_X86_THREAD_STATE_MAX 614
1105typedef struct {
1106 UINT32 eax;
1107 UINT32 ebx;
1108 UINT32 ecx;
1109 UINT32 edx;
1110 UINT32 edi;
1111 UINT32 esi;
1112 UINT32 ebp;
1113 UINT32 esp;
1114 UINT32 ss;
1115 UINT32 eflags;
1116 UINT32 eip;
1117 UINT32 cs;
1118 UINT32 ds;
1119 UINT32 es;
1120 UINT32 fs;
1121 UINT32 gs;
1124typedef struct {
1125 UINT64 rax;
1126 UINT64 rbx;
1127 UINT64 rcx;
1128 UINT64 rdx;
1129 UINT64 rdi;
1130 UINT64 rsi;
1131 UINT64 rbp;
1132 UINT64 rsp;
1133 UINT64 r8;
1134 UINT64 r9;
1135 UINT64 r10;
1136 UINT64 r11;
1137 UINT64 r12;
1138 UINT64 r13;
1139 UINT64 r14;
1140 UINT64 r15;
1141 UINT64 rip;
1142 UINT64 rflags;
1143 UINT64 cs;
1144 UINT64 fs;
1145 UINT64 gs;
1148typedef union {
1152
1159#define MACH_VALID_THREAD_STATE_FLAVOR(Flavor) \
1160 (((Flavor) == MachX86ThreadState32) \
1161 || ((Flavor) == MachX86FloatState32) \
1162 || ((Flavor) == MachX86ExceptionState32) \
1163 || ((Flavor) == MachX86DebugState32) \
1164 || ((Flavor) == MachX86ThreadState64) \
1165 || ((Flavor) == MachX86FloatState64) \
1166 || ((Flavor) == MachX86ExceptionState64) \
1167 || ((Flavor) == MachX86DebugState64) \
1168 || ((Flavor) == MachX86ThreadState) \
1169 || ((Flavor) == MachX86FloatState) \
1170 || ((Flavor) == MachX86ExceptionState) \
1171 || ((Flavor) == MachX86DebugState) \
1172 || ((Flavor) == MachX86AvxState32) \
1173 || ((Flavor) == MachX86AvxState64) \
1174 || ((Flavor) == MachX86AvxState) \
1175 || ((Flavor) == MachX86Avx512State32) \
1176 || ((Flavor) == MachX86Avx512State64) \
1177 || ((Flavor) == MachX86Avx512State) \
1178 || ((Flavor) == MachThreadStateNone))
1179
1202typedef struct {
1204 UINT32 Flavor;
1205 UINT32 NumThreadStates;
1206 UINT32 ThreadState[];
1208
1218typedef struct {
1223 UINT32 InitRoutineAddress;
1227 UINT32 InitModuleIndex;
1231 UINT32 Reserved4;
1232 UINT32 Reserved5;
1233 UINT32 Reserved6;
1235
1239typedef struct {
1244 UINT64 InitiRoutineAddress;
1248 UINT64 InitModuleIndex;
1252 UINT64 Reserved4;
1253 UINT64 Reserved5;
1254 UINT64 Reserved6;
1256
1262typedef struct {
1264 UINT32 SymbolsOffset;
1265 UINT32 NumSymbols;
1266 UINT32 StringsOffset;
1267 UINT32 StringsSize;
1269
1310typedef struct {
1312
1313 //
1314 // The symbols indicated by symoff and nsyms of the LC_SYMTAB load command
1315 // are grouped into the following three groups:
1316 // local symbols (further grouped by the module they are from)
1317 // defined external symbols (further grouped by the module they are from)
1318 // undefined symbols
1319 //
1320 // The local symbols are used only for debugging. The dynamic binding
1321 // process may have to use them to indicate to the debugger the local
1322 // symbols for a module that is being bound.
1323 //
1324 // The last two groups are used by the dynamic binding process to do the
1325 // binding (indirectly through the module table and the reference symbol
1326 // table when this is a dynamically linked shared library file).
1327 //
1329 UINT32 LocalSymbolsIndex;
1330 UINT32 NumLocalSymbols;
1332 UINT32 ExternalSymbolsIndex;
1333 UINT32 NumExternalSymbols;
1335 UINT32 UndefinedSymbolsIndex;
1336 UINT32 NumUndefinedSymbols;
1337
1338 //
1339 // For the for the dynamic binding process to find which module a symbol
1340 // is defined in the table of contents is used (analogous to the ranlib
1341 // structure in an archive) which maps defined external symbols to modules
1342 // they are defined in. This exists only in a dynamically linked shared
1343 // library file. For executable and object modules the defined external
1344 // symbols are sorted by name and is use as the table of contents.
1345 //
1346
1350 UINT32 TableOfContentsFileOffset;
1354 UINT32 TableOfContentsNumEntries;
1355
1356 //
1357 // To support dynamic binding of "modules" (whole object files) the symbol
1358 // table must reflect the modules that the file was created from. This is
1359 // done by having a module table that has indexes and counts into the merged
1360 // tables for each module. The module structure that these two entries
1361 // refer to is described below. This exists only in a dynamically linked
1362 // shared library file. For executable and object modules the file only
1363 // contains one module so everything in the file belongs to the module.
1364 //
1366 UINT32 ModuleTableFileOffset;
1367 UINT32 ModuleTableNumEntries;
1368
1369 //
1370 // To support dynamic module binding the module structure for each module
1371 // indicates the external references (defined and undefined) each module
1372 // makes. For each module there is an offset and a count into the
1373 // reference symbol table for the symbols that the module references.
1374 // This exists only in a dynamically linked shared library file. For
1375 // executable and object modules the defined external symbols and the
1376 // undefined external symbols indicates the external references.
1377 //
1378
1382 UINT32 ReferencedSymbolTableFileOffset;
1386 UINT32 ReferencedSymbolTableNumEntries;
1387
1388 //
1389 // The sections that contain "symbol pointers" and "routine stubs" have
1390 // indexes and (implied counts based on the size of the section and fixed
1391 // size of the entry) into the "indirect symbol" table for each pointer
1392 // and stub. For every section of these two types the index into the
1393 // indirect symbol table is stored in the section header in the field
1394 // reserved1. An indirect symbol table entry is simply a 32bit index into
1395 // the symbol table to the symbol that the pointer or stub is referring to.
1396 // The indirect symbol table is ordered to match the entries in the section.
1397 //
1398
1402 UINT32 IndirectSymbolsOffset;
1406 UINT32 NumIndirectSymbols;
1407
1408 //
1409 // To support relocating an individual module in a library file quickly the
1410 // external relocation entries for each module in the library need to be
1411 // accessed efficiently. Since the relocation entries can't be accessed
1412 // through the section headers for a library file they are separated into
1413 // groups of local and external entries further grouped by module. In this
1414 // case the presents of this load command who's extreloff, nextrel,
1415 // locreloff and nlocrel fields are non-zero indicates that the relocation
1416 // entries of non-merged sections are not referenced through the section
1417 // structures (and the reloff and nreloc fields in the section headers are
1418 // set to zero).
1419 //
1420 // Since the relocation entries are not accessed through the section headers
1421 // this requires the r_address field to be something other than a section
1422 // offset to identify the item to be relocated. In this case r_address is
1423 // set to the offset from the vmaddr of the first LC_SEGMENT command.
1424 // For MH_SPLIT_SEGS images r_address is set to the the offset from the
1425 // vmaddr of the first read-write LC_SEGMENT command.
1426 //
1427 // The relocation entries are grouped by module and the module table
1428 // entries have indexes and counts into them for the group of external
1429 // relocation entries for that the module.
1430 //
1431 // For sections that are merged across modules there must not be any
1432 // remaining external relocation entries for them (for merged sections
1433 // remaining relocation entries must be local).
1434 //
1435
1439 UINT32 ExternalRelocationsOffset;
1443 UINT32 NumExternalRelocations;
1444
1445 //
1446 // All the local relocation entries are grouped together (they are not
1447 // grouped by their module since they are only used if the object is moved
1448 // from it staticly link edited address).
1449 //
1451 UINT32 LocalRelocationsOffset;
1452 UINT32 NumOfLocalRelocations;
1454
1455//
1456// An indirect symbol table entry is simply a 32bit index into the symbol table
1457// to the symbol that the pointer or stub is refering to. Unless it is for a
1458// non-lazy symbol pointer section for a defined symbol which strip(1) as
1459// removed. In which case it has the value INDIRECT_SYMBOL_LOCAL. If the
1460// symbol was also absolute INDIRECT_SYMBOL_ABS is or'ed with that.
1462#define MACH_INDIRECT_SYMBOL_LOCAL 0x80000000U
1463#define MACH_INDIRECT_SYMBOL_ABS 0x40000000U
1464
1481typedef struct {
1482 UINT32 SubImagesIndex : 8;
1483 UINT32 TableOfContentsIndex : 24;
1485
1490typedef struct {
1492 UINT32 Offset;
1493 UINT32 NumHints;
1494 TWOLEVEL_HINT Hints[];
1496
1507typedef struct {
1509 UINT32 Checksum;
1511
1516typedef struct {
1518 UINT8 Uuid[16];
1520
1525typedef struct {
1529
1534typedef struct {
1536 UINT32 DataOffset;
1537 UINT32 DataSize;
1539
1544typedef struct {
1549 UINT32 CryptOffset;
1553 UINT32 CryptSize;
1557 UINT32 CryptId;
1559
1564typedef struct {
1569 UINT32 CryptOffset;
1573 UINT32 CryptSize;
1577 UINT32 CryptId;
1581 UINT32 Pad;
1583
1588typedef struct {
1590 UINT32 Version;
1591 UINT32 SdkVersion;
1593
1597typedef struct {
1598 UINT32 Tool;
1599 UINT32 Version;
1601
1607typedef struct {
1609 UINT32 Platform;
1610 UINT32 MinOs;
1611 UINT32 SdkVersion;
1612 UINT32 NumTools;
1615
1619#define MACH_PLATFORM_MACOS 1U
1620#define MACH_PLATFORM_IOS 2U
1621#define MACH_PLATFORM_TVOS 3U
1622#define MACH_PLATFORM_WATCHOS 4U
1623#define MACH_PLATFORM_BRIDGEOS 5U
1624#define MACH_PLATFORM_MACCATALYST 6U
1625#define MACH_PLATFORM_IOSSIMULATOR 7U
1626#define MACH_PLATFORM_TVOSSIMULATOR 8U
1627#define MACH_PLATFORM_WATCHOSSIMULATOR 9U
1628#define MACH_PLATFORM_DRIVERKIT 10U
1629
1633#define MACH_TOOL_CLANG 1U
1634#define MACH_TOOL_SWIFT 2U
1635#define MACH_TOOL_LD 3U
1636
1645typedef struct {
1647 //
1648 // Dyld rebases an image whenever dyld loads it at an address different
1649 // from its preferred address. The rebase information is a stream
1650 // of byte sized opcodes whose symbolic names start with REBASE_OPCODE_.
1651 // Conceptually the rebase information is a table of tuples:
1652 // <seg-index, seg-offset, type>
1653 // The opcodes are a compressed way to encode the table by only
1654 // encoding when a column changes. In addition simple patterns
1655 // like "every n'th offset for m times" can be encoded in a few
1656 // bytes.
1658 UINT32 RebaseOffset;
1659 UINT32 RebaseSize;
1660 //
1661 // Dyld binds an image during the loading process, if the image
1662 // requires any pointers to be initialized to symbols in other images.
1663 // The bind information is a stream of byte sized
1664 // opcodes whose symbolic names start with BIND_OPCODE_.
1665 // Conceptually the bind information is a table of tuples:
1666 // <seg-index, seg-offset, type, symbol-library-ordinal, symbol-name,
1667 // addend>
1668 // The opcodes are a compressed way to encode the table by only
1669 // encoding when a column changes. In addition simple patterns
1670 // like for runs of pointers initialzed to the same value can be
1671 // encoded in a few bytes.
1673 UINT32 BindingInfoOffset;
1674 UINT32 BindingInfoSize;
1675 //
1676 // Some C++ programs require dyld to unique symbols so that all
1677 // images in the process use the same copy of some code/data.
1678 // This step is done after binding. The content of the weak_bind
1679 // info is an opcode stream like the bind_info. But it is sorted
1680 // alphabetically by symbol name. This enable dyld to walk
1681 // all images with weak binding information in order and look
1682 // for collisions. If there are no collisions, dyld does
1683 // no updating. That means that some fixups are also encoded
1684 // in the bind_info. For instance, all calls to "operator new"
1685 // are first bound to libstdc++.dylib using the information
1686 // in bind_info. Then if some image overrides operator new
1687 // that is detected when the weak_bind information is processed
1688 // and the call to operator new is then rebound.
1690 UINT32 WeakBindingInfoOffset;
1691 UINT32 WeakBindingInfoSize;
1692 //
1693 // Some uses of external symbols do not need to be bound immediately.
1694 // Instead they can be lazily bound on first use. The lazy_bind
1695 // are contains a stream of BIND opcodes to bind all lazy symbols.
1696 // Normal use is that dyld ignores the lazy_bind section when
1697 // loading an image. Instead the static linker arranged for the
1698 // lazy pointer to initially point to a helper function which
1699 // pushes the offset into the lazy_bind area for the symbol
1700 // needing to be bound, then jumps to dyld which simply adds
1701 // the offset to lazy_bind_off to get the information on what
1702 // to bind.
1704 UINT32 LazyBindingInfoOffset;
1705 UINT32 LazyBindingInfoSize;
1706 //
1707 // The symbols exported by a dylib are encoded in a trie. This
1708 // is a compact representation that factors out common prefixes.
1709 // It also reduces LINKEDIT pages in RAM because it encodes all
1710 // information (name, address, flags) in one small, contiguous range.
1711 // The export area is a stream of nodes. The first node sequentially
1712 // is the start node for the trie.
1713 //
1714 // Nodes for a symbol start with a uleb128 that is the length of
1715 // the exported symbol information for the string so far.
1716 // If there is no exported symbol, the node starts with a zero byte.
1717 // If there is exported info, it follows the length.
1718 //
1719 // First is a uleb128 containing flags. Normally, it is followed by
1720 // a uleb128 encoded offset which is location of the content named
1721 // by the symbol from the mach_header for the image. If the flags
1722 // is EXPORT_SYMBOL_FLAGS_REEXPORT, then following the flags is
1723 // a uleb128 encoded library ordinal, then a zero terminated
1724 // UTF8 string. If the string is zero length, then the symbol
1725 // is re-export from the specified dylib with the same name.
1726 // If the flags is EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER, then following
1727 // the flags is two uleb128s: the stub offset and the resolver offset.
1728 // The stub is used by non-lazy pointers. The resolver is used
1729 // by lazy pointers and must be called to get the actual address to use.
1730 //
1731 // After the optional exported symbol information is a byte of
1732 // how many edges (0-255) that this node has leaving it,
1733 // followed by each edge.
1734 // Each edge is a zero terminated UTF8 of the addition chars
1735 // in the symbol, followed by a uleb128 offset for the node that
1736 // edge points to.
1738 UINT32 ExportSymbolsOffset;
1739 UINT32 ExportSymbolsSize;
1741
1745typedef struct {
1747 UINT32 NumStrings;
1752 CHAR8 Strings[];
1754
1764typedef struct {
1766 UINT32 Offset;
1767 UINT32 Size;
1769
1776typedef struct {
1778 CHAR8 Strings[];
1780
1787typedef struct {
1790 UINT32 HeaderAddress;
1792
1799typedef struct {
1801 UINT64 VirtualAddress;
1802 UINT64 FileOffset;
1804 UINT32 Reserved;
1805 CHAR8 Payload[];
1807
1811typedef struct {
1812 UINT64 Target : 30,
1813 CacheLevel : 2,
1814 Diversity : 16,
1815 AddrDiv : 1,
1816 Key : 2,
1817 Next : 12,
1818 IsAuth : 1;
1820
1821// header of the LC_DYLD_CHAINED_FIXUPS payload
1822typedef struct {
1823 UINT32 FixupsVersion;
1824 UINT32 StartsOffset;
1825 UINT32 ImportsOffset;
1826 UINT32 SymbolsOffset;
1827 UINT32 ImportsCount;
1828 UINT32 ImportsFormat;
1829 UINT32 SymbolsFormat;
1831
1835typedef struct {
1836 UINT32 NumSegments;
1837 UINT32 SegInfoOffset[];
1842typedef struct {
1843 UINT32 Size;
1844 UINT16 PageSize;
1845 UINT16 PointerFormat;
1846 UINT64 SegmentOffset;
1847 UINT32 MaxValidPointer;
1848 UINT16 PageCount;
1849 UINT16 PageStart[];
1851 // UINT16 ChainStarts[]; ///< some 32-bit formats may require multiple starts per page.
1856
1860enum {
1874};
1875
1876enum {
1880};
1881
1888typedef struct {
1890 UINT64 EntryOffset;
1891 UINT64 StackSize;
1894#define MACH_SOURCE_VERSION_A_MASK 0xFFFFFF0000000000U
1895#define MACH_SOURCE_VERSION_B_MASK 0x000000FFC0000000U
1896#define MACH_SOURCE_VERSION_V_MASK 0x000000003FF00000U
1897#define MACH_SOURCE_VERSION_D_MASK 0x00000000000FFC00U
1898#define MACH_SOURCE_VERSION_E_MASK 0x00000000000003FFU
1900#define MACH_SOURCE_VERSION_A(Version) (((Version) & MACH_SOURCE_VERSION_A_MASK) >> 40U)
1901#define MACH_SOURCE_VERSION_B(Version) (((Version) & MACH_SOURCE_VERSION_B_MASK) >> 30U)
1902#define MACH_SOURCE_VERSION_C(Version) (((Version) & MACH_SOURCE_VERSION_V_MASK) >> 20U)
1903#define MACH_SOURCE_VERSION_D(Version) (((Version) & MACH_SOURCE_VERSION_D_MASK) >> 10U)
1904#define MACH_SOURCE_VERSION_E(Version) ((Version) & MACH_SOURCE_VERSION_E_MASK)
1905
1910typedef struct {
1912 UINT64 Version;
1952
1953#undef MACH_LOAD_COMMAND_HDR_
1954
1978enum {
1990 //
1991 // A file composed of other Mach-Os to be run in the same userspace sharing
1992 // a single linkedit. Used by 11.0 kernelcache.
1995};
1997typedef UINT32 MACH_HEADER_FILE_TYPE;
1998
1999//
2000// Constants for the Flags field of the MACH_HEADER struct
2002#define MACH_HEADER_FLAG_NO_UNDEFINED_REFERENCES BIT0
2003#define MACH_HEADER_FLAG_INCREMENTAL_LINK BIT1
2004#define MACH_HEADER_FLAG_DYNAMIC_LINKER_LINK BIT2
2005#define MACH_HEADER_FLAG_BINARY_DATA_LOAD BIT3
2006#define MACH_HEADER_FLAG_PREBOUND BIT4
2007#define MACH_HEADER_FLAG_SPLIT_SEGMENTS BIT5
2008#define MACH_HEADER_FLAG_LAZY_INITIALIZATION BIT6
2009#define MACH_HEADER_FLAG_TWO_LEVEL BIT7
2010#define MACH_HEADER_FLAG_FORCE_FLAT BIT8
2011#define MACH_HEADER_FLAG_NO_MULTIPLE_DEFINITIONS BIT9
2012#define MACH_HEADER_FLAG_NO_FIX_PREBINDING BIT10
2013#define MACH_HEADER_FLAG_PREBINDABLE BIT11
2014#define MACH_HEADER_FLAG_ALL_MODULES_BOUND BIT12
2015#define MACH_HEADER_FLAG_SUBSECTIONS_VIA_SYNBOLS BIT13
2016#define MACH_HEADER_FLAG_CANONICAL BIT14
2017#define MACH_HEADER_FLAG_WEAK_DEFINES BIT15
2018#define MACH_HEADER_FLAG_BINDS_TO_WEAK BIT16
2019#define MACH_HEADER_FLAG_ALLOW_STACK_EXECUTION BIT17
2020#define MACH_HEADER_FLAG_ROOT_SAFE BIT18
2021#define MACH_HEADER_FLAG_SET_UID_SAFE BIT19
2022#define MACH_HEADER_FLAG_NO_REEXPORTED_DYLIBS BIT20
2023#define MACH_HEADER_FLAG_POSITION_INDEPENDENT_EXECUTABLE BIT21
2024#define MACH_HEADER_FLAG_DEAD_STRIPPABLE_DYLIB BIT22
2025#define MACH_HEADER_FLAG_HAS_TLV_DESCRIPTORS BIT23
2026#define MACH_HEADER_FLAG_NO_HEAP_EXECUTION BIT24
2027#define MACH_HEADER_FLAG_APP_EXTENSION_SAFE BIT25
2028#define MACH_HEADER_FLAG_NLIST_OUTOFSYNC_WITH_DYLDINFO BIT26
2029#define MACH_HEADER_FLAG_SIM_SUPPORT BIT27
2030#define MACH_HEADER_FLAG_DYLIB_IN_CACHE BIT31
2032typedef UINT32 MACH_HEADER_FLAGS;
2033
2034//
2035// Constant for the magic field of the MACH_HEADER (32-bit architectures)
2037#define MACH_HEADER_SIGNATURE 0xFEEDFACE
2038#define MACH_HEADER_INVERT_SIGNATURE 0xCEFAEDFE
2039
2044typedef struct {
2045 UINT32 Signature;
2047 MACH_CPU_SUBTYPE CpuSubtype;
2049 UINT32 NumCommands;
2050 UINT32 CommandsSize;
2052 MACH_LOAD_COMMAND Commands[];
2053} MACH_HEADER;
2054
2055//
2056// Constant for the magic field of the MACH_HEADER_64 (64-bit architectures)
2058#define MACH_HEADER_64_SIGNATURE 0xFEEDFACF
2059#define MACH_HEADER_64_INVERT_SIGNATURE 0xCFFAEDFE
2060
2065typedef struct {
2066 UINT32 Signature;
2068 MACH_CPU_SUBTYPE CpuSubtype;
2070 UINT32 NumCommands;
2071 UINT32 CommandsSize;
2073 UINT32 Reserved;
2074 MACH_LOAD_COMMAND Commands[];
2076
2080typedef union {
2082 MACH_HEADER Header32;
2083 MACH_HEADER_64 Header64;
2085
2086//
2087// Symbols
2088//
2089
2098typedef struct {
2099 union {
2100 UINT32 Address32;
2101 UINT32 StringIndex;
2102 } UnifiedName;
2103 UINT8 Type;
2104 UINT8 Section;
2105 INT16 Descriptor;
2106 UINT32 Value;
2107} MACH_NLIST;
2108
2112typedef struct {
2113 union {
2114 UINT32 StringIndex;
2115 } UnifiedName;
2116 UINT8 Type;
2117 UINT8 Section;
2118 UINT16 Descriptor;
2119 UINT64 Value;
2122typedef union {
2123 MACH_NLIST Symbol32;
2124 MACH_NLIST_64 Symbol64;
2126
2127//
2128// Symbols with a index into the string table of zero (n_un.n_strx == 0) are
2129// defined to have a null, "", name. Therefore all string indexes to non null
2130// names must not have a zero string index. This is bit historical information
2131// that has never been well documented.
2132//
2133
2134//
2135// The n_type field really contains four fields:
2136// unsigned char N_STAB:3,
2137// N_PEXT:1,
2138// N_TYPE:3,
2139// N_EXT:1;
2140// which are used via the following masks.
2142#define MACH_N_TYPE_STAB 0xE0U
2144#define MACH_N_TYPE_PEXT 0x10U
2145#define MACH_N_TYPE_TYPE 0x0EU
2146#define MACH_N_TYPE_EXT 0x01U
2148
2149//
2150// Only symbolic debugging entries have some of the N_STAB bits set and if any
2151// of these bits are set then it is a symbolic debugging entry (a stab). In
2152// which case then the values of the n_type field (the entire field) are given
2153// in <mach-o/stab.h>
2154//
2155
2156//
2157// Values for N_TYPE bits of the n_type field.
2159#define MACH_N_TYPE_UNDF 0x0U
2160#define MACH_N_TYPE_ABS 0x2U
2161#define MACH_N_TYPE_SECT 0xEU
2162#define MACH_N_TYPE_PBUD 0xCU
2163#define MACH_N_TYPE_INDR 0xAU
2164
2165//
2166// If the type is N_INDR then the symbol is defined to be the same as another
2167// symbol. In this case the n_value field is an index into the string table
2168// of the other symbol's name. When the other symbol is defined then they both
2169// take on the defined type and value.
2170//
2171
2172//
2173// If the type is N_SECT then the n_sect field contains an ordinal of the
2174// section the symbol is defined in. The sections are numbered from 1 and
2175// refer to sections in order they appear in the load commands for the file
2176// they are in. This means the same ordinal may very well refer to different
2177// sections in different files.
2178//
2179// The n_value field for all symbol table entries (including N_STAB's) gets
2180// updated by the link editor based on the value of its n_sect field and where
2181// the section n_sect references gets relocated. If the value of the n_sect
2182// field is NO_SECT then its n_value field is not changed by the link editor.
2184#define NO_SECT 0
2185#define MAX_SECT 255
2186
2187//
2188// STAB
2189//
2190
2191//
2192// Symbolic debugger symbols. The comments give the conventional use for
2193//
2194// .stabs "n_name", n_type, n_sect, n_desc, n_value
2195//
2196// where n_type is the defined constant and not listed in the comment. Other
2197// fields not listed are zero. n_sect is the section ordinal the entry is
2198// refering to.
2200#define MACH_N_GSYM 0x20U
2201#define MACH_N_FNAME 0x22U
2202#define MACH_N_FUN 0x24U
2203#define MACH_N_STSYM 0x26U
2204#define MACH_N_LCSYM 0x28U
2205#define MACH_N_BNSYM 0x2EU
2206#define MACH_N_AST 0x32U
2207#define MACH_N_OPT 0x3CU
2208#define MACH_N_RSYM 0x40U
2209#define MACH_N_SLINE 0x44U
2210#define MACH_N_ENSYM 0x4EU
2211#define MACH_N_SSYM 0x60U
2212#define MACH_N_SO 0x64U
2213#define MACH_N_OSO 0x66U
2214#define MACH_N_LSYM 0x80U
2215#define MACH_N_BINCL 0x82U
2216#define MACH_N_SOL 0x84U
2217#define MACH_N_PARAMS 0x86U
2218#define MACH_N_VERSION 0x88U
2219#define MACH_N_OLEVEL 0x8AU
2220#define MACH_N_PSYM 0xA0U
2221#define MACH_N_EINCL 0xA2U
2222#define MACH_N_ENTRY 0xA4U
2223#define MACH_N_LBRAC 0xC0U
2224#define MACH_N_EXCL 0xC2U
2225#define MACH_N_RBRAC 0xE0U
2226#define MACH_N_BCOMM 0xE2U
2227#define MACH_N_ECOMM 0xE4U
2228#define MACH_N_ECOML 0xE8U
2229#define MACH_N_LENG 0xFEU
2230
2231//
2232// The bit 0x0020 of the n_desc field is used for two non-overlapping purposes
2233// and has two different symbolic names, N_NO_DEAD_STRIP and N_DESC_DISCARDED.
2234//
2235
2241#define MACH_N_NO_DEAD_STRIP 0x0020U
2247#define MACH_N_DESC_DISCARDED 0x0020U
2253#define MACH_N_WEAK_REF 0x0040U
2260#define MACH_N_WEAK_DEF 0x0080U
2266#define MACH_N_REF_TO_WEAK 0x0080U
2271#define MACH_N_ARM_THUMB_DEF 0x0008U
2278#define MACH_N_SYMBOL_RESOLVER 0x0100U
2283#define MACH_N_ALT_ENTRY 0x0200U
2288#define MACH_N_PC 0x30U
2289
2290//
2291// Relocations
2292//
2293
2302typedef struct {
2303 INT32 Address;
2305 UINT32 SymbolNumber : 24;
2307 UINT32 PcRelative : 1;
2308 UINT32 Size : 2;
2309 UINT32 Extern : 1;
2310 UINT32 Type : 4;
2313#define MACH_RELOC_ABSOLUTE 0U
2314
2315//
2316// The r_address is not really the address as its name indicates but an
2317// offset. In 4.3BSD a.out objects this offset is from the start of the
2318// "segment" for which relocation entry is for (text or data). For Mach-O
2319// object files it is also an offset but from the start of the "section" for
2320// which the relocation entry is for. See comments in <mach-o/loader.h> about
2321// the r_address field in images for used with the dynamic linker.
2322//
2323// In 4.3BSD a.out objects if r_extern is zero then r_symbolnum is an ordinal
2324// for the segment the symbol being relocated is in. These ordinals are the
2325// symbol types N_TEXT, N_DATA, N_BSS or N_ABS. In Mach-O object files these
2326// ordinals refer to the sections in the object file in the order their section
2327// structures appear in the headers of the object file they are in. The first
2328// section has the ordinal 1, the second 2, and so on. This means that the
2329// same ordinal in two different object files could refer to two different
2330// sections. And further could have still different ordinals when combined
2331// by the link-editor. The value MACH_RELOC_ABSOLUTE is used for relocation entries for
2332// absolute symbols which need no further relocation.
2333//
2334
2335//
2336// For RISC machines some of the references are split across two instructions
2337// and the instruction does not contain the complete value of the reference.
2338// In these cases a second, or paired relocation entry, follows each of these
2339// relocation entries, using a PAIR r_type, which contains the other part of
2340// the reference not contained in the instruction. This other part is stored
2341// in the pair's r_address field. The exact number of bits of the other part
2342// of the reference store in the r_address field is dependent on the particular
2343// relocation type for the particular architecture.
2344//
2345
2380#define MACH_RELOC_SCATTERED 0x80000000U
2382typedef struct {
2383 #if defined (MACH_LITTLE_ENDIAN)
2384 UINT32 Address : 24;
2386 UINT32 Type : 4;
2387 UINT32 Size : 2;
2388 UINT32 PcRelative : 1;
2389 UINT32 Scattered : 1;
2390 INT32 Value;
2392 #elif defined (MACH_BIG_ENDIAN)
2393 UINT32 Scattered : 1;
2394 UINT32 PcRelative : 1;
2395 UINT32 Size : 2;
2396 UINT32 Type : 4;
2397 UINT32 Address : 24;
2399 INT32 Value;
2401 #else
2409 #error "No endianness information was provided!"
2410 #endif
2412
2432enum {
2441};
2442
2592enum {
2608};
2609
2610#endif // APPLE_MACHO_IMAGE_H
UINT32 Reserved2[32]
Definition Apm.h:80
UINT16 Reserved1
Definition Apm.h:63
UINT32 Reserved3[62]
Definition Apm.h:81
UINT8 Reserved[430]
Definition Apm.h:39
GUID Uuid
#define MACH_CPU_TYPE_64(CpuType)
INT32 MACH_CPU_THREADTYPE
UINT32 MACH_HEADER_FLAGS
#define MACH_CPU_TYPE_64_32(CpuType)
#define MACH_LOAD_COMMAND_HDR_
@ MachX86ExceptionState
@ MachX86AvxState64
@ MachX86FloatState64
@ MachX86DebugState
@ MachX86Avx512State
@ MachX86FloatState32
@ MachThreadStateNone
@ MachX86Avx512State64
@ MachX86AvxState32
@ MachX86ExceptionState32
@ MachX86Avx512State32
@ MachX86ExceptionState64
@ MachX86FloatState
@ MachX86ThreadState
@ MachX86ThreadState64
@ MachX86ThreadState32
@ MachX86AvxState
@ MachX86DebugState32
@ MachX86DebugState64
UINT32 MACH_HEADER_FILE_TYPE
INT32 MACH_VM_PROTECTION
UINT32 MACH_SEGMENT_FLAGS
@ MachCpuTypeI860
@ MachCpuTypeMc680x0
@ MachCpuTypeI386
@ MachCpuTypeVax
@ MachCpuTypeHppa
@ MachCpuTypePowerPc64
@ MachCpuTypeVeo
@ MachCpuTypeArm
@ MachCpuTypeArm64
@ MachCpuTypePowerPc
@ MachCpuTypeAny
@ MachCpuTypeX8664
@ MachCpuTypeX86
@ MachCpuTypeSparc
@ MachCpuTypeMc98000
@ MachCpuTypeArm6432
@ MachCpuTypeMc88000
#define MACH_CPU_SUBTYPE_INTEL(f, Model)
@ MachGenericRelocSectDiff
@ MachGenericRelocVanilla
@ MachGenericRelocThreadLocalVariables
thread local variables
@ MachGenericRelocLocalSectDiff
@ MachGenericRelocPreboundLazyPointer
prebound lazy pointer
@ MachGenericRelocPair
INT32 MACH_CPU_TYPE
@ MACH_DYLD_CHAINED_PTR_START_MULTI
used in page_start[] to denote a page which has multiple starts
@ MACH_DYLD_CHAINED_PTR_START_NONE
used in page_start[] to denote a page with no fixups
@ MACH_DYLD_CHAINED_PTR_START_LAST
used in chain_starts[] to denote last start in list for page
@ MachX8664RelocUnsigned
for absolute addresses
@ MachX8664RelocBranch
@ MachX8664RelocGotLoad
a MOVQ load of a GOT entry
@ MachX8664RelocSigned
for signed 32-bit displacement
@ MachX8664RelocSigned4
@ MachX8664RelocSigned1
@ MachX8664RelocSigned2
@ MachX8664RelocThreadLocalVariable
for thread local variables
@ MachX8664RelocSubtractor
@ MachX8664RelocGot
other GOT references
@ MachSectionType4ByteLiterals
@ MachSectionTypeGigabyteZeroFill
@ MachSectionTypeModTerminateFunctionPointers
@ MachSectionTypeThreadLocalRegular
@ MachSectionTypeThreadVariablePointers
@ MachSectionTypeNonLazySymbolPointers
@ MachSectionTypeCoalesced
@ MachSectionTypeDtraceObjectFormat
@ MachSectionTypeInterposing
@ MachSectionTypeModInitalizeFunctionPointers
@ MachSectionTypeThreadLocalInitializeFunctionOffsets
@ MachSectionType16ByteLiterals
@ MachSectionTypeThreadLocalInitializeFunctionPointers
@ MachSectionTypeRegular
@ MachSectionType8ByteLiterals
@ MachSectionTypeLazySymbolPointers
@ MachSectionTypeZeroFill
@ MachSectionTypeSymbolStubs
@ MachSectionTypeThreadLocalVariables
@ MachSectionTypeCStringLiterals
@ MachSectionTypeLiteralPointers
@ MachSectionTypeThreadLocalZeroFill
@ MachSectionTypeLazyDylibSymbolPointers
@ MACH_DYLD_CHAINED_PTR_ARM64E_OFFSET
old name
@ MACH_DYLD_CHAINED_PTR_32_FIRMWARE
@ MACH_DYLD_CHAINED_PTR_ARM64E_KERNEL
stride 4, unauth target is vm offset
@ MACH_DYLD_CHAINED_PTR_32_CACHE
@ MACH_DYLD_CHAINED_PTR_ARM64E_FIRMWARE
stride 4, unauth target is vmaddr
@ MACH_DYLD_CHAINED_PTR_ARM64E_USERLAND
stride 8, unauth target is vm offset
@ MACH_DYLD_CHAINED_PTR_64
target is vmaddr
@ MACH_DYLD_CHAINED_PTR_32
@ MACH_DYLD_CHAINED_PTR_ARM64E_USERLAND24
stride 8, unauth target is vm offset, 24-bit bind
@ MACH_DYLD_CHAINED_PTR_ARM64E
stride 8, unauth target is vmaddr
@ MACH_DYLD_CHAINED_PTR_64_OFFSET
target is vm offset
@ MACH_DYLD_CHAINED_PTR_64_KERNEL_CACHE
@ MACH_DYLD_CHAINED_PTR_X86_64_KERNEL_CACHE
stride 1, x86_64 kernel caches
UINT32 MACH_LOAD_COMMAND_TYPE
@ MachCpuFamilyArmLightningThunder
@ MachCpuFamilyArm11
@ MachCpuFamilyArmHurricane
@ MachCpuFamilyArmTwister
@ MachCpuFamilyIntel626
@ MachCpuFamilyIntelMerom
@ MachCpuFamilyIntelPenryn
@ MachCpuFamilyIntelSandyBridge
@ MachCpuFamilyArm12
@ MachCpuFamilyArmXscale
@ MachCpuFamilyIntelCoffeeLake
@ MachCpuFamilyIntelYonah
@ MachCpuFamilyArmTyphoon
@ MachCpuFamilyIntelCometLake
@ MachCpuFamilyArmVortexTempest
@ MachCpuFamilyArm9
@ MachCpuFamilyIntel614
@ MachCpuFamilyIntelCore2
@ MachCpuFamilyArm14
@ MachCpuFamilyIntelSkylake
@ MachCpuFamilyArmSwift
@ MachCpuFamilyArm13
@ MachCpuFamilyArmCyclone
@ MachCpuFamilyIntelHaswell
@ MachCpuFamilyIntelBroadwell
@ MachCpuFamilyIntelNehalem
@ MachCpuFamilyIntel615
@ MachCpuFamilyArm15
@ MachCpuFamilyPowerPcG4
@ MachCpuFamilyIntel623
@ MachCpuFamilyIntelIvyBridge
@ MachCpuFamilyIntelIceLake
@ MachCpuFamilyPowerPcG5
@ MachCpuFamilyPowerPcG3
@ MachCpuFamilyArmMonsoonMistral
@ MachCpuFamilyIntelCore
@ MachCpuFamilyIntel613
@ MachCpuFamilyIntelWestmere
@ MachCpuFamilyUnknown
@ MachCpuFamilyIntelKabyLake
@ MachHeaderFileTypeExecute
@ MachHeaderFileTypeDynamicLinker
@ MachHeaderFileTypeKextBundle
@ MachHeaderFileTypeDsym
@ MachHeaderFileTypeBundle
@ MachHeaderFileTypeFixedVmLib
@ MachHeaderFileTypeDylib
@ MachHeaderFileTypeFileSet
@ MachHeaderFileTypeCore
@ MachHeaderFileTypeDynamicLinkerStub
@ MachHeaderFileTypeObject
@ MachHeaderFileTypePreload
UINT32 MACH_CPU_FAMILY
INT32 MACH_CPU_SUBTYPE
@ MachCpuSubtypeArmAll
@ MachCpuSubtypeMc68030
@ MachCpuSubtypeVax780
@ MachCpuSubtypeI386All
@ MachCpuSubtypeMipsR3000
@ MachCpuSubtypeUVax2
@ MachCpuSubtypeMipsAll
@ MachCpuSubtypePowerPc970
@ MachCpuSubtypeBigEndian
@ MachCpuSubtype586
@ MachCpuSubtypeHppa7100
@ MachCpuSubtypeXeonMp
@ MachCpuSubtypeArmV7K
@ MachCpuSubtypeArmXscale
@ MachCpuSubtypeArmV7S
@ MachCpuSubtypePowerPc620
@ MachCpuSubtypeArmV6M
@ MachCpuSubtypePowerPc7400
@ MachCpuSubtypeVax8800
@ MachCpuSubtypePentium3
@ MachCpuSubtypePentium3Xeon
@ MachCpuSubtypeMc68030Only
@ MachCpuSubtypeArmV7F
@ MachCpuSubtypeVax8650
@ MachCpuSubtypeX86Arch1
@ MachCpuSubtypeArmV7Em
@ MachCpuSubtypePentiumPro
@ MachCpuSubtypeArm6432All
@ MachCpuSubtypeVeo2
@ MachCpuSubtypePowerPc602
@ MachCpuSubtypeMipsR2000a
@ MachCpuSubtypeI860All
@ MachCpuSubtypeVax8500
@ MachCpuSubtypeArmV8
@ MachCpuSubtypeMipsR2000
@ MachCpuSubtypeArmV7
@ MachCpuSubtypePentiumM
@ MachCpuSubtypeX8664All
@ MachCpuSubtypeVaxAll
@ MachCpuSubtypePowerPc604
@ MachCpuSubtypeMipsR2600
@ MachCpuSubtypeCeleron
@ MachCpuSubtypeVeo4
@ MachCpuSubtypeMc98601
@ MachCpuSubtypeMc68040
@ MachCpuSubtypePentium4M
@ MachCpuSubtypeMipsR3000a
@ MachCpuSubtypePentium3M
@ MachCpuSubtypeHppa7100Lc
@ MachCpuSubtypePowerPc603e
@ MachCpuSubtypePowerPc7450
@ MachCpuSubtypeSparcAll
@ MachCpuSubtypeI860860
@ MachCpuSubtypePowerPc603ev
@ MachCpuSubtypeX8664H
@ MachCpuSubtypeVeo1
@ MachCpuSubtypeVeo3
@ MachCpuSubtypeUVax3
@ MachCpuSubtypePowerPc603
@ MachCpuSubtype486
@ MachCpuSubtypeCeleronMobile
@ MachCpuSubtypeArm6432V8
@ MachCpuSubtypeXeon
@ MachCpuSubtypeMc88100
@ MachCpuSubtypeMultiple
@ MachCpuSubtypePowerPcAll
@ MachCpuSubtypeMipsR2800
@ MachCpuSubtypeArmV4T
@ MachCpuSubtypeUVax1
@ MachCpuSubtypeMc680All
@ MachCpuSubtype386
@ MachCpuSubtypeItanium2
@ MachCpuSubtypeInvalid
@ MachCpuSubtypeX86All
@ MachCpuSubtypePentium
@ MachCpuSubtypeMc98000All
@ MachCpuSubtypeVax8600
@ MachCpuSubtypeArm64All
@ MachCpuSubtypeVeoAll
@ MachCpuSubtypeHppaAll
@ MachCpuSubtypeVax8200
@ MachCpuSubtype486Sx
@ MachCpuSubtypePowerPc750
@ MachCpuSubtypeArmV7M
@ MachCpuSubtypeLittleEndian
@ MachCpuSubtypeMc88110
@ MachCpuSubtypeArmV5Tej
@ MachCpuSubtypeVax750
@ MachCpuSubtypeItanium
@ MachCpuSubtypeMipsR2300
@ MachCpuSubtypePowerPc601
@ MachCpuSubtypeArmV6
@ MachCpuSubtypePentium3M3
@ MachCpuSubtypeMc88000All
@ MachCpuSubtypeVax785
@ MachCpuSubtypePentium4
@ MachCpuSubtypeVax730
@ MachCpuSubtypeArm64V8
@ MachCpuSubtypePentium3M5
@ MachCpuSubtypePowerPc604e
UINT8 Checksum
All 32 bits added together have to equal 1.
Definition AppleNec.h:77
UINT32 Version
SMBIOS_STRUCTURE Hdr
Definition AppleSmBios.h:51
UINT8 Signature[8]
Definition BiosId.h:67
DMG_SIZE_DEVICE_PATH Size
UINT32 CurrentVersion
MACH_LOAD_COMMAND_STRING Name
UINT32 CompatibilityVersion
UINT32 MinorVersion
library's minor version number
MACH_LOAD_COMMAND_STRING Name
library's target pathname
UINT32 HeaderAddress
library's header address
UINT32 Address32
pointer to the string
UINT32 Offset
offset to the string