LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
DyldChainedFormat.hpp
1/* Copyright 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_DYLD_CHAINED_FMT_H
16#define LIEF_MACHO_DYLD_CHAINED_FMT_H
17#include "LIEF/visibility.h"
18namespace LIEF {
19namespace MachO {
20
21// values for dyld_chained_fixups_header.imports_format
22enum class DYLD_CHAINED_FORMAT {
23 IMPORT = 1, // Originally: DYLD_CHAINED_IMPORT
24 IMPORT_ADDEND = 2, // Originally: DYLD_CHAINED_IMPORT_ADDEND
25 IMPORT_ADDEND64 = 3, // Originally: DYLD_CHAINED_IMPORT_ADDEND64
26};
27
28// values for dyld_chained_starts_in_segment.pointer_format
29enum DYLD_CHAINED_PTR_FORMAT {
30 PTR_ARM64E = 1, // stride 8, unauth target is vmaddr
31 PTR_64 = 2, // target is vmaddr
32 PTR_32 = 3,
33 PTR_32_CACHE = 4,
34 PTR_32_FIRMWARE = 5,
35 PTR_64_OFFSET = 6, // target is vm offset
36 PTR_ARM64E_OFFSET = 7, // old name
37 PTR_ARM64E_KERNEL = 7, // stride 4, unauth target is vm offset
38 PTR_64_KERNEL_CACHE = 8,
39 PTR_ARM64E_USERLAND = 9, // stride 8, unauth target is vm offset
40 PTR_ARM64E_FIRMWARE = 10, // stride 4, unauth target is vmaddr
41 PTR_X86_64_KERNEL_CACHE = 11, // stride 1, x86_64 kernel caches
42 PTR_ARM64E_USERLAND24 = 12, // stride 8, unauth target is vm offset, 24-bit bind
43};
44
45LIEF_API const char* to_string(DYLD_CHAINED_FORMAT fmt);
46LIEF_API const char* to_string(DYLD_CHAINED_PTR_FORMAT ptr_fmt);
47
48}
49}
50#endif
LIEF namespace.
Definition Abstract/Binary.hpp:31