LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
MachO/enums.hpp
1/* Copyright 2021 - 2024 R. Thomas
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15#ifndef LIEF_MACHO_ENUMS_H
16#define LIEF_MACHO_ENUMS_H
17
18#include "LIEF/MachO/undef.h"
19#include <cstdint>
20
21namespace LIEF {
22namespace MachO {
23
24enum class MACHO_TYPES: uint32_t {
25 UNKNOWN = 0,
26 MH_MAGIC = 0xFEEDFACEu,
27 MH_CIGAM = 0xCEFAEDFEu,
28 MH_MAGIC_64 = 0xFEEDFACFu,
29 MH_CIGAM_64 = 0xCFFAEDFEu,
30 FAT_MAGIC = 0xCAFEBABEu,
31 FAT_CIGAM = 0xBEBAFECAu
32};
33
36enum class N_LIST_TYPES: uint64_t {
37 N_UNDF = 0x0u,
38 N_ABS = 0x2u,
39 N_SECT = 0xeu,
40 N_PBUD = 0xcu,
41 N_INDR = 0xau
42};
43
52
60 X86_64_RELOC_SIGNED_1 = 6,
61 X86_64_RELOC_SIGNED_2 = 7,
62 X86_64_RELOC_SIGNED_4 = 8,
63 X86_64_RELOC_TLV = 9,
64};
65
66
67enum class PPC_RELOCATION {
68 PPC_RELOC_VANILLA = 0,
69 PPC_RELOC_PAIR = 1,
70 PPC_RELOC_BR14 = 2,
71 PPC_RELOC_BR24 = 3,
72 PPC_RELOC_HI16 = 4,
73 PPC_RELOC_LO16 = 5,
74 PPC_RELOC_HA16 = 6,
75 PPC_RELOC_LO14 = 7,
76 PPC_RELOC_SECTDIFF = 8,
77 PPC_RELOC_PB_LA_PTR = 9,
78 PPC_RELOC_HI16_SECTDIFF = 10,
79 PPC_RELOC_LO16_SECTDIFF = 11,
80 PPC_RELOC_HA16_SECTDIFF = 12,
81 PPC_RELOC_JBSR = 13,
82 PPC_RELOC_LO14_SECTDIFF = 14,
83 PPC_RELOC_LOCAL_SECTDIFF = 15,
84};
85
86
87enum class ARM_RELOCATION {
88 ARM_RELOC_VANILLA = 0,
89 ARM_RELOC_PAIR = 1,
90 ARM_RELOC_SECTDIFF = 2,
91 ARM_RELOC_LOCAL_SECTDIFF = 3,
92 ARM_RELOC_PB_LA_PTR = 4,
93 ARM_RELOC_BR24 = 5,
94 ARM_THUMB_RELOC_BR22 = 6,
95 ARM_THUMB_32BIT_BRANCH = 7, // obsolete
96 ARM_RELOC_HALF = 8,
97 ARM_RELOC_HALF_SECTDIFF = 9,
98};
99
100
114
115}
116}
117#endif
ARM64_RELOCATION
Definition MachO/enums.hpp:101
X86_64_RELOCATION
Definition MachO/enums.hpp:53
N_LIST_TYPES
Constants for the "n_type & SYMBOL_TYPES::N_TYPE" in nlist.
Definition MachO/enums.hpp:36
@ N_PBUD
The symbol is undefined and the image is using a prebound value for the symbol. Set the n_sect field ...
@ N_INDR
The symbol is defined to be the same as another symbol. The n_value field is an index into the string...
@ N_ABS
The symbol is absolute. The linker doesn't update his value.
@ N_UNDF
The symbol is undefined. It is referenced in a different module.
@ N_SECT
The symbol is defined in the section number given in nlist_base.n_sect .
X86_RELOCATION
Definition MachO/enums.hpp:44
MACHO_TYPES
Definition MachO/enums.hpp:24
@ MH_CIGAM_64
64-bit little-endian magic
@ FAT_MAGIC
big-endian fat magic
@ FAT_CIGAM
little-endian fat magic
@ MH_MAGIC
32-bit big-endian magic
@ MH_CIGAM
32-bit little-endian magic
@ MH_MAGIC_64
64-bit big-endian magic
LIEF namespace.
Definition Abstract/Binary.hpp:32