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 {
25
28 public:
29 enum class FIXUP_TYPE {
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
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>;
65
69
72
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
84 return entries_;
85 }
86
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
98 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
DynamicFixupARM64X(DynamicFixupARM64X &&)=default
DynamicFixupARM64X()
Definition DynamicFixupARM64X.hpp:66
FIXUP_TYPE
Definition DynamicFixupARM64X.hpp:29
@ ZEROFILL
Definition DynamicFixupARM64X.hpp:30
@ DELTA
Definition DynamicFixupARM64X.hpp:32
@ VALUE
Definition DynamicFixupARM64X.hpp:31
ref_iterator< reloc_entries_t & > it_relocations
Definition DynamicFixupARM64X.hpp:63
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::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:83
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:73
Main interface to parse PE binaries. In particular the static functions: Parser::parse 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:257
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:55
FIXUP_TYPE type
Fixup's kind.
Definition DynamicFixupARM64X.hpp:40
#define LIEF_API
Definition visibility.h:41
#define LIEF_LOCAL
Definition visibility.h:42