LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
DynamicFixupUnknown.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_UNKNOWN_H
17#define LIEF_PE_LOAD_CONFIGURATION_DYNAMIC_FIXUP_UNKNOWN_H
18#include "LIEF/span.hpp"
20
21#include <vector>
22
23namespace LIEF {
24namespace PE {
29 public:
30 DynamicFixupUnknown(std::vector<uint8_t> payload) :
31 DynamicFixup(KIND::UNKNOWN),
32 payload_(std::move(payload))
33 {}
34
35 DynamicFixupUnknown(const DynamicFixupUnknown&) = default;
36 DynamicFixupUnknown& operator=(const DynamicFixupUnknown&) = default;
37
38 DynamicFixupUnknown(DynamicFixupUnknown&&) = default;
39 DynamicFixupUnknown& operator=(DynamicFixupUnknown&&) = default;
40
41 std::unique_ptr<DynamicFixup> clone() const override {
42 return std::unique_ptr<DynamicFixupUnknown>(new DynamicFixupUnknown(*this));
43 }
44
45 static bool classof(const DynamicFixup* fixup) {
46 return fixup->kind() == KIND::UNKNOWN;
47 }
48
49 std::string to_string() const override {
50 return "DynamicFixupUnknown(" + std::to_string(payload_.size()) + "bytes)";
51 }
52 span<const uint8_t> payload() const {
55 return payload_;
56 }
57
58 span<uint8_t> payload() {
59 return payload_;
60 }
61
62 ~DynamicFixupUnknown() override = default;
63
64 private:
65 std::vector<uint8_t> payload_;
66};
67
68
69}
70}
71
72#endif
This class represents an special dynamic relocation where the format of the fixups is not supported b...
Definition DynamicFixupUnknown.hpp:28
DynamicFixupUnknown & operator=(const DynamicFixupUnknown &)=default
~DynamicFixupUnknown() override=default
span< const uint8_t > payload() const
Raw fixups.
Definition DynamicFixupUnknown.hpp:54
std::unique_ptr< DynamicFixup > clone() const override
Definition DynamicFixupUnknown.hpp:41
std::string to_string() const override
Definition DynamicFixupUnknown.hpp:49
DynamicFixupUnknown(DynamicFixupUnknown &&)=default
DynamicFixupUnknown & operator=(DynamicFixupUnknown &&)=default
DynamicFixupUnknown(std::vector< uint8_t > payload)
Definition DynamicFixupUnknown.hpp:30
span< uint8_t > payload()
Definition DynamicFixupUnknown.hpp:58
static bool classof(const DynamicFixup *fixup)
Definition DynamicFixupUnknown.hpp:45
DynamicFixupUnknown(const DynamicFixupUnknown &)=default
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
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