LIEF: Library to Instrument Executable Formats Version 0.17.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 _LIEF_EI(LC_ATOM_INFO) = 0x00000036u,
114};
115
116
117enum {
118 /* Flags for the "cmd" field in llvm::MachO::load_command */
119 _LIEF_EI(LC_REQ_DYLD) = 0x80000000u
120 };
121
122
123enum _LIEF_EN(MACHO_SEGMENTS_FLAGS) {
124 /* Constant bits for the "flags" field in llvm::MachO::segment_command */
125 _LIEF_EI(SG_HIGHVM) = 0x1u,
126 _LIEF_EI(SG_FVMLIB) = 0x2u,
127 _LIEF_EI(SG_NORELOC) = 0x4u,
128 _LIEF_EI(SG_PROTECTED_VERSION_1) = 0x8u,
129};
130
131enum _LIEF_EN(SECTION_FLAGS_HELPER) {
132 /* Constant masks for the "flags" field in llvm::MachO::section and */
133 /* llvm::MachO::section_64 */
134 _LIEF_EI(SECTION_TYPE_MASK) = 0x000000ffu, /* SECTION_TYPE */
135 _LIEF_EI(SECTION_FLAGS_MASK) = 0xffffff00u, /* SECTION_ATTRIBUTES */
136 _LIEF_EI(SECTION_FLAGS_USR_MASK) = 0xff000000u, /* SECTION_ATTRIBUTES_USR */
137 _LIEF_EI(SECTION_FLAGS_SYS_MASK) = 0x00ffff00u /* SECTION_ATTRIBUTES_SYS */
138};
139
144enum _LIEF_EN(MACHO_SECTION_TYPES) {
145 /* Constant masks for the "flags[7:0]" field in llvm::MachO::section and */
146 /* llvm::MachO::section_64 (mask "flags" with SECTION_TYPE) */
147 _LIEF_EI(S_REGULAR) = 0x00u,
148 _LIEF_EI(S_ZEROFILL) = 0x01u,
149 _LIEF_EI(S_CSTRING_LITERALS) = 0x02u,
150 _LIEF_EI(S_4BYTE_LITERALS) = 0x03u,
151 _LIEF_EI(S_8BYTE_LITERALS) = 0x04u,
152 _LIEF_EI(S_LITERAL_POINTERS) = 0x05u,
153 _LIEF_EI(S_NON_LAZY_SYMBOL_POINTERS) = 0x06u,
154 _LIEF_EI(S_LAZY_SYMBOL_POINTERS) = 0x07u,
155 _LIEF_EI(S_SYMBOL_STUBS) = 0x08u,
156 _LIEF_EI(S_MOD_INIT_FUNC_POINTERS) = 0x09u,
157 _LIEF_EI(S_MOD_TERM_FUNC_POINTERS) = 0x0au,
158 _LIEF_EI(S_COALESCED) = 0x0bu,
159 _LIEF_EI(S_GB_ZEROFILL) = 0x0cu,
160 _LIEF_EI(S_INTERPOSING) = 0x0du,
161 _LIEF_EI(S_16BYTE_LITERALS) = 0x0eu,
162 _LIEF_EI(S_DTRACE_DOF) = 0x0fu,
163 _LIEF_EI(S_LAZY_DYLIB_SYMBOL_POINTERS) = 0x10u,
164 _LIEF_EI(S_THREAD_LOCAL_REGULAR) = 0x11u,
165 _LIEF_EI(S_THREAD_LOCAL_ZEROFILL) = 0x12u,
166 _LIEF_EI(S_THREAD_LOCAL_VARIABLES) = 0x13u,
167 _LIEF_EI(S_THREAD_LOCAL_VARIABLE_POINTERS) = 0x14u,
168 _LIEF_EI(S_THREAD_LOCAL_INIT_FUNCTION_POINTERS) = 0x15u,
169
170 _LIEF_EI(LAST_KNOWN_SECTION_TYPE) = 0x15u, /* S_THREAD_LOCAL_INIT_FUNCTION_POINTERS */
171};
172
173enum _LIEF_EN(MACHO_SECTION_FLAGS) {
174
175 /* Constant masks for the "flags[31:24]" field in llvm::MachO::section and */
176 /* llvm::MachO::section_64 (mask "flags" with SECTION_ATTRIBUTES_USR) */
177 _LIEF_EI(S_ATTR_PURE_INSTRUCTIONS) = 0x80000000u,
178 _LIEF_EI(S_ATTR_NO_TOC) = 0x40000000u,
179 _LIEF_EI(S_ATTR_STRIP_STATIC_SYMS) = 0x20000000u,
180 _LIEF_EI(S_ATTR_NO_DEAD_STRIP) = 0x10000000u,
181 _LIEF_EI(S_ATTR_LIVE_SUPPORT) = 0x08000000u,
182 _LIEF_EI(S_ATTR_SELF_MODIFYING_CODE) = 0x04000000u,
183 _LIEF_EI(S_ATTR_DEBUG) = 0x02000000u,
184
185 /* Constant masks for the "flags[23:8]" field in llvm::MachO::section and */
186 /* llvm::MachO::section_64 (mask "flags" with SECTION_ATTRIBUTES_SYS) */
187 _LIEF_EI(S_ATTR_SOME_INSTRUCTIONS) = 0x00000400u,
188 _LIEF_EI(S_ATTR_EXT_RELOC) = 0x00000200u,
189 _LIEF_EI(S_ATTR_LOC_RELOC) = 0x00000100u,
190
191 /* Constant masks for the value of an indirect symbol in an indirect */
192 /* symbol table */
193 _LIEF_EI(INDIRECT_SYMBOL_LOCAL) = 0x80000000u,
194 _LIEF_EI(INDIRECT_SYMBOL_ABS) = 0x40000000u
195};
196
197
198enum _LIEF_EN(DataRegionType) {
199 /* Constants for the "kind" field in a data_in_code_entry structure */
200 _LIEF_EI(DICE_KIND_DATA) = 1u,
201 _LIEF_EI(DICE_KIND_JUMP_TABLE8) = 2u,
202 _LIEF_EI(DICE_KIND_JUMP_TABLE16) = 3u,
203 _LIEF_EI(DICE_KIND_JUMP_TABLE32) = 4u,
204 _LIEF_EI(DICE_KIND_ABS_JUMP_TABLE32) = 5u
205};
206
207enum _LIEF_EN(REBASE_TYPES) {
208 _LIEF_EI(REBASE_TYPE_POINTER) = 1u,
209 _LIEF_EI(REBASE_TYPE_TEXT_ABSOLUTE32) = 2u,
210 _LIEF_EI(REBASE_TYPE_TEXT_PCREL32) = 3u,
211 _LIEF_EI(REBASE_TYPE_THREADED) = 102u,
212};
213
214enum {
215 _LIEF_EI(REBASE_OPCODE_MASK) = 0xF0u,
216 _LIEF_EI(REBASE_IMMEDIATE_MASK) = 0x0Fu
217};
218
219
221enum _LIEF_EN_2(REBASE_OPCODES, uint8_t) {
222 _LIEF_EI(REBASE_OPCODE_DONE) = 0x00u,
223 _LIEF_EI(REBASE_OPCODE_SET_TYPE_IMM) = 0x10u,
224 _LIEF_EI(REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB) = 0x20u,
225 _LIEF_EI(REBASE_OPCODE_ADD_ADDR_ULEB) = 0x30u,
226 _LIEF_EI(REBASE_OPCODE_ADD_ADDR_IMM_SCALED) = 0x40u,
227 _LIEF_EI(REBASE_OPCODE_DO_REBASE_IMM_TIMES) = 0x50u,
228 _LIEF_EI(REBASE_OPCODE_DO_REBASE_ULEB_TIMES) = 0x60u,
229 _LIEF_EI(REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB) = 0x70u,
230 _LIEF_EI(REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB) = 0x80u
231};
232
233
238enum _LIEF_EN(BINDING_CLASS) {
239 _LIEF_EI(BIND_CLASS_WEAK) = 1u,
240 _LIEF_EI(BIND_CLASS_LAZY) = 2u,
241 _LIEF_EI(BIND_CLASS_STANDARD) = 3u,
242 _LIEF_EI(BIND_CLASS_THREADED) = 100u
243};
244
245
246enum _LIEF_EN(BIND_TYPES) {
247 _LIEF_EI(BIND_TYPE_POINTER) = 1u,
248 _LIEF_EI(BIND_TYPE_TEXT_ABSOLUTE32) = 2u,
249 _LIEF_EI(BIND_TYPE_TEXT_PCREL32) = 3u
250};
251
252enum _LIEF_EN_2(BIND_SPECIAL_DYLIB, int) {
253 _LIEF_EI(BIND_SPECIAL_DYLIB_SELF) = 0,
254 _LIEF_EI(BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE) = -1,
255 _LIEF_EI(BIND_SPECIAL_DYLIB_FLAT_LOOKUP) = -2
256};
257
258enum {
259 _LIEF_EI(BIND_SYMBOL_FLAGS_WEAK_IMPORT) = 0x1u,
260 _LIEF_EI(BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION) = 0x8u,
261
262 _LIEF_EI(BIND_OPCODE_MASK) = 0xF0u,
263 _LIEF_EI(BIND_IMMEDIATE_MASK) = 0x0Fu
264};
265
267enum _LIEF_EN_2(BIND_OPCODES, uint8_t) {
268 _LIEF_EI(BIND_OPCODE_DONE) = 0x00u,
269 _LIEF_EI(BIND_OPCODE_SET_DYLIB_ORDINAL_IMM) = 0x10u,
270 _LIEF_EI(BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB) = 0x20u,
271 _LIEF_EI(BIND_OPCODE_SET_DYLIB_SPECIAL_IMM) = 0x30u,
272 _LIEF_EI(BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM) = 0x40u,
273 _LIEF_EI(BIND_OPCODE_SET_TYPE_IMM) = 0x50u,
274 _LIEF_EI(BIND_OPCODE_SET_ADDEND_SLEB) = 0x60u,
275 _LIEF_EI(BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB) = 0x70u,
276 _LIEF_EI(BIND_OPCODE_ADD_ADDR_ULEB) = 0x80u,
277 _LIEF_EI(BIND_OPCODE_DO_BIND) = 0x90u,
278 _LIEF_EI(BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB) = 0xA0u,
279 _LIEF_EI(BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED) = 0xB0u,
280 _LIEF_EI(BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB) = 0xC0u,
281 _LIEF_EI(BIND_OPCODE_THREADED) = 0xD0u,
282
283 _LIEF_EI(BIND_OPCODE_THREADED_APPLY) = 0xD0u | 0x01u,
284 _LIEF_EI(BIND_OPCODE_THREADED_SET_BIND_ORDINAL_TABLE_SIZE_ULEB) = 0xD0u | 0x00u,
285};
286
287enum _LIEF_EN_2(BIND_SUBOPCODE_THREADED, uint8_t) {
288 _LIEF_EI(BIND_SUBOPCODE_THREADED_SET_BIND_ORDINAL_TABLE_SIZE_ULEB) = 0x00u,
289 _LIEF_EI(BIND_SUBOPCODE_THREADED_APPLY) = 0x01u,
290};
291
292enum _LIEF_EN(EXPORT_SYMBOL_FLAGS) {
293 _LIEF_EI(EXPORT_SYMBOL_FLAGS_KIND_MASK) = 0x03u,
294 _LIEF_EI(EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION) = 0x04u,
295 _LIEF_EI(EXPORT_SYMBOL_FLAGS_REEXPORT) = 0x08u,
296 _LIEF_EI(EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER) = 0x10u
297};
298
299enum _LIEF_EN(EXPORT_SYMBOL_KINDS) {
300 _LIEF_EI(EXPORT_SYMBOL_FLAGS_KIND_REGULAR) = 0x00u,
301 _LIEF_EI(EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL) = 0x01u,
302 _LIEF_EI(EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE) = 0x02u
303};
304
305enum _LIEF_EN(MACHO_SYMBOL_TYPES) {
306 _LIEF_EI(N_STAB) = 0xe0,
307 _LIEF_EI(N_PEXT) = 0x10,
308 _LIEF_EI(N_TYPE) = 0x0e,
309 _LIEF_EI(N_EXT) = 0x01
310};
311
313enum _LIEF_EN(N_LIST_TYPES) {
314 _LIEF_EI(N_UNDF) = 0x0u,
315 _LIEF_EI(N_ABS) = 0x2u,
316 _LIEF_EI(N_SECT) = 0xeu,
317 _LIEF_EI(N_PBUD) = 0xcu,
318 _LIEF_EI(N_INDR) = 0xau
319};
320
321enum _LIEF_EN(SectionOrdinal) {
322 /* Constants for the "n_sect" field in llvm::MachO::nlist and */
323 /* llvm::MachO::nlist_64 */
324 _LIEF_EI(NO_SECT) = 0u,
325 _LIEF_EI(MAX_SECT) = 0xffu
326};
327
328enum _LIEF_EN(SYMBOL_DESCRIPTIONS) {
329
330 /* The low 3 bits are the for the REFERENCE_TYPE. */
331 _LIEF_EI(REFERENCE_TYPE) = 0x7,
332 _LIEF_EI(REFERENCE_FLAG_UNDEFINED_NON_LAZY) = 0,
333 _LIEF_EI(REFERENCE_FLAG_UNDEFINED_LAZY) = 1,
334 _LIEF_EI(REFERENCE_FLAG_DEFINED) = 2,
335 _LIEF_EI(REFERENCE_FLAG_PRIVATE_DEFINED) = 3,
336 _LIEF_EI(REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY) = 4,
337 _LIEF_EI(REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY) = 5,
338
339 /* Flag bits (some overlap with the library ordinal bits). */
340 _LIEF_EI(N_ARM_THUMB_DEF) = 0x0008u,
341 _LIEF_EI(REFERENCED_DYNAMICALLY) = 0x0010u,
342 _LIEF_EI(N_NO_DEAD_STRIP) = 0x0020u,
343 _LIEF_EI(N_WEAK_REF) = 0x0040u,
344 _LIEF_EI(N_WEAK_DEF) = 0x0080u,
345 _LIEF_EI(N_SYMBOL_RESOLVER) = 0x0100u,
346 _LIEF_EI(N_ALT_ENTRY) = 0x0200u,
347
348 /* For undefined symbols coming from libraries, see GET_LIBRARY_ORDINAL() */
349 /* as these are in the top 8 bits. */
350 _LIEF_EI(SELF_LIBRARY_ORDINAL) = 0x0,
351 _LIEF_EI(MAX_LIBRARY_ORDINAL) = 0xfd,
352 _LIEF_EI(DYNAMIC_LOOKUP_ORDINAL) = 0xfe,
353 _LIEF_EI(EXECUTABLE_ORDINAL) = 0xff
354};
355
356enum _LIEF_EN(StabType) {
357 /* Constant values for the "n_type" field in llvm::MachO::nlist and */
358 /* llvm::MachO::nlist_64 when "(n_type & N_STAB) != 0" */
359 _LIEF_EI(N_GSYM) = 0x20u,
360 _LIEF_EI(N_FNAME) = 0x22u,
361 _LIEF_EI(N_FUN) = 0x24u,
362 _LIEF_EI(N_STSYM) = 0x26u,
363 _LIEF_EI(N_LCSYM) = 0x28u,
364 _LIEF_EI(N_BNSYM) = 0x2Eu,
365 _LIEF_EI(N_PC) = 0x30u,
366 _LIEF_EI(N_AST) = 0x32u,
367 _LIEF_EI(N_OPT) = 0x3Cu,
368 _LIEF_EI(N_RSYM) = 0x40u,
369 _LIEF_EI(N_SLINE) = 0x44u,
370 _LIEF_EI(N_ENSYM) = 0x4Eu,
371 _LIEF_EI(N_SSYM) = 0x60u,
372 _LIEF_EI(N_SO) = 0x64u,
373 _LIEF_EI(N_OSO) = 0x66u,
374 _LIEF_EI(N_LSYM) = 0x80u,
375 _LIEF_EI(N_BINCL) = 0x82u,
376 _LIEF_EI(N_SOL) = 0x84u,
377 _LIEF_EI(N_PARAMS) = 0x86u,
378 _LIEF_EI(N_VERSION) = 0x88u,
379 _LIEF_EI(N_OLEVEL) = 0x8Au,
380 _LIEF_EI(N_PSYM) = 0xA0u,
381 _LIEF_EI(N_EINCL) = 0xA2u,
382 _LIEF_EI(N_ENTRY) = 0xA4u,
383 _LIEF_EI(N_LBRAC) = 0xC0u,
384 _LIEF_EI(N_EXCL) = 0xC2u,
385 _LIEF_EI(N_RBRAC) = 0xE0u,
386 _LIEF_EI(N_BCOMM) = 0xE2u,
387 _LIEF_EI(N_ECOMM) = 0xE4u,
388 _LIEF_EI(N_ECOML) = 0xE8u,
389 _LIEF_EI(N_LENG) = 0xFEu
390};
391
392
393enum {
394 /* Constant values for the r_symbolnum field in an */
395 /* llvm::MachO::relocation_info structure when r_extern is 0. */
396 _LIEF_EI(R_ABS) = 0,
397
398 /* Constant bits for the r_address field in an */
399 /* llvm::MachO::relocation_info structure. */
400 _LIEF_EI(R_SCATTERED) = 0x80000000
401};
402
403enum _LIEF_EN(RELOCATION_ORIGINS) {
404 _LIEF_EI(ORIGIN_UNKNOWN) = 0,
405 _LIEF_EI(ORIGIN_DYLDINFO) = 1,
406 _LIEF_EI(ORIGIN_RELOC_TABLE) = 2,
407};
408
409
410enum _LIEF_EN(SYMBOL_ORIGINS) {
411 _LIEF_EI(SYM_ORIGIN_UNKNOWN) = 0,
412 _LIEF_EI(SYM_ORIGIN_DYLD_EXPORT) = 1,
413 _LIEF_EI(SYM_ORIGIN_DYLD_BIND) = 2,
414 _LIEF_EI(SYM_ORIGIN_LC_SYMTAB) = 3,
415};
416
417enum _LIEF_EN(X86_RELOCATION) {
418 _LIEF_EI(GENERIC_RELOC_VANILLA) = 0,
419 _LIEF_EI(GENERIC_RELOC_PAIR) = 1,
420 _LIEF_EI(GENERIC_RELOC_SECTDIFF) = 2,
421 _LIEF_EI(GENERIC_RELOC_PB_LA_PTR) = 3,
422 _LIEF_EI(GENERIC_RELOC_LOCAL_SECTDIFF) = 4,
423 _LIEF_EI(GENERIC_RELOC_TLV) = 5,
424};
425
426
427enum _LIEF_EN(X86_64_RELOCATION) {
428 _LIEF_EI(X86_64_RELOC_UNSIGNED) = 0,
429 _LIEF_EI(X86_64_RELOC_SIGNED) = 1,
430 _LIEF_EI(X86_64_RELOC_BRANCH) = 2,
431 _LIEF_EI(X86_64_RELOC_GOT_LOAD) = 3,
432 _LIEF_EI(X86_64_RELOC_GOT) = 4,
433 _LIEF_EI(X86_64_RELOC_SUBTRACTOR) = 5,
434 _LIEF_EI(X86_64_RELOC_SIGNED_1) = 6,
435 _LIEF_EI(X86_64_RELOC_SIGNED_2) = 7,
436 _LIEF_EI(X86_64_RELOC_SIGNED_4) = 8,
437 _LIEF_EI(X86_64_RELOC_TLV) = 9,
438};
439
440
441enum _LIEF_EN(PPC_RELOCATION) {
442 _LIEF_EI(PPC_RELOC_VANILLA) = 0,
443 _LIEF_EI(PPC_RELOC_PAIR) = 1,
444 _LIEF_EI(PPC_RELOC_BR14) = 2,
445 _LIEF_EI(PPC_RELOC_BR24) = 3,
446 _LIEF_EI(PPC_RELOC_HI16) = 4,
447 _LIEF_EI(PPC_RELOC_LO16) = 5,
448 _LIEF_EI(PPC_RELOC_HA16) = 6,
449 _LIEF_EI(PPC_RELOC_LO14) = 7,
450 _LIEF_EI(PPC_RELOC_SECTDIFF) = 8,
451 _LIEF_EI(PPC_RELOC_PB_LA_PTR) = 9,
452 _LIEF_EI(PPC_RELOC_HI16_SECTDIFF) = 10,
453 _LIEF_EI(PPC_RELOC_LO16_SECTDIFF) = 11,
454 _LIEF_EI(PPC_RELOC_HA16_SECTDIFF) = 12,
455 _LIEF_EI(PPC_RELOC_JBSR) = 13,
456 _LIEF_EI(PPC_RELOC_LO14_SECTDIFF) = 14,
457 _LIEF_EI(PPC_RELOC_LOCAL_SECTDIFF) = 15,
458};
459
460
461enum _LIEF_EN(ARM_RELOCATION) {
462 _LIEF_EI(ARM_RELOC_VANILLA) = 0,
463 _LIEF_EI(ARM_RELOC_PAIR) = 1,
464 _LIEF_EI(ARM_RELOC_SECTDIFF) = 2,
465 _LIEF_EI(ARM_RELOC_LOCAL_SECTDIFF) = 3,
466 _LIEF_EI(ARM_RELOC_PB_LA_PTR) = 4,
467 _LIEF_EI(ARM_RELOC_BR24) = 5,
468 _LIEF_EI(ARM_THUMB_RELOC_BR22) = 6,
469 _LIEF_EI(ARM_THUMB_32BIT_BRANCH) = 7, /* obsolete */
470 _LIEF_EI(ARM_RELOC_HALF) = 8,
471 _LIEF_EI(ARM_RELOC_HALF_SECTDIFF) = 9,
472};
473
474
475enum _LIEF_EN(ARM64_RELOCATION) {
476 _LIEF_EI(ARM64_RELOC_UNSIGNED) = 0,
477 _LIEF_EI(ARM64_RELOC_SUBTRACTOR) = 1,
478 _LIEF_EI(ARM64_RELOC_BRANCH26) = 2,
479 _LIEF_EI(ARM64_RELOC_PAGE21) = 3,
480 _LIEF_EI(ARM64_RELOC_PAGEOFF12) = 4,
481 _LIEF_EI(ARM64_RELOC_GOT_LOAD_PAGE21) = 5,
482 _LIEF_EI(ARM64_RELOC_GOT_LOAD_PAGEOFF12) = 6,
483 _LIEF_EI(ARM64_RELOC_POINTER_TO_GOT) = 7,
484 _LIEF_EI(ARM64_RELOC_TLVP_LOAD_PAGE21) = 8,
485 _LIEF_EI(ARM64_RELOC_TLVP_LOAD_PAGEOFF12) = 9,
486 _LIEF_EI(ARM64_RELOC_ADDEND) = 10,
487};
488
490enum _LIEF_EN(VM_PROTECTIONS) {
491 _LIEF_EI(VM_PROT_READ) = 0x1,
492 _LIEF_EI(VM_PROT_WRITE) = 0x2,
493 _LIEF_EI(VM_PROT_EXECUTE) = 0x4,
494};
495
496
497/* Enums from <mach/machine.h> */
498enum {
499 /* Capability bits used in the definition of cpu_type. */
500 _LIEF_EI(CPU_ARCH_MASK) = 0xff000000, /* Mask for architecture bits */
501 _LIEF_EI(CPU_ARCH_ABI64) = 0x01000000 /* 64 bit ABI */
502};
503
504/* Constants for the cputype field. */
505enum _LIEF_EN_2(CPU_TYPES, int) {
506 _LIEF_EI(CPU_TYPE_ANY) = -1,
507 _LIEF_EI(CPU_TYPE_X86) = 7,
508 _LIEF_EI(CPU_TYPE_I386) = 7, /* CPU_TYPE_X86, */
509 _LIEF_EI(CPU_TYPE_X86_64) = 7 | 0x01000000, /* CPU_TYPE_X86 | CPU_ARCH_ABI64, */
510/* _LIEF_EI(CPU_TYPE_MIPS) = 8, */
511 _LIEF_EI(CPU_TYPE_MC98000) = 10, /* Old Motorola PowerPC */
512 _LIEF_EI(CPU_TYPE_ARM) = 12,
513 _LIEF_EI(CPU_TYPE_ARM64) = 12 | 0x01000000, /* CPU_TYPE_ARM | CPU_ARCH_ABI64, */
514 _LIEF_EI(CPU_TYPE_SPARC) = 14,
515 _LIEF_EI(CPU_TYPE_POWERPC) = 18,
516 _LIEF_EI(CPU_TYPE_POWERPC64) = 18 | 0x01000000, /* CPU_TYPE_POWERPC | CPU_ARCH_ABI64 */
517};
518
519enum {
520 /* Capability bits used in the definition of cpusubtype. */
521 _LIEF_EI(CPU_SUBTYPE_MASK) = 0xff000000, /* Mask for architecture bits */
522 _LIEF_EI(CPU_SUBTYPE_LIB64) = 0x80000000, /* 64 bit libraries */
523
524 /* Special CPU subtype constants. */
525 _LIEF_EI(CPU_SUBTYPE_MULTIPLE) = ~0u
526};
527
528/* Constants for the cpusubtype field. */
529enum _LIEF_EN(CPU_SUBTYPES_X86) {
530 _LIEF_EI(CPU_SUBTYPE_I386_ALL) = 3,
531 _LIEF_EI(CPU_SUBTYPE_386) = 3,
532 _LIEF_EI(CPU_SUBTYPE_486) = 4,
533 _LIEF_EI(CPU_SUBTYPE_486SX) = 0x84,
534 _LIEF_EI(CPU_SUBTYPE_586) = 5,
535 _LIEF_EI(CPU_SUBTYPE_PENT) = 5, /* CPU_SUBTYPE_586, */
536 _LIEF_EI(CPU_SUBTYPE_PENTPRO) = 0x16,
537 _LIEF_EI(CPU_SUBTYPE_PENTII_M3) = 0x36,
538 _LIEF_EI(CPU_SUBTYPE_PENTII_M5) = 0x56,
539 _LIEF_EI(CPU_SUBTYPE_CELERON) = 0x67,
540 _LIEF_EI(CPU_SUBTYPE_CELERON_MOBILE) = 0x77,
541 _LIEF_EI(CPU_SUBTYPE_PENTIUM_3) = 0x08,
542 _LIEF_EI(CPU_SUBTYPE_PENTIUM_3_M) = 0x18,
543 _LIEF_EI(CPU_SUBTYPE_PENTIUM_3_XEON) = 0x28,
544 _LIEF_EI(CPU_SUBTYPE_PENTIUM_M) = 0x09,
545 _LIEF_EI(CPU_SUBTYPE_PENTIUM_4) = 0x0a,
546 _LIEF_EI(CPU_SUBTYPE_PENTIUM_4_M) = 0x1a,
547 _LIEF_EI(CPU_SUBTYPE_ITANIUM) = 0x0b,
548 _LIEF_EI(CPU_SUBTYPE_ITANIUM_2) = 0x1b,
549 _LIEF_EI(CPU_SUBTYPE_XEON) = 0x0c,
550 _LIEF_EI(CPU_SUBTYPE_XEON_MP) = 0x1c,
551
552 _LIEF_EI(CPU_SUBTYPE_X86_ALL) = 3,
553 _LIEF_EI(CPU_SUBTYPE_X86_64_ALL) = 3,
554 _LIEF_EI(CPU_SUBTYPE_X86_ARCH1) = 4,
555 _LIEF_EI(CPU_SUBTYPE_X86_64_H) = 8
556};
557
558
559enum {
560 _LIEF_EI(CPU_SUBTYPE_INTEL_FAMILY_MAX) = 15,
561 _LIEF_EI(CPU_SUBTYPE_INTEL_MODEL_ALL) = 0
562};
563
564enum _LIEF_EN(CPU_SUBTYPES_ARM) {
565 _LIEF_EI(CPU_SUBTYPE_ARM_ALL) = 0,
566 _LIEF_EI(CPU_SUBTYPE_ARM_V4T) = 5,
567 _LIEF_EI(CPU_SUBTYPE_ARM_V6) = 6,
568 _LIEF_EI(CPU_SUBTYPE_ARM_V5) = 7,
569 _LIEF_EI(CPU_SUBTYPE_ARM_V5TEJ) = 7,
570 _LIEF_EI(CPU_SUBTYPE_ARM_XSCALE) = 8,
571 _LIEF_EI(CPU_SUBTYPE_ARM_V7) = 9,
572 /* unused _LIEF_EI(ARM_V7F) = 10, */
573 _LIEF_EI(CPU_SUBTYPE_ARM_V7S) = 11,
574 _LIEF_EI(CPU_SUBTYPE_ARM_V7K) = 12,
575 _LIEF_EI(CPU_SUBTYPE_ARM_V6M) = 14,
576 _LIEF_EI(CPU_SUBTYPE_ARM_V7M) = 15,
577 _LIEF_EI(CPU_SUBTYPE_ARM_V7EM) = 16
578};
579
580enum _LIEF_EN(CPU_SUBTYPES_ARM64) {
581 _LIEF_EI(CPU_SUBTYPE_ARM64_ALL) = 0
582};
583
584enum _LIEF_EN(CPU_SUBTYPES_SPARC) {
585 _LIEF_EI(CPU_SUBTYPE_SPARC_ALL) = 0
586};
587
588enum _LIEF_EN(CPU_SUBTYPES_POWERPC) {
589 _LIEF_EI(CPU_SUBTYPE_POWERPC_ALL) = 0,
590 _LIEF_EI(CPU_SUBTYPE_POWERPC_601) = 1,
591 _LIEF_EI(CPU_SUBTYPE_POWERPC_602) = 2,
592 _LIEF_EI(CPU_SUBTYPE_POWERPC_603) = 3,
593 _LIEF_EI(CPU_SUBTYPE_POWERPC_603e) = 4,
594 _LIEF_EI(CPU_SUBTYPE_POWERPC_603ev) = 5,
595 _LIEF_EI(CPU_SUBTYPE_POWERPC_604) = 6,
596 _LIEF_EI(CPU_SUBTYPE_POWERPC_604e) = 7,
597 _LIEF_EI(CPU_SUBTYPE_POWERPC_620) = 8,
598 _LIEF_EI(CPU_SUBTYPE_POWERPC_750) = 9,
599 _LIEF_EI(CPU_SUBTYPE_POWERPC_7400) = 10,
600 _LIEF_EI(CPU_SUBTYPE_POWERPC_7450) = 11,
601 _LIEF_EI(CPU_SUBTYPE_POWERPC_970) = 100,
602
603 _LIEF_EI(CPU_SUBTYPE_MC980000_ALL) = 0, /* CPU_SUBTYPE_POWERPC_ALL, */
604 _LIEF_EI(CPU_SUBTYPE_MC98601) = 1, /* CPU_SUBTYPE_POWERPC_601 */
605};
606
607
#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