LIEF: Library to Instrument Executable Formats Version 1.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
18#include <vector>
20
21#include "LIEF/iterators.hpp"
22
23namespace LIEF {
24namespace PE {
25
28 public:
29 enum class FIXUP_TYPE {
30 ZEROFILL = 0,
31 VALUE = 1,
32 DELTA = 2,
33 };
34
37 uint32_t rva = 0;
38
41
43 size_t size = 0;
44
47 std::vector<uint8_t> bytes;
48
50 int64_t value = 0;
51
52 std::string to_string() const;
53
54 LIEF_API friend std::ostream& operator<<(std::ostream& os,
55 const reloc_entry_t& entry) {
56 os << entry.to_string();
57 return os;
58 }
59 };
60
61 using reloc_entries_t = std::vector<reloc_entry_t>;
64
67
70
73
74 std::unique_ptr<DynamicFixup> clone() const override {
75 return std::unique_ptr<DynamicFixupARM64X>(new DynamicFixupARM64X(*this));
76 }
77
78 std::string to_string() const override;
79
82 return entries_;
83 }
84
86 return entries_;
87 }
88
89 static bool classof(const DynamicFixup* fixup) {
90 return fixup->kind() == KIND::ARM64X;
91 }
92
93 ~DynamicFixupARM64X() override = default;
94
96 LIEF_LOCAL static std::unique_ptr<DynamicFixupARM64X> parse(Parser& ctx,
97 SpanStream& strm);
98
99 private:
100 reloc_entries_t entries_;
101};
102
103
104}
105}
106
107#endif
DynamicFixupARM64X(DynamicFixupARM64X &&)=default
DynamicFixupARM64X()
Definition DynamicFixupARM64X.hpp:65
FIXUP_TYPE
Definition DynamicFixupARM64X.hpp:29
@ ZEROFILL
Definition DynamicFixupARM64X.hpp:30
ref_iterator< reloc_entries_t & > it_relocations
Definition DynamicFixupARM64X.hpp:62
static bool classof(const DynamicFixup *fixup)
Definition DynamicFixupARM64X.hpp:89
DynamicFixupARM64X & operator=(const DynamicFixupARM64X &)=default
it_const_relocations relocations() const
Definition DynamicFixupARM64X.hpp:85
std::unique_ptr< DynamicFixup > clone() const override
Definition DynamicFixupARM64X.hpp:74
~DynamicFixupARM64X() override=default
DynamicFixupARM64X(const DynamicFixupARM64X &)=default
DynamicFixupARM64X & operator=(DynamicFixupARM64X &&)=default
std::vector< reloc_entry_t > reloc_entries_t
Definition DynamicFixupARM64X.hpp:61
const_ref_iterator< const reloc_entries_t & > it_const_relocations
Definition DynamicFixupARM64X.hpp:63
std::string to_string() const override
it_relocations relocations()
Iterator over the different fixup entries.
Definition DynamicFixupARM64X.hpp:81
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:52
Definition SpanStream.hpp:32
Iterator which returns reference on container's values.
Definition iterators.hpp:46
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF namespace.
Definition Abstract/Binary.hpp:40
ref_iterator< CT, U, typename decay_t< CT >::const_iterator > const_ref_iterator
Iterator which return const ref on container's values.
Definition iterators.hpp:269
Definition DynamicFixupARM64X.hpp:35
int64_t value
If the type is FIXUP_TYPE::DELTA, the (signed) value.
Definition DynamicFixupARM64X.hpp:50
uint32_t rva
RVA where the fixup takes place.
Definition DynamicFixupARM64X.hpp:37
std::string to_string() const
size_t size
Size of the value to patch.
Definition DynamicFixupARM64X.hpp:43
std::vector< uint8_t > bytes
If the type is FIXUP_TYPE::VALUE, the bytes associated to the fixup entry.
Definition DynamicFixupARM64X.hpp:47
friend std::ostream & operator<<(std::ostream &os, const reloc_entry_t &entry)
Definition DynamicFixupARM64X.hpp:54
FIXUP_TYPE type
Fixup's kind.
Definition DynamicFixupARM64X.hpp:40
#define LIEF_API
Definition visibility.h:43
#define LIEF_LOCAL
Definition visibility.h:44