LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
MachO/enums.inc
Go to the documentation of this file.
1
2
3enum _LIEF_EN_2(MACHO_TYPES, uint32_t) {
4 _LIEF_EI(MH_MAGIC) = 0xFEEDFACEu,
5 _LIEF_EI(MH_CIGAM) = 0xCEFAEDFEu,
6 _LIEF_EI(MH_MAGIC_64) = 0xFEEDFACFu,
7 _LIEF_EI(MH_CIGAM_64) = 0xCFFAEDFEu,
8 _LIEF_EI(FAT_MAGIC) = 0xCAFEBABEu,
9 _LIEF_EI(FAT_CIGAM) = 0xBEBAFECAu
10};
11
12enum _LIEF_EN(FILE_TYPES) {
13 _LIEF_EI(MH_OBJECT) = 0x1u,
14 _LIEF_EI(MH_EXECUTE) = 0x2u,
15 _LIEF_EI(MH_FVMLIB) = 0x3u,
16 _LIEF_EI(MH_CORE) = 0x4u,
17 _LIEF_EI(MH_PRELOAD) = 0x5u,
18 _LIEF_EI(MH_DYLIB) = 0x6u,
19 _LIEF_EI(MH_DYLINKER) = 0x7u,
20 _LIEF_EI(MH_BUNDLE) = 0x8u,
21 _LIEF_EI(MH_DYLIB_STUB) = 0x9u,
22 _LIEF_EI(MH_DSYM) = 0xAu,
23 _LIEF_EI(MH_KEXT_BUNDLE) = 0xBu
24};
25
26
27enum _LIEF_EN(HEADER_FLAGS) {
28 _LIEF_EI(MH_NOUNDEFS) = 0x00000001u,
29 _LIEF_EI(MH_INCRLINK) = 0x00000002u,
30 _LIEF_EI(MH_DYLDLINK) = 0x00000004u,
31 _LIEF_EI(MH_BINDATLOAD) = 0x00000008u,
32 _LIEF_EI(MH_PREBOUND) = 0x00000010u,
33 _LIEF_EI(MH_SPLIT_SEGS) = 0x00000020u,
34 _LIEF_EI(MH_LAZY_INIT) = 0x00000040u,
35 _LIEF_EI(MH_TWOLEVEL) = 0x00000080u,
36 _LIEF_EI(MH_FORCE_FLAT) = 0x00000100u,
37 _LIEF_EI(MH_NOMULTIDEFS) = 0x00000200u,
38 _LIEF_EI(MH_NOFIXPREBINDING) = 0x00000400u,
39 _LIEF_EI(MH_PREBINDABLE) = 0x00000800u,
40 _LIEF_EI(MH_ALLMODSBOUND) = 0x00001000u,
41 _LIEF_EI(MH_SUBSECTIONS_VIA_SYMBOLS) = 0x00002000u,
42 _LIEF_EI(MH_CANONICAL) = 0x00004000u,
43 _LIEF_EI(MH_WEAK_DEFINES) = 0x00008000u,
44 _LIEF_EI(MH_BINDS_TO_WEAK) = 0x00010000u,
45 _LIEF_EI(MH_ALLOW_STACK_EXECUTION) = 0x00020000u,
46 _LIEF_EI(MH_ROOT_SAFE) = 0x00040000u,
47 _LIEF_EI(MH_SETUID_SAFE) = 0x00080000u,
48 _LIEF_EI(MH_NO_REEXPORTED_DYLIBS) = 0x00100000u,
49 _LIEF_EI(MH_PIE) = 0x00200000u,
50 _LIEF_EI(MH_DEAD_STRIPPABLE_DYLIB) = 0x00400000u,
51 _LIEF_EI(MH_HAS_TLV_DESCRIPTORS) = 0x00800000u,
52 _LIEF_EI(MH_NO_HEAP_EXECUTION) = 0x01000000u,
53 _LIEF_EI(MH_APP_EXTENSION_SAFE) = 0x02000000u
54};
55
56
57enum _LIEF_EN(LOAD_COMMAND_TYPES) {
58 /* Constants for the "cmd" field in llvm::MachO::load_command */
59 _LIEF_EI(LC_SEGMENT) = 0x00000001u,
60 _LIEF_EI(LC_SYMTAB) = 0x00000002u,
61 _LIEF_EI(LC_SYMSEG) = 0x00000003u,
62 _LIEF_EI(LC_THREAD) = 0x00000004u,
63 _LIEF_EI(LC_UNIXTHREAD) = 0x00000005u,
64 _LIEF_EI(LC_LOADFVMLIB) = 0x00000006u,
65 _LIEF_EI(LC_IDFVMLIB) = 0x00000007u,
66 _LIEF_EI(LC_IDENT) = 0x00000008u,
67 _LIEF_EI(LC_FVMFILE) = 0x00000009u,
68 _LIEF_EI(LC_PREPAGE) = 0x0000000Au,
69 _LIEF_EI(LC_DYSYMTAB) = 0x0000000Bu,
70 _LIEF_EI(LC_LOAD_DYLIB) = 0x0000000Cu,
71 _LIEF_EI(LC_ID_DYLIB) = 0x0000000Du,
72 _LIEF_EI(LC_LOAD_DYLINKER) = 0x0000000Eu,
73 _LIEF_EI(LC_ID_DYLINKER) = 0x0000000Fu,
74 _LIEF_EI(LC_PREBOUND_DYLIB) = 0x00000010u,
75 _LIEF_EI(LC_ROUTINES) = 0x00000011u,
76 _LIEF_EI(LC_SUB_FRAMEWORK) = 0x00000012u,
77 _LIEF_EI(LC_SUB_UMBRELLA) = 0x00000013u,
78 _LIEF_EI(LC_SUB_CLIENT) = 0x00000014u,
79 _LIEF_EI(LC_SUB_LIBRARY) = 0x00000015u,
80 _LIEF_EI(LC_TWOLEVEL_HINTS) = 0x00000016u,
81 _LIEF_EI(LC_PREBIND_CKSUM) = 0x00000017u,
82 _LIEF_EI(LC_LOAD_WEAK_DYLIB) = 0x80000018u,
83 _LIEF_EI(LC_SEGMENT_64) = 0x00000019u,
84 _LIEF_EI(LC_ROUTINES_64) = 0x0000001Au,
85 _LIEF_EI(LC_UUID) = 0x0000001Bu,
86 _LIEF_EI(LC_RPATH) = 0x8000001Cu,
87 _LIEF_EI(LC_CODE_SIGNATURE) = 0x0000001Du,
88 _LIEF_EI(LC_SEGMENT_SPLIT_INFO) = 0x0000001Eu,
89 _LIEF_EI(LC_REEXPORT_DYLIB) = 0x8000001Fu,
90 _LIEF_EI(LC_LAZY_LOAD_DYLIB) = 0x00000020u,
91 _LIEF_EI(LC_ENCRYPTION_INFO) = 0x00000021u,
92 _LIEF_EI(LC_DYLD_INFO) = 0x00000022u,
93 _LIEF_EI(LC_DYLD_INFO_ONLY) = 0x80000022u,
94 _LIEF_EI(LC_LOAD_UPWARD_DYLIB) = 0x80000023u,
95 _LIEF_EI(LC_VERSION_MIN_MACOSX) = 0x00000024u,
96 _LIEF_EI(LC_VERSION_MIN_IPHONEOS) = 0x00000025u,
97 _LIEF_EI(LC_FUNCTION_STARTS) = 0x00000026u,
98 _LIEF_EI(LC_DYLD_ENVIRONMENT) = 0x00000027u,
99 _LIEF_EI(LC_MAIN) = 0x80000028u,
100 _LIEF_EI(LC_DATA_IN_CODE) = 0x00000029u,
101 _LIEF_EI(LC_SOURCE_VERSION) = 0x0000002Au,
102 _LIEF_EI(LC_DYLIB_CODE_SIGN_DRS) = 0x0000002Bu,
103 _LIEF_EI(LC_ENCRYPTION_INFO_64) = 0x0000002Cu,
104 _LIEF_EI(LC_LINKER_OPTION) = 0x0000002Du,
105 _LIEF_EI(LC_LINKER_OPTIMIZATION_HINT) = 0x0000002Eu,
106 _LIEF_EI(LC_VERSION_MIN_TVOS) = 0x0000002Fu,
107 _LIEF_EI(LC_VERSION_MIN_WATCHOS) = 0x00000030u,
108 _LIEF_EI(LC_NOTE) = 0x00000031u,
109 _LIEF_EI(LC_BUILD_VERSION) = 0x00000032u,
110 _LIEF_EI(LC_DYLD_EXPORTS_TRIE) = 0x80000033u,
111 _LIEF_EI(LC_DYLD_CHAINED_FIXUPS) = 0x80000034u,
112 _LIEF_EI(LC_FILESET_ENTRY) = 0x80000035u,
113};
114
115
116enum {
117 /* Flags for the "cmd" field in llvm::MachO::load_command */
118 _LIEF_EI(LC_REQ_DYLD) = 0x80000000u
119 };
120
121
122enum _LIEF_EN(MACHO_SEGMENTS_FLAGS) {
123 /* Constant bits for the "flags" field in llvm::MachO::segment_command */
124 _LIEF_EI(SG_HIGHVM) = 0x1u,
125 _LIEF_EI(SG_FVMLIB) = 0x2u,
126 _LIEF_EI(SG_NORELOC) = 0x4u,
127 _LIEF_EI(SG_PROTECTED_VERSION_1) = 0x8u,
128};
129
130enum _LIEF_EN(SECTION_FLAGS_HELPER) {
131 /* Constant masks for the "flags" field in llvm::MachO::section and */
132 /* llvm::MachO::section_64 */
133 _LIEF_EI(SECTION_TYPE_MASK) = 0x000000ffu, /* SECTION_TYPE */
134 _LIEF_EI(SECTION_FLAGS_MASK) = 0xffffff00u, /* SECTION_ATTRIBUTES */
135 _LIEF_EI(SECTION_FLAGS_USR_MASK) = 0xff000000u, /* SECTION_ATTRIBUTES_USR */
136 _LIEF_EI(SECTION_FLAGS_SYS_MASK) = 0x00ffff00u /* SECTION_ATTRIBUTES_SYS */
137};
138
143enum _LIEF_EN(MACHO_SECTION_TYPES) {
144 /* Constant masks for the "flags[7:0]" field in llvm::MachO::section and */
145 /* llvm::MachO::section_64 (mask "flags" with SECTION_TYPE) */
146 _LIEF_EI(S_REGULAR) = 0x00u,
147 _LIEF_EI(S_ZEROFILL) = 0x01u,
148 _LIEF_EI(S_CSTRING_LITERALS) = 0x02u,
149 _LIEF_EI(S_4BYTE_LITERALS) = 0x03u,
150 _LIEF_EI(S_8BYTE_LITERALS) = 0x04u,
151 _LIEF_EI(S_LITERAL_POINTERS) = 0x05u,
152 _LIEF_EI(S_NON_LAZY_SYMBOL_POINTERS) = 0x06u,
153 _LIEF_EI(S_LAZY_SYMBOL_POINTERS) = 0x07u,
154 _LIEF_EI(S_SYMBOL_STUBS) = 0x08u,
155 _LIEF_EI(S_MOD_INIT_FUNC_POINTERS) = 0x09u,
156 _LIEF_EI(S_MOD_TERM_FUNC_POINTERS) = 0x0au,
157 _LIEF_EI(S_COALESCED) = 0x0bu,
158 _LIEF_EI(S_GB_ZEROFILL) = 0x0cu,
159 _LIEF_EI(S_INTERPOSING) = 0x0du,
160 _LIEF_EI(S_16BYTE_LITERALS) = 0x0eu,
161 _LIEF_EI(S_DTRACE_DOF) = 0x0fu,
162 _LIEF_EI(S_LAZY_DYLIB_SYMBOL_POINTERS) = 0x10u,
163 _LIEF_EI(S_THREAD_LOCAL_REGULAR) = 0x11u,
164 _LIEF_EI(S_THREAD_LOCAL_ZEROFILL) = 0x12u,
165 _LIEF_EI(S_THREAD_LOCAL_VARIABLES) = 0x13u,
166 _LIEF_EI(S_THREAD_LOCAL_VARIABLE_POINTERS) = 0x14u,
167 _LIEF_EI(S_THREAD_LOCAL_INIT_FUNCTION_POINTERS) = 0x15u,
168
169 _LIEF_EI(LAST_KNOWN_SECTION_TYPE) = 0x15u, /* S_THREAD_LOCAL_INIT_FUNCTION_POINTERS */
170};
171
172enum _LIEF_EN(MACHO_SECTION_FLAGS) {
173
174 /* Constant masks for the "flags[31:24]" field in llvm::MachO::section and */
175 /* llvm::MachO::section_64 (mask "flags" with SECTION_ATTRIBUTES_USR) */
176 _LIEF_EI(S_ATTR_PURE_INSTRUCTIONS) = 0x80000000u,
177 _LIEF_EI(S_ATTR_NO_TOC) = 0x40000000u,
178 _LIEF_EI(S_ATTR_STRIP_STATIC_SYMS) = 0x20000000u,
179 _LIEF_EI(S_ATTR_NO_DEAD_STRIP) = 0x10000000u,
180 _LIEF_EI(S_ATTR_LIVE_SUPPORT) = 0x08000000u,
181 _LIEF_EI(S_ATTR_SELF_MODIFYING_CODE) = 0x04000000u,
182 _LIEF_EI(S_ATTR_DEBUG) = 0x02000000u,
183
184 /* Constant masks for the "flags[23:8]" field in llvm::MachO::section and */
185 /* llvm::MachO::section_64 (mask "flags" with SECTION_ATTRIBUTES_SYS) */
186 _LIEF_EI(S_ATTR_SOME_INSTRUCTIONS) = 0x00000400u,
187 _LIEF_EI(S_ATTR_EXT_RELOC) = 0x00000200u,
188 _LIEF_EI(S_ATTR_LOC_RELOC) = 0x00000100u,
189
190 /* Constant masks for the value of an indirect symbol in an indirect */
191 /* symbol table */
192 _LIEF_EI(INDIRECT_SYMBOL_LOCAL) = 0x80000000u,
193 _LIEF_EI(INDIRECT_SYMBOL_ABS) = 0x40000000u
194};
195
196
197enum _LIEF_EN(DataRegionType) {
198 /* Constants for the "kind" field in a data_in_code_entry structure */
199 _LIEF_EI(DICE_KIND_DATA) = 1u,
200 _LIEF_EI(DICE_KIND_JUMP_TABLE8) = 2u,
201 _LIEF_EI(DICE_KIND_JUMP_TABLE16) = 3u,
202 _LIEF_EI(DICE_KIND_JUMP_TABLE32) = 4u,
203 _LIEF_EI(DICE_KIND_ABS_JUMP_TABLE32) = 5u
204};
205
206enum _LIEF_EN(REBASE_TYPES) {
207 _LIEF_EI(REBASE_TYPE_POINTER) = 1u,
208 _LIEF_EI(REBASE_TYPE_TEXT_ABSOLUTE32) = 2u,
209 _LIEF_EI(REBASE_TYPE_TEXT_PCREL32) = 3u,
210 _LIEF_EI(REBASE_TYPE_THREADED) = 102u,
211};
212
213enum {
214 _LIEF_EI(REBASE_OPCODE_MASK) = 0xF0u,
215 _LIEF_EI(REBASE_IMMEDIATE_MASK) = 0x0Fu
216};
217
218
220enum _LIEF_EN_2(REBASE_OPCODES, uint8_t) {
221 _LIEF_EI(REBASE_OPCODE_DONE) = 0x00u,
222 _LIEF_EI(REBASE_OPCODE_SET_TYPE_IMM) = 0x10u,
223 _LIEF_EI(REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB) = 0x20u,
224 _LIEF_EI(REBASE_OPCODE_ADD_ADDR_ULEB) = 0x30u,
225 _LIEF_EI(REBASE_OPCODE_ADD_ADDR_IMM_SCALED) = 0x40u,
226 _LIEF_EI(REBASE_OPCODE_DO_REBASE_IMM_TIMES) = 0x50u,
227 _LIEF_EI(REBASE_OPCODE_DO_REBASE_ULEB_TIMES) = 0x60u,
228 _LIEF_EI(REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB) = 0x70u,
229 _LIEF_EI(REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB) = 0x80u
230};
231
232
237enum _LIEF_EN(BINDING_CLASS) {
238 _LIEF_EI(BIND_CLASS_WEAK) = 1u,
239 _LIEF_EI(BIND_CLASS_LAZY) = 2u,
240 _LIEF_EI(BIND_CLASS_STANDARD) = 3u,
241 _LIEF_EI(BIND_CLASS_THREADED) = 100u
242};
243
244
245enum _LIEF_EN(BIND_TYPES) {
246 _LIEF_EI(BIND_TYPE_POINTER) = 1u,
247 _LIEF_EI(BIND_TYPE_TEXT_ABSOLUTE32) = 2u,
248 _LIEF_EI(BIND_TYPE_TEXT_PCREL32) = 3u
249};
250
251enum _LIEF_EN_2(BIND_SPECIAL_DYLIB, int) {
252 _LIEF_EI(BIND_SPECIAL_DYLIB_SELF) = 0,
253 _LIEF_EI(BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE) = -1,
254 _LIEF_EI(BIND_SPECIAL_DYLIB_FLAT_LOOKUP) = -2
255};
256
257enum {
258 _LIEF_EI(BIND_SYMBOL_FLAGS_WEAK_IMPORT) = 0x1u,
259 _LIEF_EI(BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION) = 0x8u,
260
261 _LIEF_EI(BIND_OPCODE_MASK) = 0xF0u,
262 _LIEF_EI(BIND_IMMEDIATE_MASK) = 0x0Fu
263};
264
266enum _LIEF_EN_2(BIND_OPCODES, uint8_t) {
267 _LIEF_EI(BIND_OPCODE_DONE) = 0x00u,
268 _LIEF_EI(BIND_OPCODE_SET_DYLIB_ORDINAL_IMM) = 0x10u,
269 _LIEF_EI(BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB) = 0x20u,
270 _LIEF_EI(BIND_OPCODE_SET_DYLIB_SPECIAL_IMM) = 0x30u,
271 _LIEF_EI(BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM) = 0x40u,
272 _LIEF_EI(BIND_OPCODE_SET_TYPE_IMM) = 0x50u,
273 _LIEF_EI(BIND_OPCODE_SET_ADDEND_SLEB) = 0x60u,
274 _LIEF_EI(BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB) = 0x70u,
275 _LIEF_EI(BIND_OPCODE_ADD_ADDR_ULEB) = 0x80u,
276 _LIEF_EI(BIND_OPCODE_DO_BIND) = 0x90u,
277 _LIEF_EI(BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB) = 0xA0u,
278 _LIEF_EI(BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED) = 0xB0u,
279 _LIEF_EI(BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB) = 0xC0u,
280 _LIEF_EI(BIND_OPCODE_THREADED) = 0xD0u,
281
282 _LIEF_EI(BIND_OPCODE_THREADED_APPLY) = 0xD0u | 0x01u,
283 _LIEF_EI(BIND_OPCODE_THREADED_SET_BIND_ORDINAL_TABLE_SIZE_ULEB) = 0xD0u | 0x00u,
284};
285
286enum _LIEF_EN_2(BIND_SUBOPCODE_THREADED, uint8_t) {
287 _LIEF_EI(BIND_SUBOPCODE_THREADED_SET_BIND_ORDINAL_TABLE_SIZE_ULEB) = 0x00u,
288 _LIEF_EI(BIND_SUBOPCODE_THREADED_APPLY) = 0x01u,
289};
290
291enum _LIEF_EN(EXPORT_SYMBOL_FLAGS) {
292 _LIEF_EI(EXPORT_SYMBOL_FLAGS_KIND_MASK) = 0x03u,
293 _LIEF_EI(EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION) = 0x04u,
294 _LIEF_EI(EXPORT_SYMBOL_FLAGS_REEXPORT) = 0x08u,
295 _LIEF_EI(EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER) = 0x10u
296};
297
298enum _LIEF_EN(EXPORT_SYMBOL_KINDS) {
299 _LIEF_EI(EXPORT_SYMBOL_FLAGS_KIND_REGULAR) = 0x00u,
300 _LIEF_EI(EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL) = 0x01u,
301 _LIEF_EI(EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE) = 0x02u
302};
303
304enum _LIEF_EN(MACHO_SYMBOL_TYPES) {
305 _LIEF_EI(N_STAB) = 0xe0,
306 _LIEF_EI(N_PEXT) = 0x10,
307 _LIEF_EI(N_TYPE) = 0x0e,
308 _LIEF_EI(N_EXT) = 0x01
309};
310
312enum _LIEF_EN(N_LIST_TYPES) {
313 _LIEF_EI(N_UNDF) = 0x0u,
314 _LIEF_EI(N_ABS) = 0x2u,
315 _LIEF_EI(N_SECT) = 0xeu,
316 _LIEF_EI(N_PBUD) = 0xcu,
317 _LIEF_EI(N_INDR) = 0xau
318};
319
320enum _LIEF_EN(SectionOrdinal) {
321 /* Constants for the "n_sect" field in llvm::MachO::nlist and */
322 /* llvm::MachO::nlist_64 */
323 _LIEF_EI(NO_SECT) = 0u,
324 _LIEF_EI(MAX_SECT) = 0xffu
325};
326
327enum _LIEF_EN(SYMBOL_DESCRIPTIONS) {
328
329 /* The low 3 bits are the for the REFERENCE_TYPE. */
330 _LIEF_EI(REFERENCE_TYPE) = 0x7,
331 _LIEF_EI(REFERENCE_FLAG_UNDEFINED_NON_LAZY) = 0,
332 _LIEF_EI(REFERENCE_FLAG_UNDEFINED_LAZY) = 1,
333 _LIEF_EI(REFERENCE_FLAG_DEFINED) = 2,
334 _LIEF_EI(REFERENCE_FLAG_PRIVATE_DEFINED) = 3,
335 _LIEF_EI(REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY) = 4,
336 _LIEF_EI(REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY) = 5,
337
338 /* Flag bits (some overlap with the library ordinal bits). */
339 _LIEF_EI(N_ARM_THUMB_DEF) = 0x0008u,
340 _LIEF_EI(REFERENCED_DYNAMICALLY) = 0x0010u,
341 _LIEF_EI(N_NO_DEAD_STRIP) = 0x0020u,
342 _LIEF_EI(N_WEAK_REF) = 0x0040u,
343 _LIEF_EI(N_WEAK_DEF) = 0x0080u,
344 _LIEF_EI(N_SYMBOL_RESOLVER) = 0x0100u,
345 _LIEF_EI(N_ALT_ENTRY) = 0x0200u,
346
347 /* For undefined symbols coming from libraries, see GET_LIBRARY_ORDINAL() */
348 /* as these are in the top 8 bits. */
349 _LIEF_EI(SELF_LIBRARY_ORDINAL) = 0x0,
350 _LIEF_EI(MAX_LIBRARY_ORDINAL) = 0xfd,
351 _LIEF_EI(DYNAMIC_LOOKUP_ORDINAL) = 0xfe,
352 _LIEF_EI(EXECUTABLE_ORDINAL) = 0xff
353};
354
355enum _LIEF_EN(StabType) {
356 /* Constant values for the "n_type" field in llvm::MachO::nlist and */
357 /* llvm::MachO::nlist_64 when "(n_type & N_STAB) != 0" */
358 _LIEF_EI(N_GSYM) = 0x20u,
359 _LIEF_EI(N_FNAME) = 0x22u,
360 _LIEF_EI(N_FUN) = 0x24u,
361 _LIEF_EI(N_STSYM) = 0x26u,
362 _LIEF_EI(N_LCSYM) = 0x28u,
363 _LIEF_EI(N_BNSYM) = 0x2Eu,
364 _LIEF_EI(N_PC) = 0x30u,
365 _LIEF_EI(N_AST) = 0x32u,
366 _LIEF_EI(N_OPT) = 0x3Cu,
367 _LIEF_EI(N_RSYM) = 0x40u,
368 _LIEF_EI(N_SLINE) = 0x44u,
369 _LIEF_EI(N_ENSYM) = 0x4Eu,
370 _LIEF_EI(N_SSYM) = 0x60u,
371 _LIEF_EI(N_SO) = 0x64u,
372 _LIEF_EI(N_OSO) = 0x66u,
373 _LIEF_EI(N_LSYM) = 0x80u,
374 _LIEF_EI(N_BINCL) = 0x82u,
375 _LIEF_EI(N_SOL) = 0x84u,
376 _LIEF_EI(N_PARAMS) = 0x86u,
377 _LIEF_EI(N_VERSION) = 0x88u,
378 _LIEF_EI(N_OLEVEL) = 0x8Au,
379 _LIEF_EI(N_PSYM) = 0xA0u,
380 _LIEF_EI(N_EINCL) = 0xA2u,
381 _LIEF_EI(N_ENTRY) = 0xA4u,
382 _LIEF_EI(N_LBRAC) = 0xC0u,
383 _LIEF_EI(N_EXCL) = 0xC2u,
384 _LIEF_EI(N_RBRAC) = 0xE0u,
385 _LIEF_EI(N_BCOMM) = 0xE2u,
386 _LIEF_EI(N_ECOMM) = 0xE4u,
387 _LIEF_EI(N_ECOML) = 0xE8u,
388 _LIEF_EI(N_LENG) = 0xFEu
389};
390
391
392enum {
393 /* Constant values for the r_symbolnum field in an */
394 /* llvm::MachO::relocation_info structure when r_extern is 0. */
395 _LIEF_EI(R_ABS) = 0,
396
397 /* Constant bits for the r_address field in an */
398 /* llvm::MachO::relocation_info structure. */
399 _LIEF_EI(R_SCATTERED) = 0x80000000
400};
401
402enum _LIEF_EN(RELOCATION_ORIGINS) {
403 _LIEF_EI(ORIGIN_UNKNOWN) = 0,
404 _LIEF_EI(ORIGIN_DYLDINFO) = 1,
405 _LIEF_EI(ORIGIN_RELOC_TABLE) = 2,
406};
407
408
409enum _LIEF_EN(SYMBOL_ORIGINS) {
410 _LIEF_EI(SYM_ORIGIN_UNKNOWN) = 0,
411 _LIEF_EI(SYM_ORIGIN_DYLD_EXPORT) = 1,
412 _LIEF_EI(SYM_ORIGIN_DYLD_BIND) = 2,
413 _LIEF_EI(SYM_ORIGIN_LC_SYMTAB) = 3,
414};
415
416enum _LIEF_EN(X86_RELOCATION) {
417 _LIEF_EI(GENERIC_RELOC_VANILLA) = 0,
418 _LIEF_EI(GENERIC_RELOC_PAIR) = 1,
419 _LIEF_EI(GENERIC_RELOC_SECTDIFF) = 2,
420 _LIEF_EI(GENERIC_RELOC_PB_LA_PTR) = 3,
421 _LIEF_EI(GENERIC_RELOC_LOCAL_SECTDIFF) = 4,
422 _LIEF_EI(GENERIC_RELOC_TLV) = 5,
423};
424
425
426enum _LIEF_EN(X86_64_RELOCATION) {
427 _LIEF_EI(X86_64_RELOC_UNSIGNED) = 0,
428 _LIEF_EI(X86_64_RELOC_SIGNED) = 1,
429 _LIEF_EI(X86_64_RELOC_BRANCH) = 2,
430 _LIEF_EI(X86_64_RELOC_GOT_LOAD) = 3,
431 _LIEF_EI(X86_64_RELOC_GOT) = 4,
432 _LIEF_EI(X86_64_RELOC_SUBTRACTOR) = 5,
433 _LIEF_EI(X86_64_RELOC_SIGNED_1) = 6,
434 _LIEF_EI(X86_64_RELOC_SIGNED_2) = 7,
435 _LIEF_EI(X86_64_RELOC_SIGNED_4) = 8,
436 _LIEF_EI(X86_64_RELOC_TLV) = 9,
437};
438
439
440enum _LIEF_EN(PPC_RELOCATION) {
441 _LIEF_EI(PPC_RELOC_VANILLA) = 0,
442 _LIEF_EI(PPC_RELOC_PAIR) = 1,
443 _LIEF_EI(PPC_RELOC_BR14) = 2,
444 _LIEF_EI(PPC_RELOC_BR24) = 3,
445 _LIEF_EI(PPC_RELOC_HI16) = 4,
446 _LIEF_EI(PPC_RELOC_LO16) = 5,
447 _LIEF_EI(PPC_RELOC_HA16) = 6,
448 _LIEF_EI(PPC_RELOC_LO14) = 7,
449 _LIEF_EI(PPC_RELOC_SECTDIFF) = 8,
450 _LIEF_EI(PPC_RELOC_PB_LA_PTR) = 9,
451 _LIEF_EI(PPC_RELOC_HI16_SECTDIFF) = 10,
452 _LIEF_EI(PPC_RELOC_LO16_SECTDIFF) = 11,
453 _LIEF_EI(PPC_RELOC_HA16_SECTDIFF) = 12,
454 _LIEF_EI(PPC_RELOC_JBSR) = 13,
455 _LIEF_EI(PPC_RELOC_LO14_SECTDIFF) = 14,
456 _LIEF_EI(PPC_RELOC_LOCAL_SECTDIFF) = 15,
457};
458
459
460enum _LIEF_EN(ARM_RELOCATION) {
461 _LIEF_EI(ARM_RELOC_VANILLA) = 0,
462 _LIEF_EI(ARM_RELOC_PAIR) = 1,
463 _LIEF_EI(ARM_RELOC_SECTDIFF) = 2,
464 _LIEF_EI(ARM_RELOC_LOCAL_SECTDIFF) = 3,
465 _LIEF_EI(ARM_RELOC_PB_LA_PTR) = 4,
466 _LIEF_EI(ARM_RELOC_BR24) = 5,
467 _LIEF_EI(ARM_THUMB_RELOC_BR22) = 6,
468 _LIEF_EI(ARM_THUMB_32BIT_BRANCH) = 7, /* obsolete */
469 _LIEF_EI(ARM_RELOC_HALF) = 8,
470 _LIEF_EI(ARM_RELOC_HALF_SECTDIFF) = 9,
471};
472
473
474enum _LIEF_EN(ARM64_RELOCATION) {
475 _LIEF_EI(ARM64_RELOC_UNSIGNED) = 0,
476 _LIEF_EI(ARM64_RELOC_SUBTRACTOR) = 1,
477 _LIEF_EI(ARM64_RELOC_BRANCH26) = 2,
478 _LIEF_EI(ARM64_RELOC_PAGE21) = 3,
479 _LIEF_EI(ARM64_RELOC_PAGEOFF12) = 4,
480 _LIEF_EI(ARM64_RELOC_GOT_LOAD_PAGE21) = 5,
481 _LIEF_EI(ARM64_RELOC_GOT_LOAD_PAGEOFF12) = 6,
482 _LIEF_EI(ARM64_RELOC_POINTER_TO_GOT) = 7,
483 _LIEF_EI(ARM64_RELOC_TLVP_LOAD_PAGE21) = 8,
484 _LIEF_EI(ARM64_RELOC_TLVP_LOAD_PAGEOFF12) = 9,
485 _LIEF_EI(ARM64_RELOC_ADDEND) = 10,
486};
487
489enum _LIEF_EN(VM_PROTECTIONS) {
490 _LIEF_EI(VM_PROT_READ) = 0x1,
491 _LIEF_EI(VM_PROT_WRITE) = 0x2,
492 _LIEF_EI(VM_PROT_EXECUTE) = 0x4,
493};
494
495
496/* Enums from <mach/machine.h> */
497enum {
498 /* Capability bits used in the definition of cpu_type. */
499 _LIEF_EI(CPU_ARCH_MASK) = 0xff000000, /* Mask for architecture bits */
500 _LIEF_EI(CPU_ARCH_ABI64) = 0x01000000 /* 64 bit ABI */
501};
502
503/* Constants for the cputype field. */
504enum _LIEF_EN_2(CPU_TYPES, int) {
505 _LIEF_EI(CPU_TYPE_ANY) = -1,
506 _LIEF_EI(CPU_TYPE_X86) = 7,
507 _LIEF_EI(CPU_TYPE_I386) = 7, /* CPU_TYPE_X86, */
508 _LIEF_EI(CPU_TYPE_X86_64) = 7 | 0x01000000, /* CPU_TYPE_X86 | CPU_ARCH_ABI64, */
509/* _LIEF_EI(CPU_TYPE_MIPS) = 8, */
510 _LIEF_EI(CPU_TYPE_MC98000) = 10, /* Old Motorola PowerPC */
511 _LIEF_EI(CPU_TYPE_ARM) = 12,
512 _LIEF_EI(CPU_TYPE_ARM64) = 12 | 0x01000000, /* CPU_TYPE_ARM | CPU_ARCH_ABI64, */
513 _LIEF_EI(CPU_TYPE_SPARC) = 14,
514 _LIEF_EI(CPU_TYPE_POWERPC) = 18,
515 _LIEF_EI(CPU_TYPE_POWERPC64) = 18 | 0x01000000, /* CPU_TYPE_POWERPC | CPU_ARCH_ABI64 */
516};
517
518enum {
519 /* Capability bits used in the definition of cpusubtype. */
520 _LIEF_EI(CPU_SUBTYPE_MASK) = 0xff000000, /* Mask for architecture bits */
521 _LIEF_EI(CPU_SUBTYPE_LIB64) = 0x80000000, /* 64 bit libraries */
522
523 /* Special CPU subtype constants. */
524 _LIEF_EI(CPU_SUBTYPE_MULTIPLE) = ~0u
525};
526
527/* Constants for the cpusubtype field. */
528enum _LIEF_EN(CPU_SUBTYPES_X86) {
529 _LIEF_EI(CPU_SUBTYPE_I386_ALL) = 3,
530 _LIEF_EI(CPU_SUBTYPE_386) = 3,
531 _LIEF_EI(CPU_SUBTYPE_486) = 4,
532 _LIEF_EI(CPU_SUBTYPE_486SX) = 0x84,
533 _LIEF_EI(CPU_SUBTYPE_586) = 5,
534 _LIEF_EI(CPU_SUBTYPE_PENT) = 5, /* CPU_SUBTYPE_586, */
535 _LIEF_EI(CPU_SUBTYPE_PENTPRO) = 0x16,
536 _LIEF_EI(CPU_SUBTYPE_PENTII_M3) = 0x36,
537 _LIEF_EI(CPU_SUBTYPE_PENTII_M5) = 0x56,
538 _LIEF_EI(CPU_SUBTYPE_CELERON) = 0x67,
539 _LIEF_EI(CPU_SUBTYPE_CELERON_MOBILE) = 0x77,
540 _LIEF_EI(CPU_SUBTYPE_PENTIUM_3) = 0x08,
541 _LIEF_EI(CPU_SUBTYPE_PENTIUM_3_M) = 0x18,
542 _LIEF_EI(CPU_SUBTYPE_PENTIUM_3_XEON) = 0x28,
543 _LIEF_EI(CPU_SUBTYPE_PENTIUM_M) = 0x09,
544 _LIEF_EI(CPU_SUBTYPE_PENTIUM_4) = 0x0a,
545 _LIEF_EI(CPU_SUBTYPE_PENTIUM_4_M) = 0x1a,
546 _LIEF_EI(CPU_SUBTYPE_ITANIUM) = 0x0b,
547 _LIEF_EI(CPU_SUBTYPE_ITANIUM_2) = 0x1b,
548 _LIEF_EI(CPU_SUBTYPE_XEON) = 0x0c,
549 _LIEF_EI(CPU_SUBTYPE_XEON_MP) = 0x1c,
550
551 _LIEF_EI(CPU_SUBTYPE_X86_ALL) = 3,
552 _LIEF_EI(CPU_SUBTYPE_X86_64_ALL) = 3,
553 _LIEF_EI(CPU_SUBTYPE_X86_ARCH1) = 4,
554 _LIEF_EI(CPU_SUBTYPE_X86_64_H) = 8
555};
556
557
558enum {
559 _LIEF_EI(CPU_SUBTYPE_INTEL_FAMILY_MAX) = 15,
560 _LIEF_EI(CPU_SUBTYPE_INTEL_MODEL_ALL) = 0
561};
562
563enum _LIEF_EN(CPU_SUBTYPES_ARM) {
564 _LIEF_EI(CPU_SUBTYPE_ARM_ALL) = 0,
565 _LIEF_EI(CPU_SUBTYPE_ARM_V4T) = 5,
566 _LIEF_EI(CPU_SUBTYPE_ARM_V6) = 6,
567 _LIEF_EI(CPU_SUBTYPE_ARM_V5) = 7,
568 _LIEF_EI(CPU_SUBTYPE_ARM_V5TEJ) = 7,
569 _LIEF_EI(CPU_SUBTYPE_ARM_XSCALE) = 8,
570 _LIEF_EI(CPU_SUBTYPE_ARM_V7) = 9,
571 /* unused _LIEF_EI(ARM_V7F) = 10, */
572 _LIEF_EI(CPU_SUBTYPE_ARM_V7S) = 11,
573 _LIEF_EI(CPU_SUBTYPE_ARM_V7K) = 12,
574 _LIEF_EI(CPU_SUBTYPE_ARM_V6M) = 14,
575 _LIEF_EI(CPU_SUBTYPE_ARM_V7M) = 15,
576 _LIEF_EI(CPU_SUBTYPE_ARM_V7EM) = 16
577};
578
579enum _LIEF_EN(CPU_SUBTYPES_ARM64) {
580 _LIEF_EI(CPU_SUBTYPE_ARM64_ALL) = 0
581};
582
583enum _LIEF_EN(CPU_SUBTYPES_SPARC) {
584 _LIEF_EI(CPU_SUBTYPE_SPARC_ALL) = 0
585};
586
587enum _LIEF_EN(CPU_SUBTYPES_POWERPC) {
588 _LIEF_EI(CPU_SUBTYPE_POWERPC_ALL) = 0,
589 _LIEF_EI(CPU_SUBTYPE_POWERPC_601) = 1,
590 _LIEF_EI(CPU_SUBTYPE_POWERPC_602) = 2,
591 _LIEF_EI(CPU_SUBTYPE_POWERPC_603) = 3,
592 _LIEF_EI(CPU_SUBTYPE_POWERPC_603e) = 4,
593 _LIEF_EI(CPU_SUBTYPE_POWERPC_603ev) = 5,
594 _LIEF_EI(CPU_SUBTYPE_POWERPC_604) = 6,
595 _LIEF_EI(CPU_SUBTYPE_POWERPC_604e) = 7,
596 _LIEF_EI(CPU_SUBTYPE_POWERPC_620) = 8,
597 _LIEF_EI(CPU_SUBTYPE_POWERPC_750) = 9,
598 _LIEF_EI(CPU_SUBTYPE_POWERPC_7400) = 10,
599 _LIEF_EI(CPU_SUBTYPE_POWERPC_7450) = 11,
600 _LIEF_EI(CPU_SUBTYPE_POWERPC_970) = 100,
601
602 _LIEF_EI(CPU_SUBTYPE_MC980000_ALL) = 0, /* CPU_SUBTYPE_POWERPC_ALL, */
603 _LIEF_EI(CPU_SUBTYPE_MC98601) = 1, /* CPU_SUBTYPE_POWERPC_601 */
604};
605
606
#define _LIEF_EI(X)
Definition enums.hpp:22
#define _LIEF_EN_2(N, TYPE)
Definition enums.hpp:21
#define _LIEF_EN(N)
Definition enums.hpp:20