LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
DynamicFixupARM64Kernel.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2026 R. Thomas
2 * Copyright 2017 - 2026 Quarkslab
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef LIEF_PE_LOAD_CONFIGURATION_DYNAMIC_FIXUP_ARM64_KERNEL_H
17#define LIEF_PE_LOAD_CONFIGURATION_DYNAMIC_FIXUP_ARM64_KERNEL_H
19#include <memory>
20#include <vector>
21
22#include "LIEF/iterators.hpp"
23
24
25namespace LIEF::PE {
26
30 public:
31 static constexpr auto NO_IAT_INDEX = 0x7fff;
32
33 enum class IMPORT_TYPE : uint8_t {
34 STATIC = 0,
35 DELAYED = 1,
36 };
37
41 uint32_t rva = 0;
42
44 bool indirect_call = false;
45
48 uint8_t register_index = 0;
49
52
56
57 std::string to_string() const;
58
59 friend LIEF_API std::ostream& operator<<(std::ostream& os,
60 const reloc_entry_t& entry) {
61 os << entry.to_string();
62 return os;
63 }
64 };
65
66 using reloc_entries_t = std::vector<reloc_entry_t>;
69
72
75
78
79 std::unique_ptr<DynamicFixup> clone() const override {
80 return std::make_unique<DynamicFixupARM64Kernel>(*this);
81 }
82
83 std::string to_string() const override;
84
87 return entries_;
88 }
89
91 return entries_;
92 }
93
94 static bool classof(const DynamicFixup* fixup) {
96 }
97
98 ~DynamicFixupARM64Kernel() override = default;
99
101 LIEF_LOCAL static std::unique_ptr<DynamicFixupARM64Kernel>
102 parse(Parser& ctx, SpanStream& strm);
103
104 private:
105 reloc_entries_t entries_;
106};
107
108
109}
110
111
112#endif
DynamicFixupARM64Kernel()
Definition DynamicFixupARM64Kernel.hpp:70
ref_iterator< reloc_entries_t & > it_relocations
Definition DynamicFixupARM64Kernel.hpp:67
~DynamicFixupARM64Kernel() override=default
const_ref_iterator< const reloc_entries_t & > it_const_relocations
Definition DynamicFixupARM64Kernel.hpp:68
std::unique_ptr< DynamicFixup > clone() const override
Definition DynamicFixupARM64Kernel.hpp:79
DynamicFixupARM64Kernel(DynamicFixupARM64Kernel &&)=default
std::string to_string() const override
IMPORT_TYPE
Definition DynamicFixupARM64Kernel.hpp:33
@ STATIC
Definition DynamicFixupARM64Kernel.hpp:34
DynamicFixupARM64Kernel & operator=(const DynamicFixupARM64Kernel &)=default
static bool classof(const DynamicFixup *fixup)
Definition DynamicFixupARM64Kernel.hpp:94
std::vector< reloc_entry_t > reloc_entries_t
Definition DynamicFixupARM64Kernel.hpp:66
DynamicFixupARM64Kernel & operator=(DynamicFixupARM64Kernel &&)=default
it_const_relocations relocations() const
Definition DynamicFixupARM64Kernel.hpp:90
it_relocations relocations()
Iterator over the relocations.
Definition DynamicFixupARM64Kernel.hpp:86
DynamicFixupARM64Kernel(const DynamicFixupARM64Kernel &)=default
static constexpr auto NO_IAT_INDEX
Definition DynamicFixupARM64Kernel.hpp:31
KIND
Definition DynamicFixup.hpp:36
@ ARM64_KERNEL_IMPORT_CALL_TRANSFER
If DynamicRelocation::symbol is set to IMAGE_DYNAMIC_RELOCATION_ARM64_KERNEL_IMPORT_CALL_TRANSFER.
Definition DynamicFixup.hpp:53
KIND kind() const
Encoding of the fixups.
Definition DynamicFixup.hpp:75
Main interface to parse PE binaries. In particular, the static Parser::parse functions should be used...
Definition PE/Parser.hpp:53
Definition SpanStream.hpp:32
Iterator which returns reference on container's values.
Definition iterators.hpp:47
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
ref_iterator< CT, U, typename decay_t< CT >::const_iterator > const_ref_iterator
Iterator which returns a const ref on container's values.
Definition iterators.hpp:316
Mirror IMAGE_IMPORT_CONTROL_TRANSFER_ARM64_RELOCATION.
Definition DynamicFixupARM64Kernel.hpp:39
uint16_t iat_index
IAT index of the corresponding import. 0x7FFF is a special value indicating no index.
Definition DynamicFixupARM64Kernel.hpp:55
uint32_t rva
RVA to the call instruction.
Definition DynamicFixupARM64Kernel.hpp:41
IMPORT_TYPE import_type
See IMPORT_TYPE.
Definition DynamicFixupARM64Kernel.hpp:51
friend std::ostream & operator<<(std::ostream &os, const reloc_entry_t &entry)
Definition DynamicFixupARM64Kernel.hpp:59
bool indirect_call
True if target instruction is a blr, false if it's a br.
Definition DynamicFixupARM64Kernel.hpp:44
std::string to_string() const
uint8_t register_index
Register index used for the indirect call/jump. For instance, if the instruction is br x3,...
Definition DynamicFixupARM64Kernel.hpp:48
#define LIEF_API
Definition visibility.h:45
#define LIEF_LOCAL
Definition visibility.h:46