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

ResourceDirectory Class Reference

Class that represents the resource directory of a PE file. More...

#include <ResourceDirectory.h>

Collaboration diagram for ResourceDirectory:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int addResource (const std::string &strResTypeName, const std::string &strResName)
 Adds a new resource.

int addResource (const std::string &strResTypeName, dword dwResId)
 Adds a new resource.

int addResource (dword dwResTypeId, const std::string &strResName)
 Adds a new resource.

int addResource (dword dwResTypeId, dword dwResId)
 Adds a new resource.

int addResourceType (const std::string &strResTypeName)
 Adds a new resource type.

int addResourceType (dword dwResTypeId)
 Adds a new resource type.

unsigned int getNumberOfResources (const std::string &strResTypeName) const
 Returns the number of resources of a certain resource type.

unsigned int getNumberOfResources (dword dwId) const
 Returns the number of resources of a certain resource type.

unsigned int getNumberOfResourcesByIndex (unsigned int uiIndex) const
 Returns the number of resources of a certain resource type.

unsigned int getNumberOfResourceTypes () const
 Returns the number of resource types.

void getResourceData (const std::string &strResTypeName, const std::string &strResName, std::vector< byte > &data) const
 Returns the data of a certain resource.

void getResourceData (const std::string &strResTypeName, dword dwResId, std::vector< byte > &data) const
 Returns the data of a certain resource.

void getResourceData (dword dwResTypeId, const std::string &strResName, std::vector< byte > &data) const
 Returns the data of a certain resource.

void getResourceData (dword dwResTypeId, dword dwResId, std::vector< byte > &data) const
 Returns the data of a certain resource.

void getResourceDataByIndex (unsigned int uiResTypeIndex, unsigned int uiResIndex, std::vector< byte > &data) const
 Returns the data of a certain resource.

dword getResourceId (const std::string &strResTypeName, const std::string &strResName) const
 Returns the ID of a certain resource.

dword getResourceId (dword dwResTypeId, const std::string &strResName) const
 Returns the ID of a certain resource.

dword getResourceIdByIndex (unsigned int uiResTypeIndex, unsigned int uiResIndex) const
 Returns the ID of a certain resource.

std::string getResourceName (const std::string &strResTypeName, dword dwResId) const
 Returns the name of a certain resource.

std::string getResourceName (dword dwResTypeId, dword dwResId) const
 Returns the name of a certain resource.

std::string getResourceNameByIndex (unsigned int uiResTypeIndex, unsigned int uiResIndex) const
 Returns the name of a certain resource.

dword getResourceTypeIdByIndex (unsigned int uiIndex) const
 Returns the ID of a resource type.

std::string getResourceTypeNameByIndex (unsigned int uiIndex) const
 Returns the name of a resource type.

ResourceNodegetRoot ()
void makeValid ()
 Corrects a erroneous resource directory.

int read (const std::string &strFilename, unsigned int uiOffset, unsigned int uiSize, unsigned int uiResDirRva)
 Reads the resource directory from a file.

void rebuild (std::vector< byte > &vBuffer, unsigned int uiRva) const
 Rebuilds the resource directory.

int removeResource (const std::string &strResTypeName, const std::string &strResName)
 Removes a resource.

int removeResource (const std::string &strResTypeName, dword dwResId)
 Removes a resource.

int removeResource (dword dwResTypeId, const std::string &strResName)
 Removes a resource.

int removeResource (dword dwResTypeId, dword dwResId)
 Removes a resource.

int removeResourceType (const std::string &strResTypeName)
 Removes a resource type and all of it's resources.

int removeResourceType (dword dwResTypeId)
 Removes a resource type and all of it's resources.

int removeResourceTypeByIndex (unsigned int uiIndex)
 Removes a resource type and all of it's resources.

int resourceTypeIdToIndex (dword dwResTypeId) const
 Converts a resource type ID to an index.

int resourceTypeNameToIndex (const std::string &strResTypeName) const
 Converts a resource type name to an index.

void setResourceData (const std::string &strResTypeName, const std::string &strResName, std::vector< byte > &data)
 Sets the data of a certain resource.

