LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
DynamicRelocationV2.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_RELOCATION_V2_H
17#define LIEF_PE_LOAD_CONFIGURATION_DYNAMIC_RELOCATION_V2_H
18
19#include <memory>
20#include <string>
21
22#include "LIEF/visibility.h"
24
25namespace LIEF {
26class BinaryStream;
27
28namespace PE {
29class Parser;
34 public:
36 DynamicRelocation(2)
37 {}
38
39 DynamicRelocationV2(const DynamicRelocationV2&) = default;
40 DynamicRelocationV2& operator=(const DynamicRelocationV2&) = default;
41
42 DynamicRelocationV2(DynamicRelocationV2&&) = default;
43 DynamicRelocationV2& operator=(DynamicRelocationV2&&) = default;
44
45 std::unique_ptr<DynamicRelocation> clone() const override {
46 return std::unique_ptr<DynamicRelocationV2>(new DynamicRelocationV2(*this));
47 }
48
49 std::string to_string() const override;
50
51 static bool classof(const DynamicRelocation* reloc) {
52 return reloc->version() == 2;
53 }
54
55 ~DynamicRelocationV2() override = default;
56 template<class PE_T> LIEF_LOCAL static
59 std::unique_ptr<DynamicRelocationV2> parse(Parser& ctx, BinaryStream& strm);
60
61};
62
63}
64}
65
66#endif
Class that is used to a read stream of data from different sources.
Definition BinaryStream.hpp:33
This class represents a dynamic relocation (IMAGE_DYNAMIC_RELOCATION64_V2 or IMAGE_DYNAMIC_RELOCATION...
Definition DynamicRelocationV2.hpp:33
DynamicRelocationV2 & operator=(const DynamicRelocationV2 &)=default
DynamicRelocationV2()
Definition DynamicRelocationV2.hpp:35
std::string to_string() const override
static bool classof(const DynamicRelocation *reloc)
Definition DynamicRelocationV2.hpp:51
~DynamicRelocationV2() override=default
DynamicRelocationV2(DynamicRelocationV2 &&)=default
DynamicRelocationV2(const DynamicRelocationV2 &)=default
std::unique_ptr< DynamicRelocation > clone() const override
Definition DynamicRelocationV2.hpp:45
DynamicRelocationV2 & operator=(DynamicRelocationV2 &&)=default
This is the base class for any IMAGE_DYNAMIC_RELOCATION32, IMAGE_DYNAMIC_RELOCATION32_V2,...
Definition DynamicRelocationBase.hpp:33
uint32_t version() const
Version of the structure.
Definition DynamicRelocationBase.hpp:76
Main interface to parse PE binaries. In particular the static functions: Parser::parse should be used...
Definition PE/Parser.hpp:52
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