retdec
|
Class that handles the Debug directory. More...
#include <DebugDirectory.h>
Public Member Functions | |
virtual | ~DebugDirectory ()=default |
int | read (std::istream &inStream, ImageLoader &imageLoader) |
Reads the Debug directory from a file. More... | |
void | clear () |
void | rebuild (std::vector< std::uint8_t > &obBuffer) const |
Rebuilds the current Debug directory. More... | |
unsigned int | size () const |
Returns the size the current Debug directory needs after rebuilding. More... | |
int | write (const std::string &strFilename, unsigned int uiOffset) const |
Writes the current Debug directory back to a file. More... | |
unsigned int | calcNumberOfEntries () const |
Returns the number of DebugDirectory image structures in the current DebugDirectory. More... | |
void | addEntry () |
Adds a new debug structure. More... | |
void | removeEntry (std::size_t uiIndex) |
Removes a debug structure. More... | |
std::uint32_t | getCharacteristics (std::size_t uiIndex) const |
Returns the Characteristics value of a debug structure. More... | |
std::uint32_t | getTimeDateStamp (std::size_t uiIndex) const |
Returns the TimeDateStamp value of a debug structure. More... | |
std::uint16_t | getMajorVersion (std::size_t uiIndex) const |
Returns the MajorVersion value of a debug structure. More... | |
std::uint16_t | getMinorVersion (std::size_t uiIndex) const |
Returns the MinorVersion value of a debug structure. More... | |
std::uint32_t | getType (std::size_t uiIndex) const |
Returns the Type value of a debug structure. More... | |
std::uint32_t | getSizeOfData (std::size_t uiIndex) const |
Returns the SizeOfData value of a debug structure. More... | |
std::uint32_t | getAddressOfRawData (std::size_t uiIndex) const |
Returns the AddressOfRawData value of a debug structure. More... | |
std::uint32_t | getPointerToRawData (std::size_t uiIndex) const |
Returns the PointerToRawData value of a debug structure. More... | |
std::vector< std::uint8_t > | getData (std::size_t index) const |
void | setCharacteristics (std::size_t uiIndex, std::uint32_t dwValue) |
Sets the Characteristics value of a debug structure. More... | |
void | setTimeDateStamp (std::size_t uiIndex, std::uint32_t dwValue) |
Sets the TimeDateStamp value of a debug structure. More... | |
void | setMajorVersion (std::size_t uiIndex, std::uint16_t wValue) |
Sets the MajorVersion value of a debug structure. More... | |
void | setMinorVersion (std::size_t uiIndex, std::uint16_t wValue) |
Sets the MinorVersion value of a debug structure. More... | |
void | setType (std::size_t uiIndex, std::uint32_t dwValue) |
Sets the Type value of a debug structure. More... | |
void | setSizeOfData (std::size_t uiIndex, std::uint32_t dwValue) |
Sets the SizeOfData value of a debug structure. More... | |
void | setAddressOfRawData (std::size_t uiIndex, std::uint32_t dwValue) |
Sets the AddressOfRawData value of a debug structure. More... | |
void | setPointerToRawData (std::size_t uiIndex, std::uint32_t dwValue) |
Sets the PointerToRawData value of a debug structure. More... | |
void | setData (std::size_t index, const std::vector< std::uint8_t > &data) |
const std::vector< std::pair< unsigned int, unsigned int > > & | getOccupiedAddresses () const |
Protected Member Functions | |
void | read (ImageLoader &imageLoader, std::vector< PELIB_IMG_DEBUG_DIRECTORY > &debugInfo, std::uint32_t rva, std::uint32_t size) |
Protected Attributes | |
std::vector< PELIB_IMG_DEBUG_DIRECTORY > | m_vDebugInfo |
Stores the various DebugDirectory structures. More... | |
std::vector< std::pair< unsigned int, unsigned int > > | m_occupiedAddresses |
Stores RVAs which are occupied by this debug directory. More... | |
Class that handles the Debug directory.
|
virtualdefault |
void PeLib::DebugDirectory::addEntry | ( | ) |
Adds a new debug structure.
Adds a new debug structure to the debug directory. The initial values of all members of the structure are undefined.
unsigned int PeLib::DebugDirectory::calcNumberOfEntries | ( | ) | const |
Returns the number of DebugDirectory image structures in the current DebugDirectory.
void PeLib::DebugDirectory::clear | ( | ) |
std::uint32_t PeLib::DebugDirectory::getAddressOfRawData | ( | std::size_t | uiIndex | ) | const |
Returns the AddressOfRawData value of a debug structure.
Returns the AddressOfRawData value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
std::uint32_t PeLib::DebugDirectory::getCharacteristics | ( | std::size_t | uiIndex | ) | const |
Returns the Characteristics value of a debug structure.
Returns the Characteristics value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
std::vector< std::uint8_t > PeLib::DebugDirectory::getData | ( | std::size_t | index | ) | const |
std::uint16_t PeLib::DebugDirectory::getMajorVersion | ( | std::size_t | uiIndex | ) | const |
Returns the MajorVersion value of a debug structure.
Returns the MajorVersion value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
std::uint16_t PeLib::DebugDirectory::getMinorVersion | ( | std::size_t | uiIndex | ) | const |
Returns the MinorVersion value of a debug structure.
Returns the MinorVersion value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
const std::vector< std::pair< unsigned int, unsigned int > > & PeLib::DebugDirectory::getOccupiedAddresses | ( | ) | const |
std::uint32_t PeLib::DebugDirectory::getPointerToRawData | ( | std::size_t | uiIndex | ) | const |
Returns the PointerToRawData value of a debug structure.
Returns the PointerToRawData value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
std::uint32_t PeLib::DebugDirectory::getSizeOfData | ( | std::size_t | uiIndex | ) | const |
Returns the SizeOfData value of a debug structure.
Returns the SizeOfData value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
std::uint32_t PeLib::DebugDirectory::getTimeDateStamp | ( | std::size_t | uiIndex | ) | const |
Returns the TimeDateStamp value of a debug structure.
Returns the TimeDateStamp value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
std::uint32_t PeLib::DebugDirectory::getType | ( | std::size_t | uiIndex | ) | const |
Returns the Type value of a debug structure.
Returns the Type value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
|
protected |
int PeLib::DebugDirectory::read | ( | std::istream & | inStream, |
ImageLoader & | imageLoader | ||
) |
Reads the Debug directory from a file.
inStream | Input stream. |
imageLoader | A valid image loader reference which is necessary because some RVA calculations need to be done. |
void PeLib::DebugDirectory::rebuild | ( | std::vector< std::uint8_t > & | vBuffer | ) | const |
Rebuilds the current Debug directory.
Rebuilds the current debug directory.
vBuffer | Buffer where the rebuilt directory is stored. |
void PeLib::DebugDirectory::removeEntry | ( | std::size_t | uiIndex | ) |
Removes a debug structure.
Removes a debug structure from the current debug directory. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
void PeLib::DebugDirectory::setAddressOfRawData | ( | std::size_t | uiIndex, |
std::uint32_t | dwValue | ||
) |
Sets the AddressOfRawData value of a debug structure.
Changes the AddressOfRawData value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
dwValue | New value of the AddressOfRawData value of the debug structure. |
void PeLib::DebugDirectory::setCharacteristics | ( | std::size_t | uiIndex, |
std::uint32_t | dwValue | ||
) |
Sets the Characteristics value of a debug structure.
Changes the Characteristics value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
dwValue | New value of the Characteristics value of the debug structure. |
void PeLib::DebugDirectory::setData | ( | std::size_t | index, |
const std::vector< std::uint8_t > & | data | ||
) |
void PeLib::DebugDirectory::setMajorVersion | ( | std::size_t | uiIndex, |
std::uint16_t | wValue | ||
) |
Sets the MajorVersion value of a debug structure.
Changes the MajorVersion value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
wValue | New value of the MajorVersion value of the debug structure. |
void PeLib::DebugDirectory::setMinorVersion | ( | std::size_t | uiIndex, |
std::uint16_t | wValue | ||
) |
Sets the MinorVersion value of a debug structure.
Changes the MinorVersion value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
wValue | New value of the MinorVersion value of the debug structure. |
void PeLib::DebugDirectory::setPointerToRawData | ( | std::size_t | uiIndex, |
std::uint32_t | dwValue | ||
) |
Sets the PointerToRawData value of a debug structure.
Changes the PointerToRawData value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
dwValue | New value of the PointerToRawData value of the debug structure. |
void PeLib::DebugDirectory::setSizeOfData | ( | std::size_t | uiIndex, |
std::uint32_t | dwValue | ||
) |
Sets the SizeOfData value of a debug structure.
Changes the SizeOfData value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
dwValue | New value of the SizeOfData value of the debug structure. |
void PeLib::DebugDirectory::setTimeDateStamp | ( | std::size_t | uiIndex, |
std::uint32_t | dwValue | ||
) |
Sets the TimeDateStamp value of a debug structure.
Changes the TimeDateStamp value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
dwValue | New value of the TimeDateStamp value of the debug structure. |
void PeLib::DebugDirectory::setType | ( | std::size_t | uiIndex, |
std::uint32_t | dwValue | ||
) |
Sets the Type value of a debug structure.
Changes the Type value of a debug structure. If an invalid structure is specified by the parameter uiIndex the result will be undefined behaviour.
uiIndex | Identifies the debug structure. |
dwValue | New value of the Type value of the debug structure. |
unsigned int PeLib::DebugDirectory::size | ( | ) | const |
Returns the size the current Debug directory needs after rebuilding.
int PeLib::DebugDirectory::write | ( | const std::string & | strFilename, |
unsigned int | uiOffset | ||
) | const |
Writes the current Debug directory back to a file.
strFilename | Name of the file which will be written. |
uiOffset | File offset where the debug directory will be stored. |
|
protected |
Stores RVAs which are occupied by this debug directory.
|
protected |
Stores the various DebugDirectory structures.