LIEF: Library to Instrument Executable Formats Version 0.15.1
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}
30
33 public:
34 static constexpr VERSION WIN_VERSION = VERSION::WIN_10_0_14901;
36
37 template<class T>
39
42
43 VERSION version() const override {
44 return WIN_VERSION;
45 }
46
48 uint64_t guard_rf_failure_routine() const {
49 return guard_rf_failure_routine_;
50 }
51
54 return guard_rf_failure_routine_function_pointer_;
55 }
56
59 return dynamic_value_reloctable_offset_;
60 }
61
64 return dynamic_value_reloctable_section_;
65 }
66
68 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
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
Load Configuration enhanced with.
Definition LoadConfigurationV4.hpp:35
Load Configuration enhanced with Return Flow Guard.
Definition LoadConfigurationV5.hpp:32
LoadConfigurationV5(const LoadConfigurationV5 &)=default
void guard_rf_failure_routine(uint64_t value)
Definition LoadConfigurationV5.hpp:72
VERSION version() const override
(SDK) Version of the structure
Definition LoadConfigurationV5.hpp:43
uint64_t guard_rf_failure_routine() const
VA of the failure routine.
Definition LoadConfigurationV5.hpp:48
static bool classof(const LoadConfiguration *config)
Definition LoadConfigurationV5.hpp:92
std::ostream & print(std::ostream &os) const override
LoadConfigurationV5 & operator=(const LoadConfigurationV5 &)=default
~LoadConfigurationV5() override=default
uint64_t guard_rf_failure_routine_function_pointer() const
VA of the failure routine fptr.
Definition LoadConfigurationV5.hpp:53
uint32_t dynamic_value_reloctable_offset() const
Offset of dynamic relocation table relative to the relocation table.
Definition LoadConfigurationV5.hpp:58
LoadConfigurationV5(const details::load_configuration_v5< T > &header)
void accept(Visitor &visitor) const override
uint16_t reserved2() const
Must be zero.
Definition LoadConfigurationV5.hpp:68
uint16_t dynamic_value_reloctable_section() const
The section index of the dynamic value relocation table.
Definition LoadConfigurationV5.hpp:63
void reserved2(uint16_t value)
Definition LoadConfigurationV5.hpp:88
void guard_rf_failure_routine_function_pointer(uint64_t value)
Definition LoadConfigurationV5.hpp:76
void dynamic_value_reloctable_offset(uint32_t value)
Definition LoadConfigurationV5.hpp:80
void dynamic_value_reloctable_section(uint16_t value)
Definition LoadConfigurationV5.hpp:84
Class that represents the default PE's LoadConfiguration
Definition LoadConfiguration.hpp:35
virtual VERSION version() const
(SDK) Version of the structure
Definition LoadConfiguration.hpp:64
VERSION
Definition LoadConfiguration.hpp:37
Definition Visitor.hpp:224
LIEF namespace.
Definition Abstract/Binary.hpp:32
Definition LoadConfigurationV5.hpp:28
#define LIEF_API
Definition visibility.h:41
#define LIEF_LOCAL
Definition visibility.h:42