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