LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
ExDllCharacteristics.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2025 R. Thomas
2 * Copyright 2017 - 2025 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_EX_DLL_CHARACTERISTICS_H
17#define LIEF_PE_EX_DLL_CHARACTERISTICS_H
18#include <vector>
19
20#include "LIEF/enums.hpp"
21#include "LIEF/visibility.h"
23
24namespace LIEF {
25namespace PE {
26
30 public:
42
43 static std::unique_ptr<ExDllCharacteristics>
44 parse(const details::pe_debug& hdr, Section* section, span<uint8_t> payload);
45
46 ExDllCharacteristics(const details::pe_debug& debug, Section* sec,
47 uint32_t characteristics) :
48 Debug(debug, sec),
49 characteristics_(characteristics)
50 {}
51
54
57
58 std::unique_ptr<Debug> clone() const override {
59 return std::unique_ptr<Debug>(new ExDllCharacteristics(*this));
60 }
61
64 return (CHARACTERISTICS)characteristics_;
65 }
66
68 std::vector<CHARACTERISTICS> characteristics_list() const;
69
71 bool has(CHARACTERISTICS c) const {
72 return (characteristics_ & (uint32_t)c) != 0;
73 }
74
75 static bool classof(const Debug* debug) {
76 return debug->type() == Debug::TYPES::EX_DLLCHARACTERISTICS;
77 }
78
79 ~ExDllCharacteristics() override = default;
80
81 std::string to_string() const override;
82
83 private:
84 uint32_t characteristics_ = 0;
85};
86
88
89}
90}
91
93
94#endif
span< uint8_t > payload()
Debug data associated with this entry.
Debug()=default
const Section * section() const
The section where debug data is located.
Definition debug/Debug.hpp:170
@ EX_DLLCHARACTERISTICS
Extended DLL characteristics.
Definition debug/Debug.hpp:100
bool has(CHARACTERISTICS c) const
Check if the given CHARACTERISTICS is used.
Definition ExDllCharacteristics.hpp:71
CHARACTERISTICS characteristics() const
Return the characteristics.
Definition ExDllCharacteristics.hpp:63
ExDllCharacteristics(ExDllCharacteristics &&)=default
ExDllCharacteristics(const ExDllCharacteristics &other)=default
CHARACTERISTICS
Extended DLL Characteristics.
Definition ExDllCharacteristics.hpp:32
@ CET_SET_CONTEXT_IP_VALIDATION_RELAXED_MODE
Definition ExDllCharacteristics.hpp:35
@ FORWARD_CFI_COMPAT
Definition ExDllCharacteristics.hpp:39
@ HOTPATCH_COMPATIBLE
Definition ExDllCharacteristics.hpp:40
@ CET_COMPAT_STRICT_MODE
Definition ExDllCharacteristics.hpp:34
@ CET_COMPAT
Definition ExDllCharacteristics.hpp:33
@ CET_RESERVED_2
Definition ExDllCharacteristics.hpp:38
@ CET_DYNAMIC_APIS_ALLOW_IN_PROC
Definition ExDllCharacteristics.hpp:36
@ CET_RESERVED_1
Definition ExDllCharacteristics.hpp:37
std::unique_ptr< Debug > clone() const override
Definition ExDllCharacteristics.hpp:58
static bool classof(const Debug *debug)
Definition ExDllCharacteristics.hpp:75
static std::unique_ptr< ExDllCharacteristics > parse(const details::pe_debug &hdr, Section *section, span< uint8_t > payload)
std::string to_string() const override
~ExDllCharacteristics() override=default
ExDllCharacteristics & operator=(ExDllCharacteristics &&other)=default
ExDllCharacteristics & operator=(const ExDllCharacteristics &other)=default
std::vector< CHARACTERISTICS > characteristics_list() const
Characteristics as a vector.
ExDllCharacteristics(const details::pe_debug &debug, Section *sec, uint32_t characteristics)
Definition ExDllCharacteristics.hpp:46
Class which represents a PE section.
Definition PE/Section.hpp:46
#define ENABLE_BITMASK_OPERATORS(X)
Definition enums.hpp:24
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
const char * to_string(CODE_PAGES e)
LIEF namespace.
Definition Abstract/Binary.hpp:40
tcb::span< ElementType, Extent > span
Definition span.hpp:22
#define LIEF_API
Definition visibility.h:41