Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

BoundImportDirectory Class Reference

Class that handles the BoundImport directory. More...

#include <BoundImportDirectory.h>

List of all members.

Public Member Functions

int addBoundImport (const std::string &strModuleName, dword dwTds, word dwOmn, word wWfr)
 Adds another bound import.

void addForwardedModule (dword dwBidnr, const std::string &name, dword timeStamp=0, word offsetModuleName=0, word forwardedModules=0)
word calcNumberOfModuleForwarderRefs (dword dwBidnr) const
void clear ()
 Empties the BoundImport directory.

int getModuleIndex (const std::string &strModuleName) const
 Identifies a module through it's name.

std::string getModuleName (dword dwBidnr, dword forwardedModule) const
std::string getModuleName (dword dwBidnr) const
 Retrieves the ModuleName value of a bound import.

word getNumberOfModuleForwarderRefs (dword dwBidnr, dword forwardedModule) const
word getNumberOfModuleForwarderRefs (dword dwBidnr) const
 Retrieves the NumberOfModuleForwarderRefs value of a bound import.

int getNumberOfModules () const
 Returns the number of files in the BoundImport directory.

word getOffsetModuleName (dword dwBidnr, dword forwardedModule) const
word getOffsetModuleName (dword dwBidnr) const
 Retrieves the OffsetModuleName value of a bound import.

dword getTimeDateStamp (dword dwBidnr, dword forwardedModule) const
dword getTimeDateStamp (dword dwBidnr) const
 Retrieves the TimeDateStamp value of a bound import.

int read (const std::string &strFileName, dword dwOffset, dword dwSize)
 Reads the BoundImport directory table from a PE file.

void rebuild (std::vector< byte > &vBuffer, bool fMakeValid=true) const
 Rebuilds the BoundImport directory.

void removeBoundImport (const std::string &strModuleName)
 Removes a bound import.

void removeForwardedModule (dword dwBidnr, word forwardedModule)
void setModuleName (dword dwBidnr, dword forwardedModule, const std::string &strModuleName)
void setModuleName (dword dwBidnr, const std::string &strModuleName)
 Updates the ModuleName value of a bound import.

void setNumberOfModuleForwarderRefs (dword dwBidnr, dword forwardedModule, word wMfr)
void setNumberOfModuleForwarderRefs (dword dwBidnr, word wMfr)
 Updates the NumberOfModuleForwarderRefs value of a bound import.

void setOffsetModuleName (dword dwBidnr, dword forwardedModule, word wOmn)
void setOffsetModuleName (dword dwBidnr, word wOmn)
 Updates the OffsetModuleName value of a bound import.

void setTimeDateStamp (dword dwBidnr, dword forwardedModule, dword dwTds)
void setTimeDateStamp (dword dwBidnr, dword dwTds)
 Updates the TimeDateStamp value of a bound import.

unsigned int size () const
 Returns the size of the BoundImport directory.

int write (const std::string &strFilename, dword dwOffset, bool fMakeValid=true) const
 Writes the current bound import directory to a file.


Private Attributes

std::vector< PELIB_IMAGE_BOUND_DIRECTORY > m_vIbd
 Stores the individual BoundImport fields.


Detailed Description

Class that handles the BoundImport directory.

This class can read and modify the BoundImport directory table of a PE file.


Member Function Documentation

int addBoundImport const std::string &  strModuleName,
dword  dwTds,
word  wOmn,
word  wWfr
 

Adds another bound import.

Adds another bound import to the BoundImport directory.

Parameters:
strModuleName Name of the PE file which will be imported.
dwTds Value of the TimeDateStamp of the bound import field.
wOmn Value of the OffsetModuleName of the bound import field.
wWfr Value of the NumberOfModuleForwarderRefs of the bound import field.

void clear  ) 
 

Empties the BoundImport directory.

Removes all bound import files.

int getModuleIndex const std::string &  strModuleName  )  const
 

Identifies a module through it's name.

Searches for the first instance of a module with the given modulename.

Parameters:
strModuleName The name of a module.
Returns:
The id of the module.

std::string getModuleName dword  dwBidnr  )  const
 

Retrieves the ModuleName value of a bound import.

Retrieves the value of the ModuleName value of a bound import field.