void setResourceData (const std::string &strResTypeName, dword dwResId, std::vector< byte > &data)
 Sets the data of a certain resource.

void setResourceData (dword dwResTypeId, const std::string &strResName, std::vector< byte > &data)
 Sets the data of a certain resource.

void setResourceData (dword dwResTypeId, dword dwResId, std::vector< byte > &data)
 Sets the data of a certain resource.

void setResourceDataByIndex (unsigned int uiResTypeIndex, unsigned int uiResIndex, std::vector< byte > &data)
 Sets the data of a certain resource.

void setResourceId (const std::string &strResTypeName, const std::string &strResName, dword dwNewResId)
 Sets the ID of a certain resource.

void setResourceId (const std::string &strResTypeName, dword dwResId, dword dwNewResId)
 Sets the ID of a certain resource.

void setResourceId (dword dwResTypeId, const std::string &strResName, dword dwNewResId)
 Sets the ID of a certain resource.

void setResourceId (dword dwResTypeId, dword dwResId, dword dwNewResId)
 Sets the ID of a certain resource.

void setResourceIdByIndex (unsigned int uiResTypeIndex, unsigned int uiResIndex, dword dwNewResId)
 Sets the ID of a certain resource.

void setResourceName (const std::string &strResTypeName, const std::string &strResName, const std::string &strNewResName)
 Sets the name of a certain resource.

void setResourceName (const std::string &strResTypeName, dword dwResId, const std::string &strNewResName)
 Sets the name of a certain resource.

void setResourceName (dword dwResTypeId, const std::string &strResName, const std::string &strNewResName)
 Sets the name of a certain resource.

void setResourceName (dword dwResTypeId, dword dwResId, const std::string &strNewResName)
 Sets the name of a certain resource.

void setResourceNameByIndex (unsigned int uiResTypeIndex, unsigned int uiResIndex, const std::string &strNewResName)
 Sets the name of a certain resource.

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


Private Member Functions

template<typename S, typename T> int addResourceT (S restypeid, T resid, ResourceChild &rc)
 Adds a new resource.

template<typename S, typename T> int getResourceDataT (S restypeid, T resid, std::vector< byte > &data) const
 Returns the data of a resource.

template<typename S, typename T> dword getResourceIdT (S restypeid, T resid) const
 Returns the ID of a resource.

template<typename S, typename T> std::string getResourceNameT (S restypeid, T resid) const
 Returns the name of a resource.

template<typename S, typename T> std::vector< ResourceChild
>::iterator 
locateResourceT (S restypeid, T resid)
 Retrieves an iterator to a specified resource child.

template<typename S, typename T> std::vector< ResourceChild
>::const_iterator 
locateResourceT (S restypeid, T resid) const
 Retrieves an iterator to a specified resource child.

template<typename S, typename T> int removeResourceT (S restypeid, T resid)
 Removes new resource.

template<typename S, typename T> int setResourceDataT (S restypeid, T resid, std::vector< byte > &data)
 Sets the data of a resource.

template<typename S, typename T> int setResourceIdT (S restypeid, T resid, dword dwNewResId)
 Sets the ID of a resource.

template<typename S, typename T> int setResourceNameT (S restypeid, T resid, std::string strNewResName)
 Sets the name of a resource.


Private Attributes

ResourceNode m_rnRoot
 The root node of the resource directory.


Detailed Description

Class that represents the resource directory of a PE file.

The class ResourceDirectory represents the resource directory of a PE file. This class is fundamentally different from the other classes of the PeLib library due to the structure of the ResourceDirectory. For once, it's possible to manipulate the ResourceDirectory through a set of "high level" functions and and through a set of "low level" functions. The "high level" functions are the functions inside the ResourceDirectory class with the exception of getRoot.

getRoot on the other hand is the first "low level" function. Use it to retrieve the root node of the resource tree. Then you can traverse through the tree and manipulate individual nodes and leafs directly using the functions provided by the classes ResourceNode and ResourceLeaf.

