LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
DynamicFixupControlTransfer.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2026 R. Thomas
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15#ifndef LIEF_PE_LOAD_CONFIGURATION_DYNAMIC_FIXUP_CONTROL_TRANSFER_H
16#define LIEF_PE_LOAD_CONFIGURATION_DYNAMIC_FIXUP_CONTROL_TRANSFER_H
18#include <memory>
19#include <vector>
20
21#include "LIEF/iterators.hpp"
22
23
24namespace LIEF::PE {
25
29 public:
30 static constexpr auto NO_IAT_INDEX = 0x7fff;
31
35 uint32_t rva = 0;
36
38 bool is_call = false;
39
43
44 std::string to_string() const;
45
46 friend LIEF_API std::ostream& operator<<(std::ostream& os,
47 const reloc_entry_t& entry) {
48 os << entry.to_string();
49 return os;
50 }
51 };
52
53 using reloc_entries_t = std::vector<reloc_entry_t>;
56
59
63
66
67 std::unique_ptr<DynamicFixup> clone() const override {
68 return std::make_unique<DynamicFixupControlTransfer>(*this);
69 }
70
71 std::string to_string() const override;
72
75 return entries_;
76 }
77
79 return entries_;
80 }
81
82 static bool classof(const DynamicFixup* fixup) {
84 }
85
86 ~DynamicFixupControlTransfer() override = default;
87
89 LIEF_LOCAL static std::unique_ptr<DynamicFixupControlTransfer>
90 parse(Parser& ctx, SpanStream& strm);
91
92 private:
93 reloc_entries_t entries_;
94};
95
96
97}
98
99
100#endif
ref_iterator< reloc_entries_t & > it_relocations
Definition DynamicFixupControlTransfer.hpp:54
DynamicFixupControlTransfer & operator=(DynamicFixupControlTransfer &&)=default
std::vector< reloc_entry_t > reloc_entries_t
Definition DynamicFixupControlTransfer.hpp:53
it_const_relocations relocations() const
Definition DynamicFixupControlTransfer.hpp:78
static constexpr auto NO_IAT_INDEX
Definition DynamicFixupControlTransfer.hpp:30
DynamicFixupControlTransfer()
Definition DynamicFixupControlTransfer.hpp:57
DynamicFixupControlTransfer & operator=(const DynamicFixupControlTransfer &)=default
std::unique_ptr< DynamicFixup > clone() const override
Definition DynamicFixupControlTransfer.hpp:67
std::string to_string() const override
const_ref_iterator< const reloc_entries_t & > it_const_relocations
Definition DynamicFixupControlTransfer.hpp:55
it_relocations relocations()
Iterator over the relocations.
Definition DynamicFixupControlTransfer.hpp:74
~DynamicFixupControlTransfer() override=default
static bool classof(const DynamicFixup *fixup)
Definition DynamicFixupControlTransfer.hpp:82
DynamicFixupControlTransfer(DynamicFixupControlTransfer &&)=default
DynamicFixupControlTransfer(const DynamicFixupControlTransfer &)=default
KIND
Definition DynamicFixup.hpp:35
@ GUARD_IMPORT_CONTROL_TRANSFER
If DynamicRelocation::symbol is set to IMAGE_DYNAMIC_RELOCATION_GUARD_IMPORT_CONTROL_TRANSFER.
Definition DynamicFixup.hpp:56
KIND kind() const
Encoding of the fixups.
Definition DynamicFixup.hpp:74
Main interface to parse PE binaries. In particular, the static Parser::parse functions should be used...
Definition PE/Parser.hpp:53
Definition SpanStream.hpp:31
Iterator which returns reference on container's values.
Definition iterators.hpp:120
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:31
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:385
Mirror IMAGE_IMPORT_CONTROL_TRANSFER_DYNAMIC_RELOCATION.
Definition DynamicFixupControlTransfer.hpp:33
bool is_call
True if target instruction is a call, false otherwise.
Definition DynamicFixupControlTransfer.hpp:38
friend std::ostream & operator<<(std::ostream &os, const reloc_entry_t &entry)
Definition DynamicFixupControlTransfer.hpp:46
uint32_t rva
RVA to the call instruction.
Definition DynamicFixupControlTransfer.hpp:35
std::string to_string() const
uint16_t iat_index
IAT index of the corresponding import. 0x7FFF is a special value indicating no index.
Definition DynamicFixupControlTransfer.hpp:42
#define LIEF_API
Definition visibility.h:44
#define LIEF_LOCAL
Definition visibility.h:45