16#ifndef LIEF_PE_LOAD_CONFIGURATION_V1_H
17#define LIEF_PE_LOAD_CONFIGURATION_V1_H
21#include "LIEF/enums.hpp"
22#include "LIEF/visibility.h"
24#include "LIEF/PE/LoadConfigurations/LoadConfigurationV0.hpp"
38 static constexpr VERSION WIN_VERSION = VERSION::WIN_8_1;
42 CF_INSTRUMENTED = 0x00000100,
43 CFW_INSTRUMENTED = 0x00000200,
44 CF_FUNCTION_TABLE_PRESENT = 0x00000400,
45 SECURITY_COOKIE_UNUSED = 0x00000800,
46 PROTECT_DELAYLOAD_IAT = 0x00001000,
47 DELAYLOAD_IAT_IN_ITS_OWN_SECTION = 0x00002000,
48 CF_EXPORT_SUPPRESSION_INFO_PRESENT = 0x00004000,
49 CF_ENABLE_EXPORT_SUPPRESSION = 0x00008000,
50 CF_LONGJUMP_TABLE_PRESENT = 0x00010000,
51 RF_INSTRUMENTED = 0x00020000,
52 RF_ENABLE = 0x00040000,
53 RF_STRICT = 0x00080000,
54 RETPOLINE_PRESENT = 0x00100000,
55 EH_CONTINUATION_TABLE_PRESENT = 0x00200000,
72 return guard_cf_check_function_pointer_;
77 return guard_cf_dispatch_function_pointer_;
83 return guard_cf_function_table_;
89 return guard_cf_function_count_;
103 void guard_cf_check_function_pointer(uint64_t check_pointer) {
104 guard_cf_check_function_pointer_ = check_pointer;
106 void guard_cf_dispatch_function_pointer(uint64_t dispatch_pointer) {
107 guard_cf_dispatch_function_pointer_ = dispatch_pointer;
109 void guard_cf_function_table(uint64_t guard_cf_function_table) {
110 guard_cf_function_table_ = guard_cf_function_table;
112 void guard_cf_function_count(uint64_t guard_cf_function_count) {
113 guard_cf_function_count_ = guard_cf_function_count;
115 void guard_flags(IMAGE_GUARD flags) {
119 static bool classof(
const LoadConfiguration* config) {
120 return config->version() == WIN_VERSION;
123 ~LoadConfigurationV1()
override =
default;
125 void accept(Visitor& visitor)
const override;
127 std::ostream& print(std::ostream& os)
const override;
130 uint64_t guard_cf_check_function_pointer_ = 0;
131 uint64_t guard_cf_dispatch_function_pointer_ = 0;
132 uint64_t guard_cf_function_table_ = 0;
133 uint64_t guard_cf_function_count_ = 0;
134 IMAGE_GUARD flags_ = IMAGE_GUARD::NONE;
LoadConfiguration enhanced with SEH.
Definition LoadConfigurationV0.hpp:32
LoadConfiguration enhanced with Control Flow Guard.
Definition LoadConfigurationV1.hpp:36
IMAGE_GUARD guard_flags() const
Control Flow Guard related flags.
Definition LoadConfigurationV1.hpp:93
uint64_t guard_cf_function_count() const
The count of unique RVAs in the LoadConfigurationV1::guard_cf_function_table.
Definition LoadConfigurationV1.hpp:88
IMAGE_GUARD
Definition LoadConfigurationV1.hpp:40
bool has(IMAGE_GUARD flag) const
Check if the given flag is present in LoadConfigurationV1::guard_flags.
uint64_t guard_cf_check_function_pointer() const
The VA where Control Flow Guard check-function pointer is stored.
Definition LoadConfigurationV1.hpp:71
std::vector< IMAGE_GUARD > guard_cf_flags_list() const
LoadConfigurationV1::guard_flags as a list of LIEF::PE::GUARD_CF_FLAGS.
VERSION version() const override
(SDK) Version of the structure
Definition LoadConfigurationV1.hpp:66
uint64_t guard_cf_dispatch_function_pointer() const
The VA where Control Flow Guard dispatch-function pointer is stored.
Definition LoadConfigurationV1.hpp:76
uint64_t guard_cf_function_table() const
The VA of the sorted table of RVAs of each Control Flow Guard function in the image.
Definition LoadConfigurationV1.hpp:82
LIEF namespace.
Definition Abstract/Binary.hpp:32
Definition LoadConfigurationV1.hpp:31