retdec
|
Class that handles the Import Address Table (IAT) More...
#include <IatDirectory.h>
Public Member Functions | |
virtual | ~IatDirectory ()=default |
int | read (const void *buffer, std::size_t buffersize) |
Reads the Import Address Table from a PE file. More... | |
int | read (PeLib::ImageLoader &imageLoader) |
Reads the Import Address Table from an image loader. More... | |
unsigned int | calcNumberOfAddresses () const |
Returns the number of fields in the IAT. More... | |
void | addAddress (std::uint32_t dwValue) |
Adds another address to the IAT. More... | |
void | removeAddress (unsigned int index) |
Removes an address from the IAT. More... | |
void | clear () |
Empties the IAT. More... | |
void | rebuild (std::vector< std::uint8_t > &vBuffer) const |
unsigned int | size () const |
Returns the size of the current IAT. More... | |
int | write (const std::string &strFilename, unsigned int uiOffset) const |
Writes the current IAT to a file. More... | |
std::uint32_t | getAddress (unsigned int index) const |
Retrieve the value of a field in the IAT. More... | |
void | setAddress (std::uint32_t dwAddrnr, std::uint32_t dwValue) |
Change the value of a field in the IAT. More... | |
Protected Attributes | |
std::vector< std::uint32_t > | m_vIat |
Stores the individual IAT fields. More... | |
Class that handles the Import Address Table (IAT)
This class can read and modify the Import Address Table of a PE file.
|
virtualdefault |
void PeLib::IatDirectory::addAddress | ( | std::uint32_t | dwValue | ) |
Adds another address to the IAT.
Adds another field to the IAT.
dwValue | dwValue of the new field. |
unsigned int PeLib::IatDirectory::calcNumberOfAddresses | ( | ) | const |
Returns the number of fields in the IAT.
Returns the number of fields in the IAT. This is equivalent to the number of imported functions.
void PeLib::IatDirectory::clear | ( | ) |
Empties the IAT.
Delete all entries from the IAT.
std::uint32_t PeLib::IatDirectory::getAddress | ( | unsigned int | index | ) | const |
Retrieve the value of a field in the IAT.
Returns the dwValue of a field in the IAT.
index | Number identifying the field. |
int PeLib::IatDirectory::read | ( | const void * | buffer, |
std::size_t | buffersize | ||
) |
Reads the Import Address Table from a PE file.
Reads the Import Address table from an image
buffer | Pointer to the IAT data |
buffersize | Length of the data pointed by 'buffer' |
int PeLib::IatDirectory::read | ( | PeLib::ImageLoader & | imageLoader | ) |
Reads the Import Address Table from an image loader.
Reads the Import Address table from an image
imageLoader | Initialized image loader |
void PeLib::IatDirectory::rebuild | ( | std::vector< std::uint8_t > & | vBuffer | ) | const |
Rebuilds the complete Import Address Table.
vBuffer | Buffer where the rebuilt IAT will be stored. |
void PeLib::IatDirectory::removeAddress | ( | unsigned int | index | ) |
Removes an address from the IAT.
Removes an address from the IAT.
index | Number identifying the field. |
void PeLib::IatDirectory::setAddress | ( | std::uint32_t | dwAddrnr, |
std::uint32_t | dwValue | ||
) |
Change the value of a field in the IAT.
Updates the dwValue of a field in the IAT.
dwAddrnr | Number identifying the field. |
dwValue | New dwValue of the field. |
unsigned int PeLib::IatDirectory::size | ( | ) | const |
Returns the size of the current IAT.
int PeLib::IatDirectory::write | ( | const std::string & | strFilename, |
unsigned int | uiOffset | ||
) | const |
Writes the current IAT to a file.
|
protected |
Stores the individual IAT fields.