LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
DynamicFixupARM64X.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2025 R. Thomas
2 * Copyright 2017 - 2025 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_ARM64X_H
17#define LIEF_PE_LOAD_CONFIGURATION_DYNAMIC_FIXUP_ARM64X_H
18#include <vector>
20
21#include "LIEF/iterators.hpp"
22
23namespace LIEF {
24namespace PE {
28 public:
29 enum class FIXUP_TYPE {
30 ZEROFILL = 0,
31 VALUE = 1,
32 DELTA = 2,
33 };
34
35 struct reloc_entry_t { uint32_t rva = 0;
38 FIXUP_TYPE type = FIXUP_TYPE::ZEROFILL;
41 size_t size = 0;
44 std::vector<uint8_t> bytes;
48 int64_t value = 0;
51
52 std::string to_string() const;
53
54 LIEF_API friend
55 std::ostream& operator<<(std::ostream& os, const reloc_entry_t& entry)
56 {
57 os << entry.to_string();
58 return os;
59 }
60 };
61
62 using reloc_entries_t = std::vector<reloc_entry_t>;
63 using it_relocations = ref_iterator<reloc_entries_t&>;
64 using it_const_relocations = const_ref_iterator<const reloc_entries_t&>;
65
67 DynamicFixup(KIND::ARM64X)
68 {}
69
70 DynamicFixupARM64X(const DynamicFixupARM64X&) = default;
71 DynamicFixupARM64X& operator=(const DynamicFixupARM64X&) = default;
72
73 DynamicFixupARM64X(DynamicFixupARM64X&&) = default;
74 DynamicFixupARM64X& operator=(DynamicFixupARM64X&&) = default;
75
76 std::unique_ptr<DynamicFixup> clone() const override {
77 return std::unique_ptr<DynamicFixupARM64X>(new DynamicFixupARM64X(*this));
78 }
79
80 std::string to_string() const override;
81 it_relocations relocations() {
84 return entries_;
85 }
86
87 it_const_relocations relocations() const {
88 return entries_;
89 }
90
91 static bool classof(const DynamicFixup* fixup) {
92 return fixup->kind() == KIND::ARM64X;
93 }
94
95 ~DynamicFixupARM64X() override = default;
96 LIEF_LOCAL static
99 std::unique_ptr<DynamicFixupARM64X> parse(Parser& ctx, SpanStream& strm);
100
101 private:
102 reloc_entries_t entries_;
103
104};
105
106
107}
108}
109
110#endif
This class represents IMAGE_DYNAMIC_RELOCATION_ARM64X
Definition DynamicFixupARM64X.hpp:27
DynamicFixupARM64X(DynamicFixupARM64X &&)=default
DynamicFixupARM64X()
Definition DynamicFixupARM64X.hpp:66
static bool classof(const DynamicFixup *fixup)
Definition DynamicFixupARM64X.hpp:91
DynamicFixupARM64X & operator=(const DynamicFixupARM64X &)=default
it_const_relocations relocations() const
Definition DynamicFixupARM64X.hpp:87
std::unique_ptr< DynamicFixup > clone() const override
Definition DynamicFixupARM64X.hpp:76
~DynamicFixupARM64X() override=default
DynamicFixupARM64X(const DynamicFixupARM64X &)=default
DynamicFixupARM64X & operator=(DynamicFixupARM64X &&)=default
std::string to_string() const override
it_relocations relocations()
Iterator over the different fixup entries.
Definition DynamicFixupARM64X.hpp:83
This is the base class for any fixups located in DynamicRelocation.
Definition DynamicFixup.hpp:34
KIND kind() const
Encoding of the fixups.
Definition DynamicFixup.hpp:73
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF namespace.
Definition Abstract/Binary.hpp:36
std::string to_string() const
friend std::ostream & operator<<(std::ostream &os, const reloc_entry_t &entry)
Definition DynamicFixupARM64X.hpp:55
#define LIEF_API
Definition visibility.h:41
#define LIEF_LOCAL
Definition visibility.h:42