LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
VCFeature.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2026 R. Thomas
2 * Copyright 2017 - 2026 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_VC_FEATURE_H
17#define LIEF_PE_VC_FEATURE_H
18
19#include "LIEF/visibility.h"
21
22namespace LIEF {
23namespace PE {
24
26class LIEF_API VCFeature : public Debug {
27 public:
28 static std::unique_ptr<VCFeature> parse(const details::pe_debug& hdr,
30
31 VCFeature(const details::pe_debug& debug, Section* sec, uint32_t pre_vc,
32 uint32_t c_cpp, uint32_t gs, uint32_t sdl, uint32_t guards) :
33 Debug(debug, sec),
34 pre_vc_(pre_vc),
35 c_cpp_(c_cpp),
36 gs_(gs),
37 sdl_(sdl),
38 guards_(guards) {}
39
40 VCFeature(const VCFeature& other) = default;
41 VCFeature& operator=(const VCFeature& other) = default;
42
43 VCFeature(VCFeature&&) = default;
44 VCFeature& operator=(VCFeature&& other) = default;
45
46 std::unique_ptr<Debug> clone() const override {
47 return std::unique_ptr<Debug>(new VCFeature(*this));
48 }
49
51 uint32_t pre_vcpp() const {
52 return pre_vc_;
53 }
54
56 uint32_t c_cpp() const {
57 return c_cpp_;
58 }
59
61 uint32_t gs() const {
62 return gs_;
63 }
64
70 uint32_t sdl() const {
71 return sdl_;
72 }
73
75 uint32_t guards() const {
76 return guards_;
77 }
78
79 VCFeature& pre_vcpp(uint32_t value) {
80 pre_vc_ = value;
81 return *this;
82 }
83
84 VCFeature& c_cpp(uint32_t value) {
85 c_cpp_ = value;
86 return *this;
87 }
88
89 VCFeature& gs(uint32_t value) {
90 gs_ = value;
91 return *this;
92 }
93
94 VCFeature& sdl(uint32_t value) {
95 sdl_ = value;
96 return *this;
97 }
98
99 VCFeature& guards(uint32_t value) {
100 guards_ = value;
101 return *this;
102 }
103
104 static bool classof(const Debug* debug) {
105 return debug->type() == Debug::TYPES::VC_FEATURE;
106 }
107
108 ~VCFeature() override = default;
109
110 std::string to_string() const override;
111
112 private:
113 uint32_t pre_vc_ = 0;
114 uint32_t c_cpp_ = 0;
115 uint32_t gs_ = 0;
116 uint32_t sdl_ = 0;
117 uint32_t guards_ = 0;
118};
119
120}
121}
122
123#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
@ VC_FEATURE
Visual C++ feature information.
Definition debug/Debug.hpp:83
Class which represents a PE section.
Definition PE/Section.hpp:46
std::string to_string() const override
uint32_t guards() const
Count for /guardN.
Definition VCFeature.hpp:75
VCFeature(const VCFeature &other)=default
std::unique_ptr< Debug > clone() const override
Definition VCFeature.hpp:46
uint32_t c_cpp() const
Count for C/C++.
Definition VCFeature.hpp:56
VCFeature & operator=(const VCFeature &other)=default
VCFeature(VCFeature &&)=default
VCFeature & sdl(uint32_t value)
Definition VCFeature.hpp:94
VCFeature & guards(uint32_t value)
Definition VCFeature.hpp:99
static bool classof(const Debug *debug)
Definition VCFeature.hpp:104
VCFeature & c_cpp(uint32_t value)
Definition VCFeature.hpp:84
uint32_t sdl() const
Whether /sdl was enabled for this binary.
Definition VCFeature.hpp:70
uint32_t pre_vcpp() const
Count for Pre-VC++ 11.00.
Definition VCFeature.hpp:51
VCFeature & gs(uint32_t value)
Definition VCFeature.hpp:89
VCFeature(const details::pe_debug &debug, Section *sec, uint32_t pre_vc, uint32_t c_cpp, uint32_t gs, uint32_t sdl, uint32_t guards)
Definition VCFeature.hpp:31
VCFeature & pre_vcpp(uint32_t value)
Definition VCFeature.hpp:79
~VCFeature() override=default
VCFeature & operator=(VCFeature &&other)=default
uint32_t gs() const
Count for /GS (number of guard stack).
Definition VCFeature.hpp:61
static std::unique_ptr< VCFeature > parse(const details::pe_debug &hdr, Section *section, span< uint8_t > payload)
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF namespace.
Definition Abstract/Binary.hpp:40
tcb::span< ElementType, Extent > span
Definition span.hpp:22
#define LIEF_API
Definition visibility.h:43