Parameters:
dwBidnr Number of the bound import field.
Returns:
Value of the ModuleName of the bound import field.

word getNumberOfModuleForwarderRefs dword  dwBidnr  )  const
 

Retrieves the NumberOfModuleForwarderRefs value of a bound import.

Retrieves the value of the NumberOfModuleForwarderRefs value of a bound import field.

Parameters:
dwBidnr Number of the bound import field.
Returns:
Value of the NumberOfModuleForwarderRefs of the bound import field.

int getNumberOfModules  )  const
 

Returns the number of files in the BoundImport directory.

Returns:
Number of files in the current BoundImport directory.

word getOffsetModuleName dword  dwBidnr  )  const
 

Retrieves the OffsetModuleName value of a bound import.

Retrieves the value of the OffsetModuleName value of a bound import field.

Parameters:
dwBidnr Number of the bound import field.
Returns:
Value of the OffsetModuleName of the bound import field.

dword getTimeDateStamp dword  dwBidnr  )  const
 

Retrieves the TimeDateStamp value of a bound import.

Retrieves the value of the TimeDateStamp value of a bound import field.

Parameters:
dwBidnr Number of the bound import field.
Returns:
Value of the TimeDateStamp of the bound import field.

int read const std::string &  strModuleName,
dword  dwOffset,
dword  dwSize
 

Reads the BoundImport directory table from a PE file.

Reads the BoundImport directory from a PE file.

Parameters:
strModuleName The name of the PE file from which the BoundImport directory is read.
dwOffset The file offset where the BoundImport directory can be found (see #PeFile::PeHeader::getIDBoundImportRVA).
dwSize The size of the BoundImport directory (see #PeFile::PeHeader::getIDBoundImportSize).

void rebuild std::vector< byte > &  vBuffer,
bool  fMakeValid = true
const
 

Rebuilds the BoundImport directory.

Rebuilds the BoundImport directory. The rebuilded BoundImport directory can then be written back to a PE file.

Parameters:
vBuffer Buffer where the rebuilt BoundImport directory will be stored.
fMakeValid If this flag is true a valid directory will be produced.

Here is the call graph for this function:

void removeBoundImport const std::string &  strModuleName  ) 
 

Removes a bound import.

Removes a field specified by the parameter filename from the BoundImport directory.

Parameters:
strModuleName Name of the file whose field will be removed from the BoundImport directory.

void setModuleName dword  dwBidnr,
const std::string &  strModuleName
 

Updates the ModuleName value of a bound import.

Changes the ModuleName value of an existing bound import field.

Parameters:
dwBidnr Number of the bound import field which will be changed.
strModuleName New value of the ModuleName of the bound import field.

void setNumberOfModuleForwarderRefs dword  dwBidnr,
word  wMfr
 

Updates the NumberOfModuleForwarderRefs value of a bound import.

Changes the NumberOfModuleForwarderRefs value of an existing bound import field.

Parameters:
dwBidnr Number of the bound import field which will be changed.
wMfr New value of the NumberOfModuleForwarderRefs of the bound import field.

void setOffsetModuleName dword  dwBidnr,
word  wOmn
 

Updates the OffsetModuleName value of a bound import.

Changes the OffsetModuleName value of an existing bound import field.

Parameters:
dwBidnr Number of the bound import field which will be changed.
wOmn New value of the OffsetModuleName of the bound import field.

void setTimeDateStamp dword  dwBidnr,
dword  dwTds
 

Updates the TimeDateStamp value of a bound import.

Changes the TimeDateStamp value of an existing bound import field.

Parameters:
dwBidnr Number of the bound import field which will be changed.
dwTds New value of the TimeDateStamp of the bound import field.

unsigned int size  )  const
 

Returns the size of the BoundImport directory.

Returns the size of the rebuilt BoundImportDirectory.

Returns:
Size of the rebuilt BoundImportDirectory.

int write const std::string &  strFilename,
dword  dwOffset,
bool  fMakeValid = true
const
 

Writes the current bound import directory to a file.

Parameters:
strFilename Name of the file.
dwOffset File offset the bound importdirectory will be written to.
fMakeValid If this flag is true a valid directory will be produced.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Mon Jan 17 20:50:09 2005 for PeLib by doxygen 1.3.7