LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LoadConfigurationV5.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2024 R. Thomas
2 * Copyright 2017 - 2024 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_V5_H
17#define LIEF_PE_LOAD_CONFIGURATION_V5_H
18#include <ostream>
19
20#include "LIEF/visibility.h"
22
23namespace LIEF {
24namespace PE {
25
26namespace details {
27template<class T>
29}
33 public:
34 static constexpr VERSION WIN_VERSION = VERSION::WIN_10_0_14901;
36
37 template<class T>
38 LIEF_LOCAL LoadConfigurationV5(const details::load_configuration_v5<T>& header);
39
40 LoadConfigurationV5& operator=(const LoadConfigurationV5&) = default;
41 LoadConfigurationV5(const LoadConfigurationV5&) = default;
42
43 VERSION version() const override {
44 return WIN_VERSION;
45 }
46 uint64_t guard_rf_failure_routine() const {
49 return guard_rf_failure_routine_;
50 }
54 return guard_rf_failure_routine_function_pointer_;
55 }
56 uint32_t dynamic_value_reloctable_offset() const {
59 return dynamic_value_reloctable_offset_;
60 }
61 uint16_t dynamic_value_reloctable_section() const {
64 return dynamic_value_reloctable_section_;
65 }
66 uint16_t reserved2() const {
69 return reserved2_;
70 }
71
72 void guard_rf_failure_routine(uint64_t value) {
73 guard_rf_failure_routine_ = value;
74 }
75
76 void guard_rf_failure_routine_function_pointer(uint64_t value) {
77 guard_rf_failure_routine_function_pointer_ = value;
78 }
79
80 void dynamic_value_reloctable_offset(uint32_t value) {
81 dynamic_value_reloctable_offset_ = value;
82 }
83
84 void dynamic_value_reloctable_section(uint16_t value) {
85 dynamic_value_reloctable_section_ = value;
86 }
87
88 void reserved2(uint16_t value) {
89 reserved2_ = value;
90 }
91
92 static bool classof(const LoadConfiguration* config) {
93 return config->version() == WIN_VERSION;
94 }
95
96 ~LoadConfigurationV5() override = default;
97
98 void accept(Visitor& visitor) const override;
99
100 std::ostream& print(std::ostream& os) const override;
101
102 protected:
103 uint64_t guard_rf_failure_routine_ = 0;
104 uint64_t guard_rf_failure_routine_function_pointer_ = 0;
105 uint32_t dynamic_value_reloctable_offset_ = 0;
106 uint16_t dynamic_value_reloctable_section_ = 0;
107 uint16_t reserved2_ = 0;
108};
109}
110}
111
112#endif
LoadConfigurationV4.hpp
LIEF::PE::LoadConfigurationV4
Load Configuration enhanced with.
Definition LoadConfigurationV4.hpp:35
LIEF::PE::LoadConfigurationV5
Load Configuration enhanced with Return Flow Guard.
Definition LoadConfigurationV5.hpp:32
LIEF::PE::LoadConfigurationV5::LoadConfigurationV5
LoadConfigurationV5(const LoadConfigurationV5 &)=default
LIEF::PE::LoadConfigurationV5::guard_rf_failure_routine
void guard_rf_failure_routine(uint64_t value)
Definition LoadConfigurationV5.hpp:72
LIEF::PE::LoadConfigurationV5::version
VERSION version() const override
(SDK) Version of the structure
Definition LoadConfigurationV5.hpp:43
LIEF::PE::LoadConfigurationV5::guard_rf_failure_routine
uint64_t guard_rf_failure_routine() const
VA of the failure routine.
Definition LoadConfigurationV5.hpp:48
LIEF::PE::LoadConfigurationV5::classof
static bool classof(const LoadConfiguration *config)
Definition LoadConfigurationV5.hpp:92
LIEF::PE::LoadConfigurationV5::print
std::ostream & print(std::ostream &os) const override
LIEF::PE::LoadConfigurationV5::operator=
LoadConfigurationV5 & operator=(const LoadConfigurationV5 &)=default
LIEF::PE::LoadConfigurationV5::LoadConfigurationV5
LoadConfigurationV5()=default
LIEF::PE::LoadConfigurationV5::~LoadConfigurationV5
~LoadConfigurationV5() override=default
LIEF::PE::LoadConfigurationV5::guard_rf_failure_routine_function_pointer
uint64_t guard_rf_failure_routine_function_pointer() const
VA of the failure routine fptr.
Definition LoadConfigurationV5.hpp:53
LIEF::PE::LoadConfigurationV5::dynamic_value_reloctable_offset
uint32_t dynamic_value_reloctable_offset() const
Offset of dynamic relocation table relative to the relocation table.
Definition LoadConfigurationV5.hpp:58
LIEF::PE::LoadConfigurationV5::LoadConfigurationV5
LoadConfigurationV5(const details::load_configuration_v5< T > &header)
LIEF::PE::LoadConfigurationV5::accept
void accept(Visitor &visitor) const override
LIEF::PE::LoadConfigurationV5::reserved2
uint16_t reserved2() const
Must be zero.
Definition LoadConfigurationV5.hpp:68
LIEF::PE::LoadConfigurationV5::dynamic_value_reloctable_section
uint16_t dynamic_value_reloctable_section() const
The section index of the dynamic value relocation table.
Definition LoadConfigurationV5.hpp:63
LIEF::PE::LoadConfigurationV5::reserved2
void reserved2(uint16_t value)
Definition LoadConfigurationV5.hpp:88
LIEF::PE::LoadConfigurationV5::guard_rf_failure_routine_function_pointer
void guard_rf_failure_routine_function_pointer(uint64_t value)
Definition LoadConfigurationV5.hpp:76
LIEF::PE::LoadConfigurationV5::dynamic_value_reloctable_offset
void dynamic_value_reloctable_offset(uint32_t value)
Definition LoadConfigurationV5.hpp:80
LIEF::PE::LoadConfigurationV5::dynamic_value_reloctable_section
void dynamic_value_reloctable_section(uint16_t value)
Definition LoadConfigurationV5.hpp:84
LIEF::PE::LoadConfiguration::version
virtual VERSION version() const
(SDK) Version of the structure
Definition LoadConfiguration.hpp:64
LIEF::PE::details
Definition CodeIntegrity.hpp:26
LIEF::PE
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF
LIEF namespace.
Definition Abstract/Binary.hpp:36
LIEF::PE::details::load_configuration_v5
Definition LoadConfigurationV5.hpp:28
visibility.h
LIEF_API
#define LIEF_API
Definition visibility.h:41
LIEF_LOCAL
#define LIEF_LOCAL
Definition visibility.h:42