LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
DynamicFixupARM64X.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_ARM64X_H
17#define LIEF_PE_LOAD_CONFIGURATION_DYNAMIC_FIXUP_ARM64X_H
19#include <memory>
20#include <vector>
21
22#include "LIEF/iterators.hpp"
23
24
25namespace LIEF::PE {
26
29 public:
30 enum class FIXUP_TYPE {
31 ZEROFILL = 0,
32 VALUE = 1,
33 DELTA = 2,
34 };
35
38 uint32_t rva = 0;
39
42
44 size_t size = 0;
45
48 std::vector<uint8_t> bytes;
49
51 int64_t value = 0;
52
53 std::string to_string() const;
54
55 LIEF_API friend std::ostream& operator<<(std::ostream& os,
56 const reloc_entry_t& entry) {
57 os << entry.to_string();
58 return os;
59 }
60 };
61
62 using reloc_entries_t = std::vector<reloc_entry_t>;
65
68
71
74
75 std::unique_ptr<DynamicFixup> clone() const override {
76 return std::make_unique<DynamicFixupARM64X>(*this);
77 }
78
79 std::string to_string() const override;
80
83 return entries_;
84 }
85
87 return entries_;
88 }
89
90 static bool classof(const DynamicFixup* fixup) {
91 return fixup->kind() == KIND::ARM64X;
92 }
93
94 ~DynamicFixupARM64X() override = default;
95
97 LIEF_LOCAL static std::unique_ptr<DynamicFixupARM64X> parse(Parser& ctx,
98 SpanStream& strm);
99
100 private:
101 reloc_entries_t entries_;
102};
103
104
105}
106
107
108#endif
DynamicFixupARM64X(DynamicFixupARM64X &&)=default
DynamicFixupARM64X()
Definition DynamicFixupARM64X.hpp:66
FIXUP_TYPE
Definition DynamicFixupARM64X.hpp:30
@ ZEROFILL
Definition DynamicFixupARM64X.hpp:31
ref_iterator< reloc_entries_t & > it_relocations
Definition DynamicFixupARM64X.hpp:63
static bool classof(const DynamicFixup *fixup)
Definition DynamicFixupARM64X.hpp:90
DynamicFixupARM64X & operator=(const DynamicFixupARM64X &)=default
it_const_relocations relocations() const
Definition DynamicFixupARM64X.hpp:86
std::unique_ptr< DynamicFixup > clone() const override
Definition DynamicFixupARM64X.hpp:75
~DynamicFixupARM64X() override=default
DynamicFixupARM64X(const DynamicFixupARM64X &)=default
DynamicFixupARM64X & operator=(DynamicFixupARM64X &&)=default
std::vector< reloc_entry_t > reloc_entries_t
Definition DynamicFixupARM64X.hpp:62
const_ref_iterator< const reloc_entries_t & > it_const_relocations
Definition DynamicFixupARM64X.hpp:64
std::string to_string() const override
it_relocations relocations()
Iterator over the different fixup entries.
Definition DynamicFixupARM64X.hpp:82
KIND
Definition DynamicFixup.hpp:36
@ ARM64X
If DynamicRelocation::symbol is set to IMAGE_DYNAMIC_RELOCATION_ARM64X.
Definition DynamicFixup.hpp:45
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
Definition DynamicFixupARM64X.hpp:36
int64_t value
If the type is FIXUP_TYPE::DELTA, the (signed) value.
Definition DynamicFixupARM64X.hpp:51
uint32_t rva
RVA where the fixup takes place.
Definition DynamicFixupARM64X.hpp:38
std::string to_string() const
size_t size
Size of the value to patch.
Definition DynamicFixupARM64X.hpp:44
std::vector< uint8_t > bytes
If the type is FIXUP_TYPE::VALUE, the bytes associated to the fixup entry.
Definition DynamicFixupARM64X.hpp:48
friend std::ostream & operator<<(std::ostream &os, const reloc_entry_t &entry)
Definition DynamicFixupARM64X.hpp:55
FIXUP_TYPE type
Fixup's kind.
Definition DynamicFixupARM64X.hpp:41
#define LIEF_API
Definition visibility.h:45
#define LIEF_LOCAL
Definition visibility.h:46