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

ResourceLeaf Class Reference

ResourceLeafs represent the leafs of the resource tree: The actual resources. More...

#include <ResourceDirectory.h>

Inheritance diagram for ResourceLeaf:

Inheritance graph
[legend]
Collaboration diagram for ResourceLeaf:

Collaboration graph
[legend]
List of all members.

Public Member Functions

dword getCodePage () const
 Returns the CodePage value of this resource leaf.

std::vector< byte > getData () const
 Returns the resource data of this resource leaf.

dword getOffsetToData () const
 Returns the OffsetToData value of this resource leaf.

dword getReserved () const
 Returns the Reserved value of this resource leaf.

dword getSize () const
 Returns the Size value of this resource leaf.

bool isLeaf () const
 Indicates if the resource element is a leaf or a node.

void makeValid ()
 Corrects erroneous valeus in the ResourceLeaf.

void setCodePage (dword dwValue)
 Sets the CodePage value of this resource leaf.

void setData (const std::vector< byte > &vData)
 Sets the resource data of this resource leaf.

void setOffsetToData (dword dwValue)
 Sets the OffsetToData value of this resource leaf.

void setReserved (dword dwValue)
 Sets the Reserved value of this resource leaf.

void setSize (dword dwValue)
 Sets the Size value of this resource leaf.


Protected Member Functions

int read (InputBuffer &inpBuffer, unsigned int uiOffset, unsigned int rva)
void rebuild (OutputBuffer &, unsigned int &uiOffset, unsigned int uiRva, const std::string &) const
 Writes the next resource leaf into the OutputBuffer.


Private Attributes

PELIB_IMAGE_RESOURCE_DATA_ENTRY entry
 PeLib equivalent of the Win32 structure IMAGE_RESOURCE_DATA_ENTRY.

std::vector< byte > m_data
 The resource data.


Detailed Description

ResourceLeafs represent the leafs of the resource tree: The actual resources.


Member Function Documentation

dword getCodePage  )  const
 

Returns the CodePage value of this resource leaf.

Returns the leaf's CodePage value.

Returns:
The leaf's CodePage value.

std::vector< byte > getData  )  const
 

Returns the resource data of this resource leaf.

Reads the next resource leaf from the InputBuffer. Returns the size of a resource lead.

dword getOffsetToData  )  const
 

Returns the OffsetToData value of this resource leaf.

Returns the leaf's OffsetToData value. That's the RVA where the raw data of the resource can be found.

Returns:
The leaf's OffsetToData value.

dword getReserved  )  const
 

Returns the Reserved value of this resource leaf.

Returns the leaf's Reserved value.

Returns:
The leaf's Reserved value.

dword getSize  )  const
 

Returns the Size value of this resource leaf.

Returns the leaf's Size value. That's the size of the raw data of the resource.

Returns:
The leaf's Size value.

bool isLeaf  )  const [virtual]
 

Indicates if the resource element is a leaf or a node.

Checks if a ResourceElement is a leaf or not.

Returns:
Always returns true.

Implements ResourceElement.

int read InputBuffer &  inpBuffer,
unsigned int  uiOffset,
unsigned int  uiRva
[protected, virtual]
 

Reads the next resource leaf from the InputBuffer.

Parameters:
inpBuffer An InputBuffer that holds the complete resource directory.
uiOffset Offset of the resource leaf that's to be read.
uiRva RVA of the beginning of the resource directory.
pad Used for debugging purposes.

Implements ResourceElement.

void rebuild OutputBuffer &  obBuffer,
unsigned int &  uiOffset,
unsigned int  uiRva,
const std::string & 
const [protected, virtual]
 

Writes the next resource leaf into the OutputBuffer.

Rebuilds the current resource leaf.

Parameters:
obBuffer OutputBuffer where the rebuilt resource leaf is stored.
uiOffset Offset of the resource leaf inside the resource directory.
uiRva RVA of the resource directory.

Implements ResourceElement.

void setCodePage dword  dwValue  ) 
 

Sets the CodePage value of this resource leaf.

Sets the leaf's CodePage value.

Parameters:
dwValue The leaf's new CodePage value.

void setData const std::vector< byte > &  vData  ) 
 

Sets the resource data of this resource leaf.

Overwrites the raw data of a resource.

Parameters:
vData New data of the resource.

void setOffsetToData dword  dwValue  ) 
 

Sets the OffsetToData value of this resource leaf.

Sets the leaf's OffsetToData value.

Parameters:
dwValue The leaf's new OffsetToData value.

void setReserved dword  dwValue  ) 
 

Sets the Reserved value of this resource leaf.

Sets the leaf's Reserved value.

Parameters:
dwValue The leaf's new Reserved value.

void setSize dword  dwValue  ) 
 

Sets the Size value of this resource leaf.

Sets the leaf's Size value.

Parameters:
dwValue The leaf's new Size value.


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