LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
LoadConfigurationV3.hpp
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_V3_H
17#define LIEF_PE_LOAD_CONFIGURATION_V3_H
18#include <ostream>
19
20#include "LIEF/visibility.h"
21#include "LIEF/PE/LoadConfigurations/LoadConfigurationV2.hpp"
22
23namespace LIEF {
24namespace PE {
25
26namespace details {
27template<class T>
29}
30
33 public:
34
35 static constexpr VERSION WIN_VERSION = VERSION::WIN_10_0_14286;
36
37 LoadConfigurationV3() = default;
38
39 template<class T>
41
42 LoadConfigurationV3& operator=(const LoadConfigurationV3&) = default;
44
45 VERSION version() const override {
46 return WIN_VERSION;
47 }
48
51 return guard_address_taken_iat_entry_table_;
52 }
53
56 return guard_address_taken_iat_entry_count_;
57 }
58
61 return guard_long_jump_target_table_;
62 }
63
66 return guard_long_jump_target_count_;
67 }
68
69 void guard_address_taken_iat_entry_table(uint64_t value) {
70 guard_address_taken_iat_entry_table_ = value;
71 }
72
73 void guard_address_taken_iat_entry_count(uint64_t value) {
74 guard_address_taken_iat_entry_count_ = value;
75 }
76
77 void guard_long_jump_target_table(uint64_t value) {
78 guard_long_jump_target_table_ = value;
79 }
80
81 void guard_long_jump_target_count(uint64_t value) {
82 guard_long_jump_target_count_ = value;
83 }
84
85 static bool classof(const LoadConfiguration* config) {
86 return config->version() == WIN_VERSION;
87 }
88
89 ~LoadConfigurationV3() override = default;
90
91 void accept(Visitor& visitor) const override;
92
93 std::ostream& print(std::ostream& os) const override;
94
95 protected:
96 uint64_t guard_address_taken_iat_entry_table_ = 0;
97 uint64_t guard_address_taken_iat_entry_count_ = 0;
98 uint64_t guard_long_jump_target_table_ = 0;
99 uint64_t guard_long_jump_target_count_ = 0;
100};
101}
102}
103
104#endif
LoadConfiguration enhanced with code integrity.
Definition LoadConfigurationV2.hpp:34
LoadConfiguration with Control Flow Guard improved.
Definition LoadConfigurationV3.hpp:32
VERSION version() const override
(SDK) Version of the structure
Definition LoadConfigurationV3.hpp:45
uint64_t guard_address_taken_iat_entry_table() const
VA of a table associated with CFG's IAT checks.
Definition LoadConfigurationV3.hpp:50
uint64_t guard_long_jump_target_count() const
Number of entries in the LoadConfigurationV3::guard_long_jump_target_table.
Definition LoadConfigurationV3.hpp:65
uint64_t guard_address_taken_iat_entry_count() const
Number of entries in the LoadConfigurationV3::guard_address_taken_iat_entry_table.
Definition LoadConfigurationV3.hpp:55
uint64_t guard_long_jump_target_table() const
VA of a table associated with CFG's long jump
Definition LoadConfigurationV3.hpp:60
LIEF namespace.
Definition Abstract/Binary.hpp:32
Definition LoadConfigurationV3.hpp:28