17#ifndef LIEF_PE_DEBUG_H
18#define LIEF_PE_DEBUG_H
108 uint32_t offset, uint32_t size);
125 virtual std::unique_ptr<Debug>
clone()
const {
126 return std::unique_ptr<Debug>(
new Debug(*
this));
131 return characteristics_;
141 return major_version_;
146 return minor_version_;
161 return addressof_rawdata_;
166 return pointerto_rawdata_;
215 static_assert(std::is_base_of<Debug, T>::value,
"Require Debug inheritance");
216 if (T::classof(
this)) {
217 return static_cast<const T*
>(
this);
224 return const_cast<T*
>(
static_cast<const Debug*
>(
this)->as<
T>());
239 TYPES type_ = TYPES::UNKNOWN;
240 uint32_t characteristics_ = 0;
241 uint32_t timestamp_ = 0;
242 uint16_t major_version_ = 0;
243 uint16_t minor_version_ = 0;
244 uint32_t sizeof_data_ = 0;
245 uint32_t addressof_rawdata_ = 0;
246 uint32_t pointerto_rawdata_ = 0;
Class that is used to rebuild a raw PE binary from a PE::Binary object.
Definition PE/Builder.hpp:45
void characteristics(uint32_t characteristics)
Definition debug/Debug.hpp:185
void accept(Visitor &visitor) const override
Debug & operator=(Debug &&)=default
Debug(const details::pe_debug &debug_s, Section *section)
uint32_t addressof_rawdata() const
Address of the debug data relative to the image base.
Definition debug/Debug.hpp:160
void pointerto_rawdata(uint32_t pointerto_rawdata)
Definition debug/Debug.hpp:209
virtual std::string to_string() const
uint32_t sizeof_data() const
Size of the debug data.
Definition debug/Debug.hpp:155
uint16_t major_version() const
The major version number of the debug data format.
Definition debug/Debug.hpp:140
Section * section()
Definition debug/Debug.hpp:174
void addressof_rawdata(uint32_t addressof_rawdata)
Definition debug/Debug.hpp:205
uint16_t minor_version() const
The minor version number of the debug data format.
Definition debug/Debug.hpp:145
span< uint8_t > payload()
Debug data associated with this entry.
uint32_t characteristics() const
Reserved should be 0.
Definition debug/Debug.hpp:130
const T * as() const
Definition debug/Debug.hpp:214
void major_version(uint16_t major_version)
Definition debug/Debug.hpp:193
friend std::ostream & operator<<(std::ostream &os, const Debug &entry)
Definition debug/Debug.hpp:232
friend class Builder
Definition debug/Debug.hpp:42
T * as()
Definition debug/Debug.hpp:223
virtual std::unique_ptr< Debug > clone() const
Definition debug/Debug.hpp:125
void sizeof_data(uint32_t sizeof_data)
Definition debug/Debug.hpp:201
static span< uint8_t > get_payload(Section §ion, const details::pe_debug &hdr)
static span< uint8_t > get_payload(Section §ion, uint32_t rva, uint32_t offset, uint32_t size)
friend class Parser
Definition debug/Debug.hpp:41
uint32_t pointerto_rawdata() const
File offset of the debug data.
Definition debug/Debug.hpp:165
Debug(const Debug &other)=default
uint32_t timestamp() const
The time and date when the debug data was created.
Definition debug/Debug.hpp:135
span< const uint8_t > payload() const
Definition debug/Debug.hpp:181
const Section * section() const
The section where debug data is located.
Definition debug/Debug.hpp:170
static span< uint8_t > get_payload(Section §ion, const Debug &dbg)
Definition debug/Debug.hpp:110
~Debug() override=default
void minor_version(uint16_t minor_version)
Definition debug/Debug.hpp:197
Debug & operator=(const Debug &other)=default
TYPES type() const
The format DEBUG_TYPES of the debugging information.
Definition debug/Debug.hpp:150
void timestamp(uint32_t timestamp)
Definition debug/Debug.hpp:189
Debug(TYPES type)
Definition debug/Debug.hpp:103
TYPES
The entry types.
Definition debug/Debug.hpp:46
@ FPO
Frame pointer omission information.
Definition debug/Debug.hpp:56
@ MPX
Definition debug/Debug.hpp:91
@ COFF
COFF Debug information.
Definition debug/Debug.hpp:50
@ POGO
Profile Guided Optimization metadata.
Definition debug/Debug.hpp:86
@ UNKNOWN
Definition debug/Debug.hpp:47
@ FIXUP
(Reserved) Debug information used for fixup relocations
Definition debug/Debug.hpp:65
@ CODEVIEW
CodeView debug information that is used to store PDB info.
Definition debug/Debug.hpp:53
@ OMAP_TO_SRC
The mapping from an RVA in image to an RVA in source image.
Definition debug/Debug.hpp:68
@ RESERVED10
Reserved.
Definition debug/Debug.hpp:77
@ EX_DLLCHARACTERISTICS
Extended DLL characteristics.
Definition debug/Debug.hpp:100
@ VC_FEATURE
Visual C++ feature information.
Definition debug/Debug.hpp:83
@ BORLAND
Reserved for Borland.
Definition debug/Debug.hpp:74
@ MISC
Miscellaneous debug information.
Definition debug/Debug.hpp:59
@ EXCEPTION
Debug information that is a copy of the .pdata section.
Definition debug/Debug.hpp:62
@ CLSID
Reserved.
Definition debug/Debug.hpp:80
@ OMAP_FROM_SRC
The mapping from an RVA in source image to an RVA in image.
Definition debug/Debug.hpp:71
@ REPRO
PE determinism or reproducibility information.
Definition debug/Debug.hpp:94
@ PDBCHECKSUM
Checksum of the PDB file.
Definition debug/Debug.hpp:97
@ ILTCG
Incremental Link Time Code Generation metadata.
Definition debug/Debug.hpp:89
Main interface to parse PE binaries. In particular the static functions: Parser::parse should be used...
Definition PE/Parser.hpp:52
Class which represents a PE section.
Definition PE/Section.hpp:46
Definition Visitor.hpp:210
Definition DataDirectory.hpp:37
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
const char * to_string(CODE_PAGES e)
@ T
Definition AcceleratorCodes.hpp:97
LIEF namespace.
Definition Abstract/Binary.hpp:40
tcb::span< ElementType, Extent > span
Definition span.hpp:22
#define LIEF_API
Definition visibility.h:41