LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
DynamicFixupGeneric.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_GENERIC_H
16#define LIEF_PE_LOAD_CONFIGURATION_DYNAMIC_FIXUP_GENERIC_H
17#include <memory>
18
20
21#include "LIEF/iterators.hpp"
22
23
24namespace LIEF::PE {
25class Relocation;
26
30 public:
31 using relocations_t = std::vector<std::unique_ptr<Relocation>>;
35
37
40
43
44 std::unique_ptr<DynamicFixup> clone() const override {
45 return std::make_unique<DynamicFixupGeneric>(*this);
46 }
47
50 return relocations_;
51 }
52
54 return relocations_;
55 }
56
57 static bool classof(const DynamicFixup* fixup) {
58 return fixup->kind() == KIND::GENERIC;
59 }
60
61 std::string to_string() const override;
62
64
66 LIEF_LOCAL static std::unique_ptr<DynamicFixupGeneric> parse(Parser& ctx,
67 SpanStream& strm);
68
69 private:
70 relocations_t relocations_;
71};
72
73
74}
75
76
77#endif
DynamicFixupGeneric & operator=(const DynamicFixupGeneric &)
std::vector< std::unique_ptr< Relocation > > relocations_t
Definition DynamicFixupGeneric.hpp:31
DynamicFixupGeneric(const DynamicFixupGeneric &)
DynamicFixupGeneric & operator=(DynamicFixupGeneric &&)
static bool classof(const DynamicFixup *fixup)
Definition DynamicFixupGeneric.hpp:57
it_relocations relocations()
Iterator over the relocations.
Definition DynamicFixupGeneric.hpp:49
std::string to_string() const override
ref_iterator< relocations_t &, Relocation * > it_relocations
Definition DynamicFixupGeneric.hpp:32
const_ref_iterator< const relocations_t &, Relocation * > it_const_relocations
Definition DynamicFixupGeneric.hpp:33
it_const_relocations relocations() const
Definition DynamicFixupGeneric.hpp:53
std::unique_ptr< DynamicFixup > clone() const override
Definition DynamicFixupGeneric.hpp:44
DynamicFixupGeneric(DynamicFixupGeneric &&)
@ GENERIC
If DynamicRelocation::symbol is not a special value.
Definition DynamicFixup.hpp:41
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
Class which represents the Base Relocation Block We usually find this structure in the ....
Definition PE/Relocation.hpp:42
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
#define LIEF_API
Definition visibility.h:44
#define LIEF_LOCAL
Definition visibility.h:45