LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
DynamicFixupGeneric.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_GENERIC_H
17#define LIEF_PE_LOAD_CONFIGURATION_DYNAMIC_FIXUP_GENERIC_H
19
20#include "LIEF/iterators.hpp"
21
22namespace LIEF {
23namespace PE {
24class Relocation;
29 public:
30 using relocations_t = std::vector<std::unique_ptr<Relocation>>;
31 using it_relocations = ref_iterator<relocations_t&, Relocation*>;
32 using it_const_relocations = const_ref_iterator<const relocations_t&, Relocation*>;
33
35
36 DynamicFixupGeneric(const DynamicFixupGeneric&);
37 DynamicFixupGeneric& operator=(const DynamicFixupGeneric&);
38
39 DynamicFixupGeneric(DynamicFixupGeneric&&);
40 DynamicFixupGeneric& operator=(DynamicFixupGeneric&&);
41
42 std::unique_ptr<DynamicFixup> clone() const override {
43 return std::unique_ptr<DynamicFixupGeneric>(new DynamicFixupGeneric(*this));
44 }
45 it_relocations relocations() {
48 return relocations_;
49 }
50
51 it_const_relocations relocations() const {
52 return relocations_;
53 }
54
55 static bool classof(const DynamicFixup* fixup) {
56 return fixup->kind() == KIND::GENERIC;
57 }
58
59 std::string to_string() const override;
60
62 LIEF_LOCAL static
65 std::unique_ptr<DynamicFixupGeneric> parse(Parser& ctx, SpanStream& strm);
66
67 private:
68 relocations_t relocations_;
69};
70
71
72}
73}
74
75#endif
This class represents a generic entry where fixups are regular relocations (LIEF::PE::Relocation)
Definition DynamicFixupGeneric.hpp:28
DynamicFixupGeneric & operator=(const DynamicFixupGeneric &)
DynamicFixupGeneric(const DynamicFixupGeneric &)
DynamicFixupGeneric & operator=(DynamicFixupGeneric &&)
DynamicFixupGeneric()
static bool classof(const DynamicFixup *fixup)
Definition DynamicFixupGeneric.hpp:55
it_relocations relocations()
Iterator over the relocations.
Definition DynamicFixupGeneric.hpp:47
std::string to_string() const override
it_const_relocations relocations() const
Definition DynamicFixupGeneric.hpp:51
~DynamicFixupGeneric() override
std::unique_ptr< DynamicFixup > clone() const override
Definition DynamicFixupGeneric.hpp:42
DynamicFixupGeneric(DynamicFixupGeneric &&)
This is the base class for any fixups located in DynamicRelocation.
Definition DynamicFixup.hpp:34
KIND kind() const
Encoding of the fixups.
Definition DynamicFixup.hpp:73
Class which represents the Base Relocation Block We usually find this structure in the ....
Definition PE/Relocation.hpp:42
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41
#define LIEF_LOCAL
Definition visibility.h:42