There's another difference between the ResourceDirectory class and the other PeLib classes, which is once again caused by the special structure of the PE resource directory. The nodes of the resource tree must be in a certain order. Manipulating the resource tree does not directly sort the nodes correctly as this would cause more trouble than it fixes. That means it's your responsibility to fix the resource tree after manipulating it. PeLib makes the job easy for you, just call the ResourceDirectory::makeValid function.

You might also wonder why there's no size() function in this class. I did not forget it. It's just that it's impossible to calculate the size of the resource directory without rebuilding it. So why should PeLib do this if you can do it just as easily by calling rebuild() and then checking the length of the returned vector.

There are also different ways to serialize (rebuild) the resource tree as it's not a fixed structure that can easily be minimized like most other PE directories.

This means it's entirely possible that the resource tree you read from a file differs from the one PeLib creates. This might cause a minor issue. The original resource tree might be smaller (due to different padding) so it's crucial that you check if there's enough space in the original resource directory before you write the rebuilt resource directory back to the file.


Member Function Documentation

int addResource const std::string &  strResTypeName,
const std::string &  strResName
 

Adds a new resource.

Adds another resource to the resource tree. The first parameter identifies the resource type of the new resource, the second parameter identifies the resource itself.

Parameters:
strResTypeName Name of the resource type.
strResName Name of the resource.

Here is the call graph for this function:

int addResource const std::string &  strResTypeName,
dword  dwResId
 

Adds a new resource.

Adds another resource to the resource tree. The first parameter identifies the resource type of the new resource, the second parameter identifies the resource itself.

Parameters:
strResTypeName Name of the resource type.
dwResId ID of the resource.

Here is the call graph for this function:

int addResource dword  dwResTypeId,
const std::string &  strResName
 

Adds a new resource.

Adds another resource to the resource tree. The first parameter identifies the resource type of the new resource, the second parameter identifies the resource itself.

Parameters:
dwResTypeId ID of the resource type.
strResName Name of the resource.

Here is the call graph for this function:

int addResource dword  dwResTypeId,
dword  dwResId
 

Adds a new resource.

Adds another resource to the resource tree. The first parameter identifies the resource type of the new resource, the second parameter identifies the resource itself.

Parameters:
dwResTypeId ID of the resource type.
dwResId ID of the resource.

Here is the call graph for this function:

int addResourceT restypeid,
resid,
ResourceChild rc
[private]
 

Adds a new resource.

Adds a new resource, resource type and ID are specified by the parameters.

Parameters:
restypeid Identifier of the resource type (either ID or name).
resid Identifier of the resource (either ID or name).
rc ResourceChild that will be added.

int addResourceType const std::string &  strResTypeName  ) 
 

Adds a new resource type.

Adds another resource type. The new resource type is identified by the name strResTypeName.

Parameters:
strResTypeName Name which identifies the resource type.

int addResourceType dword  dwResTypeId  ) 
 

Adds a new resource type.

Adds another resource type. The new resource type is identified by the ID dwResTypeId.

Parameters:
dwResTypeId ID which identifies the resource type.

unsigned int getNumberOfResources const std::string &  strResTypeName  )  const
 

Returns the number of resources of a certain resource type.

Returns the number of resources of a specific resource type.

Parameters:
strResTypeName Name of the resource type.
Returns:
Number of resources of resource type strResTypeName.

unsigned int getNumberOfResources dword  dwId  )  const
 

Returns the number of resources of a certain resource type.

Returns the number of resources of a specific resource type.

Parameters:
dwId ID of the resource type.
Returns:
Number of resources of resource type dwId.

unsigned int getNumberOfResourcesByIndex unsigned int  uiIndex  )  const
 

Returns the number of resources of a certain resource type.

Returns the number of resources of a resource type which was specified through an index. The valid range of the parameter uiIndex is 0...getNumberOfResourceTypes() - 1. Leaving the invalid range leads to undefined behaviour.

Parameters:
uiIndex Index which identifies a resource type.
Returns:
The number of resources of the specified resource type.

unsigned int getNumberOfResourceTypes  )  const
 

Returns the number of resource types.

Returns the number of resource types.

void getResourceData const std::string &  strResTypeName,
const std::string &  strResName,
std::vector< byte > &  data
const
 

Returns the data of a certain resource.

Gets the resource data of a specific resource.

