LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
CodeView.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_DEBUG_CODE_VIEW_H
17#define LIEF_PE_DEBUG_CODE_VIEW_H
19
20namespace LIEF {
21namespace PE {
22class Parser;
23class Builder;
24class LIEF_API CodeView : public Debug {
27 friend class Parser;
28 friend class Builder;
29
30 public: enum class SIGNATURES {
34 UNKNOWN = 0,
35
36 PDB_70 = 0x53445352, // RSDS
37 PDB_20 = 0x3031424e, // NB10
38 CV_50 = 0x3131424e, // NB11
39 CV_41 = 0x3930424e, // NB09
40 };
41
43 Debug(Debug::TYPES::CODEVIEW)
44 {}
45 CodeView(SIGNATURES sig) :
46 Debug{Debug::TYPES::CODEVIEW},
47 sig_{sig}
48 {}
49
50 CodeView(const details::pe_debug& debug, SIGNATURES sig);
51
52 CodeView(const CodeView& other) = default;
53 CodeView& operator=(const CodeView& other) = default;
54
55 ~CodeView() override = default;
56 SIGNATURES signature() const {
59 return sig_;
60 }
61
62 std::unique_ptr<Debug> clone() const override {
63 return std::unique_ptr<Debug>(new CodeView(*this));
64 }
65
66 static bool classof(const Debug* debug) {
67 return debug->type() == Debug::TYPES::CODEVIEW;
68 }
69
70 void accept(Visitor& visitor) const override;
71 LIEF_API friend std::ostream& operator<<(std::ostream& os, const CodeView& entry);
72
73 protected:
74 SIGNATURES sig_ = SIGNATURES::UNKNOWN;
75};
76
77LIEF_API const char* to_string(CodeView::SIGNATURES e);
78
79} // namespace PE
80} // namespace LIEF
81#endif
LIEF::PE::Builder
Class that is used to rebuild a raw PE binary from a PE::Binary object.
Definition PE/Builder.hpp:45
LIEF::PE::CodeView
Interface for the (generic) Debug CodeView (IMAGE_DEBUG_TYPE_CODEVIEW)
Definition CodeView.hpp:26
LIEF::PE::CodeView::signature
SIGNATURES signature() const
The signature that defines the underlying type of the payload.
Definition CodeView.hpp:58
LIEF::PE::CodeView::operator<<
friend std::ostream & operator<<(std::ostream &os, const CodeView &entry)
LIEF::PE::CodeView::clone
std::unique_ptr< Debug > clone() const override
Definition CodeView.hpp:62
LIEF::PE::CodeView::classof
static bool classof(const Debug *debug)
Definition CodeView.hpp:66
LIEF::PE::CodeView::accept
void accept(Visitor &visitor) const override
LIEF::PE::CodeView::operator=
CodeView & operator=(const CodeView &other)=default
LIEF::PE::CodeView::SIGNATURES
SIGNATURES
Code view signatures.
Definition CodeView.hpp:33
LIEF::PE::CodeView::CodeView
CodeView(SIGNATURES sig)
Definition CodeView.hpp:45
LIEF::PE::CodeView::CodeView
CodeView(const details::pe_debug &debug, SIGNATURES sig)
LIEF::PE::CodeView::CodeView
CodeView(const CodeView &other)=default
LIEF::PE::CodeView::CodeView
CodeView()
Definition CodeView.hpp:42
LIEF::PE::CodeView::~CodeView
~CodeView() override=default
LIEF::PE::Debug
This class represents a generic entry in the debug data directory. For known types,...
Definition debug/Debug.hpp:38
LIEF::PE::Parser
Main interface to parse PE binaries. In particular the static functions: Parser::parse should be used...
Definition PE/Parser.hpp:47
Debug.hpp
LIEF::PE
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF::PE::to_string
const char * to_string(DataDirectory::TYPES e)
LIEF
LIEF namespace.
Definition Abstract/Binary.hpp:36
LIEF_API
#define LIEF_API
Definition visibility.h:41