retdec
|
Class that handles the export directory. More...
#include <ExportDirectory.h>
Public Member Functions | |
virtual | ~ExportDirectory ()=default |
int | read (ImageLoader &imageLoader) |
Load the export directory from the image loader. More... | |
void | addFunction (const std::string &strFuncname, std::uint32_t dwFuncAddr) |
Add another function to be exported. More... | |
unsigned int | calcNumberOfFunctions () const |
void | clear () |
int | getFunctionIndex (const std::string &strFunctionName) const |
Identifies a function through it's name. More... | |
void | rebuild (std::vector< std::uint8_t > &vBuffer, std::uint32_t dwRva) const |
Rebuild the current export directory. More... | |
void | removeFunction (unsigned int index) |
unsigned int | size () const |
Returns the size of the current export directory. More... | |
int | write (const std::string &strFilename, unsigned int uiOffset, unsigned int uiRva) const |
Writes the current export directory to a file. More... | |
void | setNameString (const std::string &strFilename) |
Changes the name of the file (according to the export directory). More... | |
std::string | getNameString () const |
std::string | getFunctionName (std::size_t index) const |
Get the name of an exported function. More... | |
std::uint16_t | getFunctionOrdinal (std::size_t index) const |
Get the ordinal of an exported function. More... | |
std::uint32_t | getAddressOfName (std::size_t index) const |
Get the address of the name of an exported function. More... | |
std::uint32_t | getAddressOfFunction (std::size_t index) const |
Get the address of an exported function. More... | |
void | setFunctionName (std::size_t index, const std::string &strName) |
Change the name of an exported function. More... | |
void | setFunctionOrdinal (std::size_t index, std::uint16_t wValue) |
Change the ordinal of an exported function. More... | |
void | setAddressOfName (std::size_t index, std::uint32_t dwValue) |
Change the address of the name of an exported function. More... | |
void | setAddressOfFunction (std::size_t index, std::uint32_t dwValue) |
Change the address of an exported function. More... | |
std::uint32_t | getBase () const |
Return the Base value of the export directory. More... | |
std::uint32_t | getCharacteristics () const |
Return the Characteristics value of the export directory. More... | |
std::uint32_t | getTimeDateStamp () const |
Return the TimeDateStamp value of the export directory. More... | |
std::uint16_t | getMajorVersion () const |
Return the MajorVersion value of the export directory. More... | |
std::uint16_t | getMinorVersion () const |
Return the MinorVersion value of the export directory. More... | |
std::uint32_t | getName () const |
Return the Name value of the export directory. More... | |
std::uint32_t | getNumberOfFunctions () const |
Return the NumberOfFunctions value of the export directory. More... | |
std::uint32_t | getNumberOfNames () const |
Return the NumberOfNames value of the export directory. More... | |
std::uint32_t | getAddressOfFunctions () const |
Return the AddressOfFunctions value of the export directory. More... | |
std::uint32_t | getAddressOfNames () const |
Return the AddressOfNames value of the export directory. More... | |
std::uint32_t | getAddressOfNameOrdinals () const |
Returns the AddressOfNameOrdinals value. More... | |
void | setBase (std::uint32_t dwValue) |
Set the Base value of the export directory. More... | |
void | setCharacteristics (std::uint32_t dwValue) |
Set the Characteristics value of the export directory. More... | |
void | setTimeDateStamp (std::uint32_t dwValue) |
Set the TimeDateStamp value of the export directory. More... | |
void | setMajorVersion (std::uint16_t wValue) |
Set the MajorVersion value of the export directory. More... | |
void | setMinorVersion (std::uint16_t wValue) |
Set the MinorVersion value of the export directory. More... | |
void | setName (std::uint32_t dwValue) |
Set the Name value of the export directory. More... | |
void | setNumberOfFunctions (std::uint32_t dwValue) |
Set the NumberOfFunctions value of the export directory. More... | |
void | setNumberOfNames (std::uint32_t dwValue) |
Set the NumberOfNames value of the export directory. More... | |
void | setAddressOfFunctions (std::uint32_t dwValue) |
Set the AddressOfFunctions value of the export directory. More... | |
void | setAddressOfNames (std::uint32_t dwValue) |
Set the AddressOfNames value of the export directory. More... | |
void | setAddressOfNameOrdinals (std::uint32_t value) |
const std::vector< std::pair< unsigned int, unsigned int > > & | getOccupiedAddresses () const |
Protected Member Functions | |
void | addOccupiedAddress (const std::string &str, std::uint32_t rva) |
Protected Attributes | |
PELIB_IMAGE_EXP_DIRECTORY | m_ied |
Used to store all necessary information about a file's exported functions. More... | |
std::vector< std::pair< unsigned int, unsigned int > > | m_occupiedAddresses |
Stores RVAs which are occupied by this export directory. More... | |
Class that handles the export directory.
This class handles the export directory.
|
virtualdefault |
void PeLib::ExportDirectory::addFunction | ( | const std::string & | strFuncname, |
std::uint32_t | dwFuncAddr | ||
) |
Add another function to be exported.
strFuncname | Name of the function. |
dwFuncAddr | RVA of the function. |
|
protected |
str | Value of the ASCIIZ string. |
rva | RVA of the begin of the string |
unsigned int PeLib::ExportDirectory::calcNumberOfFunctions | ( | ) | const |
void PeLib::ExportDirectory::clear | ( | ) |
std::uint32_t PeLib::ExportDirectory::getAddressOfFunction | ( | std::size_t | dwIndex | ) | const |
Get the address of an exported function.
dwIndex | Number which identifies an exported function. |
std::uint32_t PeLib::ExportDirectory::getAddressOfFunctions | ( | ) | const |
Return the AddressOfFunctions value of the export directory.
std::uint32_t PeLib::ExportDirectory::getAddressOfName | ( | std::size_t | dwIndex | ) | const |
Get the address of the name of an exported function.
dwIndex | Number which identifies an exported function. |
std::uint32_t PeLib::ExportDirectory::getAddressOfNameOrdinals | ( | ) | const |
Returns the AddressOfNameOrdinals value.
std::uint32_t PeLib::ExportDirectory::getAddressOfNames | ( | ) | const |
Return the AddressOfNames value of the export directory.
std::uint32_t PeLib::ExportDirectory::getBase | ( | ) | const |
Return the Base value of the export directory.
std::uint32_t PeLib::ExportDirectory::getCharacteristics | ( | ) | const |
Return the Characteristics value of the export directory.
int PeLib::ExportDirectory::getFunctionIndex | ( | const std::string & | strFunctionName | ) | const |
Identifies a function through it's name.
Identifies an exported function through it's name.
strFunctionName | Name of the function |
std::string PeLib::ExportDirectory::getFunctionName | ( | std::size_t | dwIndex | ) | const |
Get the name of an exported function.
dwIndex | Number which identifies an exported function. |
std::uint16_t PeLib::ExportDirectory::getFunctionOrdinal | ( | std::size_t | dwIndex | ) | const |
Get the ordinal of an exported function.
dwIndex | Number which identifies an exported function. |
std::uint16_t PeLib::ExportDirectory::getMajorVersion | ( | ) | const |
Return the MajorVersion value of the export directory.
std::uint16_t PeLib::ExportDirectory::getMinorVersion | ( | ) | const |
Return the MinorVersion value of the export directory.
std::uint32_t PeLib::ExportDirectory::getName | ( | ) | const |
Return the Name value of the export directory.
std::string PeLib::ExportDirectory::getNameString | ( | ) | const |
std::uint32_t PeLib::ExportDirectory::getNumberOfFunctions | ( | ) | const |
Return the NumberOfFunctions value of the export directory.
std::uint32_t PeLib::ExportDirectory::getNumberOfNames | ( | ) | const |
Return the NumberOfNames value of the export directory.
const std::vector< std::pair< unsigned int, unsigned int > > & PeLib::ExportDirectory::getOccupiedAddresses | ( | ) | const |
std::uint32_t PeLib::ExportDirectory::getTimeDateStamp | ( | ) | const |
Return the TimeDateStamp value of the export directory.
int PeLib::ExportDirectory::read | ( | ImageLoader & | imageLoader | ) |
Load the export directory from the image loader.
imageLoader | Initialized image loader |
void PeLib::ExportDirectory::rebuild | ( | std::vector< std::uint8_t > & | vBuffer, |
std::uint32_t | dwRva | ||
) | const |
Rebuild the current export directory.
vBuffer | Buffer where the rebuilt export directory is written to. |
dwRva | RVA of the export directory. |
void PeLib::ExportDirectory::removeFunction | ( | unsigned int | index | ) |
void PeLib::ExportDirectory::setAddressOfFunction | ( | std::size_t | dwIndex, |
std::uint32_t | dwValue | ||
) |
Change the address of an exported function.
dwIndex | Number which identifies an exported function. |
dwValue | The RVA of that function. |
void PeLib::ExportDirectory::setAddressOfFunctions | ( | std::uint32_t | dwValue | ) |
Set the AddressOfFunctions value of the export directory.
dwValue | The AddressOfFunctions of the export directory. |
void PeLib::ExportDirectory::setAddressOfName | ( | std::size_t | dwIndex, |
std::uint32_t | dwValue | ||
) |
Change the address of the name of an exported function.
dwIndex | Number which identifies an exported function. |
dwValue | The RVA of the name string of that function. |
void PeLib::ExportDirectory::setAddressOfNameOrdinals | ( | std::uint32_t | value | ) |
void PeLib::ExportDirectory::setAddressOfNames | ( | std::uint32_t | dwValue | ) |
Set the AddressOfNames value of the export directory.
dwValue | The AddressOfNames of the export directory. |
void PeLib::ExportDirectory::setBase | ( | std::uint32_t | dwValue | ) |
Set the Base value of the export directory.
dwValue | The ordinal base of the export directory. |
void PeLib::ExportDirectory::setCharacteristics | ( | std::uint32_t | dwValue | ) |
Set the Characteristics value of the export directory.
dwValue | The Characteristics of the export directory. |
void PeLib::ExportDirectory::setFunctionName | ( | std::size_t | dwIndex, |
const std::string & | strName | ||
) |
Change the name of an exported function.
dwIndex | Number which identifies an exported function. |
strName | The name of that function. |
void PeLib::ExportDirectory::setFunctionOrdinal | ( | std::size_t | dwIndex, |
std::uint16_t | wValue | ||
) |
Change the ordinal of an exported function.
dwIndex | Number which identifies an exported function. |
wValue | The ordinal of that function. |
void PeLib::ExportDirectory::setMajorVersion | ( | std::uint16_t | wValue | ) |
Set the MajorVersion value of the export directory.
wValue | The MajorVersion of the export directory. |
void PeLib::ExportDirectory::setMinorVersion | ( | std::uint16_t | wValue | ) |
Set the MinorVersion value of the export directory.
wValue | The MinorVersion of the export directory. |
void PeLib::ExportDirectory::setName | ( | std::uint32_t | dwValue | ) |
Set the Name value of the export directory.
dwValue | The Name of the export directory. |
void PeLib::ExportDirectory::setNameString | ( | const std::string & | strFilename | ) |
Changes the name of the file (according to the export directory).
Changes the filename according to the export directory.
strFilename | New filename. |
void PeLib::ExportDirectory::setNumberOfFunctions | ( | std::uint32_t | dwValue | ) |
Set the NumberOfFunctions value of the export directory.
dwValue | The NumberOfFunctions of the export directory. |
void PeLib::ExportDirectory::setNumberOfNames | ( | std::uint32_t | dwValue | ) |
Set the NumberOfNames value of the export directory.
dwValue | The NumberOfNames of the export directory. |
void PeLib::ExportDirectory::setTimeDateStamp | ( | std::uint32_t | dwValue | ) |
Set the TimeDateStamp value of the export directory.
dwValue | The TimeDateStamp of the export directory. |
unsigned int PeLib::ExportDirectory::size | ( | ) | const |
Returns the size of the current export directory.
int PeLib::ExportDirectory::write | ( | const std::string & | strFilename, |
unsigned int | uiOffset, | ||
unsigned int | uiRva | ||
) | const |
Writes the current export directory to a file.
strFilename | Name of the file. |
uiOffset | File offset the export directory will be written to. |
uiRva | RVA of the export directory. |
|
protected |
Used to store all necessary information about a file's exported functions.
|
protected |
Stores RVAs which are occupied by this export directory.