LIEF: Library to Instrument Executable Formats Version 0.17.0
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
17#ifndef LIEF_PE_DEBUG_H
18#define LIEF_PE_DEBUG_H
44 public:
enum class TYPES {
98 EX_DLLCHARACTERISTICS = 20,
108 uint32_t offset, uint32_t size);
109 static span<uint8_t>
get_payload(Section& section,
const details::pe_debug& hdr);
110 static span<uint8_t>
get_payload(Section& section,
const Debug& dbg) {
115 Debug(
const details::pe_debug& debug_s, Section* section);
117 Debug(
const Debug& other) =
default;
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_;
168 const Section*
section()
const {
182 return const_cast<Debug*
>(
this)->payload();
186 characteristics_ = characteristics;
190 timestamp_ = timestamp;
194 major_version_ = major_version;
198 minor_version_ = minor_version;
202 sizeof_data_ = sizeof_data;
206 addressof_rawdata_ = addressof_rawdata;
210 pointerto_rawdata_ = 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>());
227 void accept(Visitor& visitor)
const override;
232 std::ostream&
operator<<(std::ostream& os,
const Debug& entry)
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;
248 Section* section_ =
nullptr;
Class that is used to rebuild a raw PE binary from a PE::Binary object.
Definition PE/Builder.hpp:45
This class represents a generic entry in the debug data directory. For known types,...
Definition debug/Debug.hpp:40
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
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)
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
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:43
Definition DataDirectory.hpp:37
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
@ T
Definition AcceleratorCodes.hpp:97
const char * to_string(AuxiliaryWeakExternal::CHARACTERISTICS e)
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41