Parameters:
strResTypeName Identifies the resource type of the resource.
strResName Identifies the resource.
data Vector where the data is stored.

Here is the call graph for this function:

void getResourceData const std::string &  strResTypeName,
dword  dwResId,
std::vector< byte > &  data
const
 

Returns the data of a certain resource.

Gets the resource data of a specific resource.

Parameters:
strResTypeName Identifies the resource type of the resource.
dwResId Identifies the resource.
data Vector where the data is stored.

Here is the call graph for this function:

void getResourceData dword  dwResTypeId,
const std::string &  strResName,
std::vector< byte > &  data
const
 

Returns the data of a certain resource.

Gets the resource data of a specific resource.

Parameters:
dwResTypeId Identifies the resource type of the resource.
strResName Identifies the resource.
data Vector where the data is stored.

Here is the call graph for this function:

void getResourceData dword  dwResTypeId,
dword  dwResId,
std::vector< byte > &  data
const
 

Returns the data of a certain resource.

Gets the resource data of a specific resource.

Parameters:
dwResTypeId Identifies the resource type of the resource.
dwResId Identifies the resource.
data Vector where the data is stored.

Here is the call graph for this function:

void getResourceDataByIndex unsigned int  uiResTypeIndex,
unsigned int  uiResIndex,
std::vector< byte > &  data
const
 

Returns the data of a certain resource.

Gets the resource data of a specific resource by index. The valid range of the parameter uiResTypeIndex is 0...getNumberOfResourceTypes() - 1. The valid range of the parameter uiResIndex is 0...getNumberOfResources() - 1. Leaving the invalid range leads to undefined behaviour.

Parameters:
uiResTypeIndex Identifies the resource type of the resource.
uiResIndex Identifies the resource.
data Vector where the data is stored.

int getResourceDataT restypeid,
resid,
std::vector< byte > &  data
const [private]
 

Returns the data of a resource.

Returns the data of a resource, resource type and ID are specified by the parameters.

Parameters:
restypeid Identifier of the resource type (either ID or name).
resid Identifier of the resource (either ID or name).
data The data of the resource will be written into this vector.

dword getResourceId const std::string &  strResTypeName,
const std::string &  strResName
const
 

Returns the ID of a certain resource.

Gets the ID of a specific resource.

Parameters:
strResTypeName Identifies the resource type of the resource.
strResName Identifies the resource.
Returns:
ID of the specified resource.

Here is the call graph for this function:

dword getResourceId dword  dwResTypeId,
const std::string &  strResName
const
 

Returns the ID of a certain resource.

Gets the ID of a specific resource.

Parameters:
dwResTypeId Identifies the resource type of the resource.
strResName Identifies the resource.
Returns:
ID of the specified resource.

Here is the call graph for this function:

dword getResourceIdByIndex unsigned int  uiResTypeIndex,
unsigned int  uiResIndex
const
 

Returns the ID of a certain resource.

Gets the ID of a specific resource by index.

Parameters:
uiResTypeIndex Identifies the resource type of the resource.
uiResIndex Identifies the resource.
Returns:
ID of the specified resource.

dword getResourceIdT restypeid,
resid
const [private]
 

Returns the ID of a resource.

Returns the id of a resource, resource type and ID are specified by the parameters. Note: Calling this function with resid == the ID of the resource makes no sense at all.

Parameters:
restypeid Identifier of the resource type (either ID or name).
resid Identifier of the resource (either ID or name).
Returns:
The ID of the specified resource.

std::string getResourceName const std::string &  strResTypeName,
dword  dwResId
const
 

Returns the name of a certain resource.

Gets the Name of a specific resource.

Parameters:
strResTypeName Identifies the resource type of the resource.
dwResId Identifies the resource.
Returns:
Name of the specified resource.

Here is the call graph for this function:

std::string getResourceName dword  dwResTypeId,
dword  dwResId
const
 

Returns the name of a certain resource.

Gets the Name of a specific resource.

Parameters:
dwResTypeId Identifies the resource type of the resource.
dwResId Identifies the resource.
Returns:
Name of the specified resource.

Here is the call graph for this function:

