retdec
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
PeLib::ResourceElement Class Referenceabstract

#include <ResourceDirectory.h>

Inheritance diagram for PeLib::ResourceElement:
Inheritance graph
[legend]

Public Member Functions

unsigned int getElementRva () const
 Returns the RVA of the element in the file. More...
 
virtual bool isLeaf () const =0
 Indicates if the resource element is a leaf or a node. More...
 
virtual void makeValid ()=0
 Corrects erroneous values in the ResourceElement. More...
 
 ResourceElement ()
 Returns the size of a resource element. More...
 
virtual ~ResourceElement ()
 Necessary virtual destructor. More...
 

Protected Member Functions

virtual int read (ImageLoader &imageLoader, std::uint32_t, std::uint32_t, std::uint32_t, ResourceDirectory *resDir)=0
 Reads the next resource element from the InputBuffer. More...
 
virtual void rebuild (OutputBuffer &, unsigned int, unsigned int, const std::string &) const =0
 Writes the next resource element into the OutputBuffer. More...
 
virtual void recalculate (unsigned int &uiCurrentOffset, unsigned int uiNewRva)=0
 Recalculates the tree for different RVA. More...
 

Protected Attributes

unsigned int uiElementRva
 Stores RVA of the resource element in the file. More...
 

Friends

class ResourceChild
 
class ResourceNode
 
class ResourceLeaf
 

Detailed Description

Base class for ResourceNode and ResourceLeaf, the elements of the resource tree.

Todo:
write

Constructor & Destructor Documentation

◆ ResourceElement()

PeLib::ResourceElement::ResourceElement ( )

Returns the size of a resource element.

Constructor

◆ ~ResourceElement()

virtual PeLib::ResourceElement::~ResourceElement ( )
inlinevirtual

Necessary virtual destructor.

Member Function Documentation

◆ getElementRva()

unsigned int PeLib::ResourceElement::getElementRva ( ) const

Returns the RVA of the element in the file.

Returns the RVA of a ResourceElement. This is the RVA where the ResourceElement can be found in the file.

Returns
RVA of the ResourceElement.

◆ isLeaf()

virtual bool PeLib::ResourceElement::isLeaf ( ) const
pure virtual

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

Implemented in PeLib::ResourceNode, and PeLib::ResourceLeaf.

◆ makeValid()

virtual void PeLib::ResourceElement::makeValid ( )
pure virtual

Corrects erroneous values in the ResourceElement.

Implemented in PeLib::ResourceNode, and PeLib::ResourceLeaf.

◆ read()

virtual int PeLib::ResourceElement::read ( ImageLoader imageLoader,
std::uint32_t  ,
std::uint32_t  ,
std::uint32_t  ,
ResourceDirectory resDir 
)
protectedpure virtual

Reads the next resource element from the InputBuffer.

Implemented in PeLib::ResourceNode, and PeLib::ResourceLeaf.

◆ rebuild()

virtual void PeLib::ResourceElement::rebuild ( OutputBuffer ,
unsigned int  ,
unsigned int  ,
const std::string &   
) const
protectedpure virtual

Writes the next resource element into the OutputBuffer.

Implemented in PeLib::ResourceNode, and PeLib::ResourceLeaf.

◆ recalculate()

virtual void PeLib::ResourceElement::recalculate ( unsigned int &  uiCurrentOffset,
unsigned int  uiNewRva 
)
protectedpure virtual

Recalculates the tree for different RVA.

Implemented in PeLib::ResourceNode, and PeLib::ResourceLeaf.

Friends And Related Function Documentation

◆ ResourceChild

friend class ResourceChild
friend

◆ ResourceLeaf

friend class ResourceLeaf
friend

◆ ResourceNode

friend class ResourceNode
friend

Member Data Documentation

◆ uiElementRva

unsigned int PeLib::ResourceElement::uiElementRva
protected

Stores RVA of the resource element in the file.


The documentation for this class was generated from the following files: