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

ExportDirectory Class Reference

Class that handles the export directory. More...

#include <ExportDirectory.h>

List of all members.

Public Member Functions

void addFunction (const std::string &strFuncname, dword dwFuncAddr)
 Add another function to be exported.

dword getAddressOfFunction (dword dwIndex) const
 Get the address of an exported function.

dword getAddressOfFunctions () const
 Return the AddressOfFunctions value of the export directory.

dword getAddressOfName (dword dwIndex) const
 Get the address of the name of an exported function.

dword getAddressOfNameOrdinals () const
 Returns the AddressOfNameOrdinals value.

dword getAddressOfNames () const
 Return the AddressOfNames value of the export directory.

dword getBase () const
 Return the Base value of the export directory.

dword getCharacteristics () const
 Return the Characteristics value of the export directory.

int getFunctionIndex (const std::string &strFunctionName) const
 Identifies a function through it's name.

std::string getFunctionName (dword dwIndex) const
 Get the name of an exported function.

word getFunctionOrdinal (dword dwIndex) const
 Get the ordinal of an exported function.

word getMajorVersion () const
 Return the MajorVersion value of the export directory.

word getMinorVersion () const
 Return the MinorVersion value of the export directory.

dword getName () const
 Return the Name value of the export directory.

std::string getNameString () const
dword getNumberOfAddressOfFunctionNames () const
 Returns the number of AddressOfFunctionNames values.

dword getNumberOfAddressOfFunctions () const
 Returns the number of AddressOfFunction values.

dword getNumberOfFunctions () const
 Return the NumberOfFunctions value of the export directory.

dword getNumberOfNameOrdinals () const
 Returns the number of NameOrdinals.

dword getNumberOfNames () const
 Return the NumberOfNames value of the export directory.

dword getTimeDateStamp () const
 Return the TimeDateStamp value of the export directory.

int read (const std::string &strFilename, unsigned int uiOffset, unsigned int uiSize, const PeHeader &pehHeader)
 Read a file's export directory.

void rebuild (std::vector< byte > &vBuffer, dword dwRva) const
 Rebuild the current export directory.

void setAddressOfFunction (dword dwIndex, dword dwValue)
 Change the address of an exported function.

void setAddressOfFunctions (dword dwValue)
 Set the AddressOfFunctions value of the export directory.

void setAddressOfName (dword dwIndex, dword dwValue)
 Change the address of the name of an exported function.

void setAddressOfNames (dword dwValue)
 Set the AddressOfNames value of the export directory.

void setBase (dword dwValue)
 Set the Base value of the export directory.

void setCharacteristics (dword dwValue)
 Set the Characteristics value of the export directory.

void setFunctionName (dword dwIndex, const std::string &strName)
 Change the name of an exported function.

void setFunctionOrdinal (dword dwIndex, word wValue)
 Change the ordinal of an exported function.

void setMajorVersion (word wValue)
 Set the MajorVersion value of the export directory.

void setMinorVersion (word wValue)
 Set the MinorVersion value of the export directory.

void setName (dword dwValue)
 Set the Name value of the export directory.

void setNameString (const std::string &strFilename)
 Changes the name of the file (according to the export directory).

void setNumberOfFunctions (dword dwValue)
 Set the NumberOfFunctions value of the export directory.

void setNumberOfNames (dword dwValue)
 Set the NumberOfNames value of the export directory.

void setTimeDateStamp (dword dwValue)
 Set the TimeDateStamp value of the export directory.

unsigned int size () const
 Returns the size of the current export directory.

int write (const std::string &strFilename, unsigned int uiOffset, unsigned int uiRva) const
 Writes the current export directory to a file.


Private Attributes

PELIB_IMAGE_EXP_DIRECTORY m_ied
 Used to store all necessary information about a file's exported functions.


Detailed Description

Class that handles the export directory.

This class handles the export directory.

Todo:
getNameString


Member Function Documentation

void addFunction const std::string &  strFuncname,
dword  dwFuncAddr
 

Add another function to be exported.

Parameters:
strFuncname Name of the function.
dwFuncAddr RVA of the function.

dword getAddressOfFunction dword  dwIndex  )  const
 

Get the address of an exported function.

Parameters:
dwIndex Number which identifies an exported function.
Returns:
The RVA of that function.

dword getAddressOfFunctions  )  const
 

Return the AddressOfFunctions value of the export directory.

Returns:
The AddressOfFunctions of the export directory.

dword getAddressOfName dword  dwIndex  )  const
 

Get the address of the name of an exported function.

Parameters:
dwIndex Number which identifies an exported function.
Returns:
The RVA of the name string of that function.

dword getAddressOfNameOrdinals  )  const
 

Returns the AddressOfNameOrdinals value.

Returns:
The AddressOfNameOrdinals of the export directory.

dword getAddressOfNames  )  const
 

Return the AddressOfNames value of the export directory.

Returns:
The AddressOfNames of the export directory.

dword getBase  )  const
 

Return the Base value of the export directory.

Returns:
The ordinal base of the export directory.

dword getCharacteristics  )  const
 