std::string getResourceNameByIndex unsigned int  uiResTypeIndex,
unsigned int  uiResIndex
const
 

Returns the name of a certain resource.

Gets the name of a specific resource by index.

Parameters:
uiResTypeIndex Identifies the resource type of the resource.
uiResIndex Identifies the resource.
Returns:
Name of the specified resource.

std::string getResourceNameT restypeid,
resid
const [private]
 

Returns the name of a resource.

Returns the name of a resource, resource type and ID are specified by the parameters. Note: Calling this function with resid == the name of the resource makes no sense at all.

Parameters:
restypeid Identifier of the resource type (either ID or name).
resid Identifier of the resource (either ID or name).
Returns:
The name of the specified resource.

dword getResourceTypeIdByIndex unsigned int  uiIndex  )  const
 

Returns the ID of a resource type.

Returns the ID of a resource type which was specified through an index. The valid range of the parameter uiIndex is 0...getNumberOfResourceTypes() - 1. Leaving the invalid range leads to undefined behaviour.

Parameters:
uiIndex Index which identifies a resource type.
Returns:
The ID of the specified resource type.

std::string getResourceTypeNameByIndex unsigned int  uiIndex  )  const
 

Returns the name of a resource type.

Returns the name of a resource type which was specified through an index. The valid range of the parameter uiIndex is 0...getNumberOfResourceTypes() - 1. Leaving the invalid range leads to undefined behaviour.

Parameters:
uiIndex Index which identifies a resource type.
Returns:
The name of the specified resource type.

ResourceNode * getRoot  ) 
 

Returns the root node of the resource directory.

Returns:
Root node of the resource directory.

std::vector< ResourceChild >::iterator locateResourceT restypeid,
resid
[private]
 

Retrieves an iterator to a specified resource child.

Looks through the entire resource tree and returns an iterator to the resource specified by the parameters.

Parameters:
restypeid Identifier of the resource type (either ID or name).
resid Identifier of the resource (either ID or name).
Returns:
An iterator to the specified resource.

std::vector< ResourceChild >::const_iterator locateResourceT restypeid,
resid
const [private]
 

Retrieves an iterator to a specified resource child.

Looks through the entire resource tree and returns a const_iterator to the resource specified by the parameters.

Parameters:
restypeid Identifier of the resource type (either ID or name).
resid Identifier of the resource (either ID or name).
Returns:
A const_iterator to the specified resource.

void makeValid  ) 
 

Corrects a erroneous resource directory.

Correctly sorts the resource nodes of the resource tree. This function should be called before calling rebuild.

Here is the call graph for this function:

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

Reads the resource directory from a file.

Reads the resource directory from a file.

Parameters:
strFilename Name of the file.
uiOffset File offset of the resource directory.
uiSize Raw size of the resource directory.
uiResDirRva RVA of the beginning of the resource directory.

Here is the call graph for this function:

void rebuild std::vector< byte > &  vBuffer,
unsigned int  uiRva
const
 

Rebuilds the resource directory.

Rebuilds the resource directory.

Parameters:
vBuffer Buffer the source directory will be written to.
uiRva RVA of the resource directory.

Here is the call graph for this function:

int removeResource const std::string &  strResTypeName,
const std::string &  strResName
 

Removes a resource.

Removes a resource from the resource tree. The first parameter identifies the resource type of the new resource, the second parameter identifies the resource itself.

Parameters:
strResTypeName Name of the resource type.
strResName Name of the resource.

Here is the call graph for this function:

int removeResource const std::string &  strResTypeName,
dword  dwResId
 

Removes a resource.

Removes a resource from the resource tree. The first parameter identifies the resource type of the new resource, the second parameter identifies the resource itself.

Parameters:
strResTypeName Name of the resource type.
dwResId ID of the resource.

Here is the call graph for this function:

int removeResource dword  dwResTypeIndex,
const std::string &  strResName
 

Removes a resource.

Removes a resource from the resource tree. The first parameter identifies the resource type of the new resource, the second parameter identifies the resource itself.

Parameters:
dwResTypeIndex ID of the resource type.
strResName Name of the resource.

Here is the call graph for this function:

