LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LoadConfigurationV3.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_V3_H
17#define LIEF_PE_LOAD_CONFIGURATION_V3_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
35 static constexpr VERSION WIN_VERSION = VERSION::WIN_10_0_14286;
36
38
39 template<class T>
40 LIEF_LOCAL LoadConfigurationV3(const details::load_configuration_v3<T>& header);
41
42 LoadConfigurationV3& operator=(const LoadConfigurationV3&) = default;
43 LoadConfigurationV3(const LoadConfigurationV3&) = default;
44
45 VERSION version() const override {
46 return WIN_VERSION;
47 }
51 return guard_address_taken_iat_entry_table_;
52 }
56 return guard_address_taken_iat_entry_count_;
57 }
58 uint64_t guard_long_jump_target_table() const {
61 return guard_long_jump_target_table_;
62 }
63 uint64_t guard_long_jump_target_count() const {
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
LoadConfigurationV2.hpp
LIEF::PE::LoadConfigurationV2
LoadConfiguration enhanced with code integrity.
Definition LoadConfigurationV2.hpp:34
LIEF::PE::LoadConfigurationV3
LoadConfiguration with Control Flow Guard improved.
Definition LoadConfigurationV3.hpp:32
LIEF::PE::LoadConfigurationV3::guard_long_jump_target_count
void guard_long_jump_target_count(uint64_t value)
Definition LoadConfigurationV3.hpp:81
LIEF::PE::LoadConfigurationV3::version
VERSION version() const override
(SDK) Version of the structure
Definition LoadConfigurationV3.hpp:45
LIEF::PE::LoadConfigurationV3::guard_address_taken_iat_entry_table
uint64_t guard_address_taken_iat_entry_table() const
VA of a table associated with CFG's IAT checks.
Definition LoadConfigurationV3.hpp:50
LIEF::PE::LoadConfigurationV3::LoadConfigurationV3
LoadConfigurationV3()=default
LIEF::PE::LoadConfigurationV3::guard_address_taken_iat_entry_count
void guard_address_taken_iat_entry_count(uint64_t value)
Definition LoadConfigurationV3.hpp:73
LIEF::PE::LoadConfigurationV3::classof
static bool classof(const LoadConfiguration *config)
Definition LoadConfigurationV3.hpp:85
LIEF::PE::LoadConfigurationV3::~LoadConfigurationV3
~LoadConfigurationV3() override=default
LIEF::PE::LoadConfigurationV3::accept
void accept(Visitor &visitor) const override
LIEF::PE::LoadConfigurationV3::guard_address_taken_iat_entry_table
void guard_address_taken_iat_entry_table(uint64_t value)
Definition LoadConfigurationV3.hpp:69
LIEF::PE::LoadConfigurationV3::LoadConfigurationV3
LoadConfigurationV3(const details::load_configuration_v3< T > &header)
LIEF::PE::LoadConfigurationV3::guard_long_jump_target_count
uint64_t guard_long_jump_target_count() const
Number of entries in the LoadConfigurationV3::guard_long_jump_target_table.
Definition LoadConfigurationV3.hpp:65
LIEF::PE::LoadConfigurationV3::print
std::ostream & print(std::ostream &os) const override
LIEF::PE::LoadConfigurationV3::guard_address_taken_iat_entry_count
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
LIEF::PE::LoadConfigurationV3::LoadConfigurationV3
LoadConfigurationV3(const LoadConfigurationV3 &)=default
LIEF::PE::LoadConfigurationV3::operator=
LoadConfigurationV3 & operator=(const LoadConfigurationV3 &)=default
LIEF::PE::LoadConfigurationV3::guard_long_jump_target_table
void guard_long_jump_target_table(uint64_t value)
Definition LoadConfigurationV3.hpp:77
LIEF::PE::LoadConfigurationV3::guard_long_jump_target_table
uint64_t guard_long_jump_target_table() const
VA of a table associated with CFG's long jump
Definition LoadConfigurationV3.hpp:60
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_v3
Definition LoadConfigurationV3.hpp:28
visibility.h
LIEF_API
#define LIEF_API
Definition visibility.h:41
LIEF_LOCAL
#define LIEF_LOCAL
Definition visibility.h:42