Return the Characteristics value of the export directory.

Returns:
The characteristics of the export directory.

int getFunctionIndex const std::string &  strFunctionName  )  const
 

Identifies a function through it's name.

Identifies an exported function through it's name.

Parameters:
strFunctionName Name of the function
Returns:
Number which identifies the functions.

std::string getFunctionName dword  dwIndex  )  const
 

Get the name of an exported function.

Parameters:
dwIndex Number which identifies an exported function.
Returns:
The name of that function.

word getFunctionOrdinal dword  dwIndex  )  const
 

Get the ordinal of an exported function.

Parameters:
dwIndex Number which identifies an exported function.
Returns:
The ordinal of that function.

word getMajorVersion  )  const
 

Return the MajorVersion value of the export directory.

Returns:
The MajorVersion of the export directory.

word getMinorVersion  )  const
 

Return the MinorVersion value of the export directory.

Returns:
The MinorVersion of the export directory.

dword getName  )  const
 

Return the Name value of the export directory.

Returns:
The RVA of the name of the file.

dword getNumberOfFunctions  )  const
 

Return the NumberOfFunctions value of the export directory.

Returns:
The NumberOfFunctions of the export directory.

dword getNumberOfNames  )  const
 

Return the NumberOfNames value of the export directory.

Returns:
The NumberOfNames of the export directory.

dword getTimeDateStamp  )  const
 

Return the TimeDateStamp value of the export directory.

Returns:
The time/date stamp of the export directory.

int read const std::string &  strFilename,
unsigned int  uiOffset,
unsigned int  uiSize,
const PeHeader &  pehHeader
 

Read a file's export directory.

Parameters:
strFilename Name of the file.
uiOffset File offset of the export directory.
uiSize Size of the export directory.
pehHeader A valid PE header which is necessary because some RVA calculations need to be done.
Todo:
: Proper use of InputBuffer

void rebuild std::vector< byte > &  vBuffer,
dword  dwRva
const
 

Rebuild the current export directory.

Parameters:
vBuffer Buffer where the rebuilt export directory is written to.
dwRva RVA of the export directory.
Todo:
fValid flag

void setAddressOfFunction dword  dwIndex,
dword  dwValue
 

Change the address of an exported function.

Parameters:
dwIndex Number which identifies an exported function.
dwValue The RVA of that function.

void setAddressOfFunctions dword  dwValue  ) 
 

Set the AddressOfFunctions value of the export directory.

Parameters:
dwValue The AddressOfFunctions of the export directory.

void setAddressOfName dword  dwIndex,
dword  dwValue
 

Change the address of the name of an exported function.

Parameters:
dwIndex Number which identifies an exported function.
dwValue The RVA of the name string of that function.

void setAddressOfNames dword  dwValue  ) 
 

Set the AddressOfNames value of the export directory.

Parameters:
dwValue The AddressOfNames of the export directory.

void setBase dword  dwValue  ) 
 

Set the Base value of the export directory.

Parameters:
dwValue The ordinal base of the export directory.

void setCharacteristics dword  dwValue  ) 
 

Set the Characteristics value of the export directory.

Parameters:
dwValue The Characteristics of the export directory.

void setFunctionName dword  dwIndex,
const std::string &  strName
 

Change the name of an exported function.

Parameters:
dwIndex Number which identifies an exported function.
strName The name of that function.

void setFunctionOrdinal dword  dwIndex,
word  wValue
 

Change the ordinal of an exported function.

Parameters:
dwIndex Number which identifies an exported function.
wValue The ordinal of that function.

void setMajorVersion word  wValue  ) 
 

Set the MajorVersion value of the export directory.

Parameters:
wValue The MajorVersion of the export directory.

void setMinorVersion word  wValue  ) 
 

Set the MinorVersion value of the export directory.

Parameters:
wValue The MinorVersion of the export directory.

void setName dword  dwValue  ) 
 

Set the Name value of the export directory.

Parameters:
dwValue The Name of the export directory.

void setNameString const std::string &  strFilename  ) 
 

Changes the name of the file (according to the export directory).

Changes the filename according to the export directory.

Parameters:
strFilename New filename.

void setNumberOfFunctions dword  dwValue  ) 
 

Set the NumberOfFunctions value of the export directory.

Parameters:
dwValue The NumberOfFunctions of the export directory.

void setNumberOfNames dword  dwValue  ) 
 

Set the NumberOfNames value of the export directory.

Parameters:
dwValue The NumberOfNames of the export directory.

void setTimeDateStamp dword  dwValue  ) 
 

Set the TimeDateStamp value of the export directory.

Parameters:
dwValue The TimeDateStamp of the export directory.

unsigned int size  )  const
 

Returns the size of the current export directory.

Returns:
Size of the current export directory.

int write const std::string &  strFilename,
unsigned int  uiOffset,
unsigned int  uiRva
const
 

Writes the current export directory to a file.

Parameters:
strFilename Name of the file.
uiOffset File offset the export directory will be written to.
uiRva RVA of the export directory.
Todo:
Check if ofFile.write succeeded.


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