int removeResource dword  dwResTypeIndex,
dword  dwResId
 

Removes a resource.

Removes a resource from the resource tree. The first parameter identifies the resource type of the new resource, the second parameter identifies the resource itself.

Parameters:
dwResTypeIndex ID of the resource type.
dwResId ID of the resource.

Here is the call graph for this function:

int removeResourceT restypeid,
resid
[private]
 

Removes new resource.

Removes a resource, resource type and ID are specified by the parameters.

Parameters:
restypeid Identifier of the resource type (either ID or name).
resid Identifier of the resource (either ID or name).

int removeResourceType const std::string &  strResTypeName  ) 
 

Removes a resource type and all of it's resources.

Removes the resource type identified by the name strResTypeName.

Parameters:
strResTypeName Name which identifies the resource type.

int removeResourceType dword  dwResTypeId  ) 
 

Removes a resource type and all of it's resources.

Removes the resource type identified by the ID dwResTypeId.

Parameters:
dwResTypeId ID which identifies the resource type.

int removeResourceTypeByIndex unsigned int  uiIndex  ) 
 

Removes a resource type and all of it's resources.

Removes the resource type identified by the index uiIndex.

Parameters:
uiIndex Index which identifies the resource type.

int resourceTypeIdToIndex dword  dwResTypeId  )  const
 

Converts a resource type ID to an index.

Converts the ID of a resource type to an index.

Parameters:
dwResTypeId ID of the resource type.
Returns:
Index of that resource type.

int resourceTypeNameToIndex const std::string &  strResTypeName  )  const
 

Converts a resource type name to an index.

Converts the name of a resource type to an index.

Parameters:
strResTypeName ID of the resource type.
Returns:
Index of that resource type.

void setResourceData const std::string &  strResTypeName,
const std::string &  strResName,
std::vector< byte > &  data
 

Sets the data of a certain resource.

Sets the resource data of a specific resource.

Parameters:
strResTypeName Identifies the resource type of the resource.
strResName Identifies the resource.
data The new resource data.

Here is the call graph for this function:

void setResourceData const std::string &  strResTypeName,
dword  dwResId,
std::vector< byte > &  data
 

Sets the data of a certain resource.

Sets the resource data of a specific resource.

Parameters:
strResTypeName Identifies the resource type of the resource.
dwResId Identifies the resource.
data The new resource data.

Here is the call graph for this function:

void setResourceData dword  dwResTypeId,
const std::string &  strResName,
std::vector< byte > &  data
 

Sets the data of a certain resource.

Sets the resource data of a specific resource.

Parameters:
dwResTypeId Identifies the resource type of the resource.
strResName Identifies the resource.
data The new resource data.

Here is the call graph for this function:

void setResourceData dword  dwResTypeId,
dword  dwResId,
std::vector< byte > &  data
 

Sets the data of a certain resource.

Sets the resource data of a specific resource.

Parameters:
dwResTypeId Identifies the resource type of the resource.
dwResId Identifies the resource.
data The new resource data.

Here is the call graph for this function:

void setResourceDataByIndex unsigned int  uiResTypeIndex,
unsigned int  uiResIndex,
std::vector< byte > &  data
 

Sets the data of a certain resource.

Sets the resource data of a specific resource by index. The valid range of the parameter uiResTypeIndex is 0...getNumberOfResourceTypes() - 1. The valid range of the parameter uiResIndex is 0...getNumberOfResources() - 1. Leaving the invalid range leads to undefined behaviour.

Parameters:
uiResTypeIndex Identifies the resource type of the resource.
uiResIndex Identifies the resource.
data The new resource data.

int setResourceDataT restypeid,
resid,
std::vector< byte > &  data
[private]
 

Sets the data of a resource.

Sets the data of a resource, resource type and ID are specified by the parameters.

Parameters:
restypeid Identifier of the resource type (either ID or name).
resid Identifier of the resource (either ID or name).
data The new data of the resource is taken from this vector.

void setResourceId const std::string &  strResTypeName,
const std::string &  strResName,
dword  dwNewResId
 

Sets the ID of a certain resource.

Sets the ID of a specific resource.

Parameters:
strResTypeName Identifies the resource type of the resource.
strResName Identifies the resource.
dwNewResId New ID of the resource.

Here is the call graph for this function:

void setResourceId const std::string &  strResTypeName,
dword  dwResId,
dword  dwNewResId
 

Sets the ID of a certain resource.

Sets the ID of a specific resource.

Parameters:
strResTypeName Identifies the resource type of the resource.
dwResId Identifies the resource.
dwNewResId New ID of the resource.

Here is the call graph for this function:

void setResourceId dword  dwResTypeId,
const std::string &  strResName,
dword  dwNewResId
 

Sets the ID of a certain resource.

Sets the ID of a specific resource.

Parameters:
dwResTypeId Identifies the resource type of the resource.
strResName Identifies the resource.
dwNewResId New ID of the resource.

Here is the call graph for this function:

void setResourceId dword  dwResTypeId,
dword  dwResId,
dword  dwNewResId
 

Sets the ID of a certain resource.

Sets the ID of a specific resource.

Parameters:
dwResTypeId Identifies the resource type of the resource.
dwResId Identifies the resource.
dwNewResId New ID of the resource.

Here is the call graph for this function:

void setResourceIdByIndex unsigned int  uiResTypeIndex,
unsigned int  uiResIndex,
dword  dwNewResId
 

Sets the ID of a certain resource.

Sets the ID of a specific resource by index.

Parameters:
uiResTypeIndex Identifies the resource type of the resource.
uiResIndex Identifies the resource.
dwNewResId New ID of the specified resource.

int setResourceIdT restypeid,
resid,
dword  dwNewResId
[private]
 

Sets the ID of a resource.

Sets the id of a resource, resource type and ID are specified by the parameters.

Parameters:
restypeid Identifier of the resource type (either ID or name).
resid Identifier of the resource (either ID or name).
dwNewResId New ID of the resource.

void setResourceName const std::string &  strResTypeName,
const std::string &  strResName,
const std::string &  strNewResName
 

Sets the name of a certain resource.

Sets the name of a specific resource.

Parameters:
strResTypeName Identifies the resource type of the resource.
strResName Identifies the resource.
strNewResName New name of the specified resource.

Here is the call graph for this function:

void setResourceName const std::string &  strResTypeName,
dword  dwResId,
const std::string &  strNewResName
 

Sets the name of a certain resource.

Sets the name of a specific resource.

Parameters:
strResTypeName Identifies the resource type of the resource.
dwResId Identifies the resource.
strNewResName New name of the specified resource.

Here is the call graph for this function:

void setResourceName dword  dwResTypeId,
const std::string &  strResName,
const std::string &  strNewResName
 

Sets the name of a certain resource.

Sets the name of a specific resource.

Parameters:
dwResTypeId Identifies the resource type of the resource.
strResName Identifies the resource.
strNewResName New name of the specified resource.

Here is the call graph for this function:

void setResourceName dword  dwResTypeId,
dword  dwResId,
const std::string &  strNewResName
 

Sets the name of a certain resource.

Sets the name of a specific resource.

Parameters:
dwResTypeId Identifies the resource type of the resource.
dwResId Identifies the resource.
strNewResName New name of the specified resource.

Here is the call graph for this function:

void setResourceNameByIndex unsigned int  uiResTypeIndex,
unsigned int  uiResIndex,
const std::string &  strNewResName
 

Sets the name of a certain resource.

Sets the name of a specific resource by index.

Parameters:
uiResTypeIndex Identifies the resource type of the resource.
uiResIndex Identifies the resource.
strNewResName New name of the specified resource.

int setResourceNameT restypeid,
resid,
std::string  strNewResName
[private]
 

Sets the name of a resource.

Sets the name of a resource, resource type and ID are specified by the parameters.

Parameters:
restypeid Identifier of the resource type (either ID or name).
resid Identifier of the resource (either ID or name).
strNewResName The new name of the resource.

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

Writes the resource directory to a file.

Writes the current resource directory back into a file.

Parameters:
strFilename Name of the output file.
uiOffset File offset where the resource directory will be written to.
uiRva RVA of the file offset.

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:21 2005 for PeLib by doxygen 1.3.7