BearParser
Portable Executable parsing library (from PE-bear)
Loading...
Searching...
No Matches
ResourceEntryWrapper Class Reference

#include <ResourceDirWrapper.h>

Collaboration diagram for ResourceEntryWrapper:

Public Types

enum  FieldID { NONE = FIELD_NONE , NAME_ID_ADDR , OFFSET_TO_DATA , FIELD_COUNTER }
 

Public Member Functions

 ResourceEntryWrapper (PEFile *pe, ResourceDirWrapper *parentDir, size_t entryNumber, long topEntryId, ResourcesAlbum *resAlbum)
 
virtual ~ResourceEntryWrapper ()
 
bool wrap ()
 
virtual void * getPtr ()
 
virtual bufsize_t getSize ()
 
virtual QString getName ()
 
virtual size_t getFieldsCount ()
 
virtual size_t getSubFieldsCount ()
 
virtual void * getFieldPtr (size_t fieldId, size_t subField=FIELD_NONE)
 
virtual QString getFieldName (size_t fieldId)
 
virtual Executable::addr_type containsAddrType (size_t fieldId, size_t subField)
 
bool isByName ()
 
bool isDir ()
 
WORD getID ()
 
offset_t getChildOffsetToDirectory ()
 
offset_t getNameOffset ()
 
IMAGE_RESOURCE_DIRECTORY_STRING * getNameStr ()
 
offset_t getChildAddress ()
 
IMAGE_RESOURCE_DIRECTORY_ENTRY * getEntryPtr ()
 
ResourcesAlbumgetAlbumPtr ()
 
long getTopEntryID ()
 
- Public Member Functions inherited from PENodeWrapper
 PENodeWrapper (PEFile *pe, PENodeWrapper *parent=NULL)
 
 PENodeWrapper (PEFile *pe, PENodeWrapper *parent, size_t entryNumber)
 
virtual ~PENodeWrapper ()
 
PEFilegetPE ()
 
virtual PENodeWrappergetParentNode ()
 
- Public Member Functions inherited from ExeNodeWrapper
 ExeNodeWrapper (Executable *pe, ExeNodeWrapper *parent=NULL)
 
 ExeNodeWrapper (Executable *pe, ExeNodeWrapper *parent, size_t entryNumber)
 
virtual ~ExeNodeWrapper ()
 
virtual void reloadMapping ()
 
virtual ExeNodeWrappergetEntryAt (size_t fieldId)
 
virtual size_t getEntriesCount ()
 
virtual size_t getEntriesNum ()
 
size_t getEntryId ()
 
virtual void * getSubfieldPtr (size_t fieldId, size_t subField)
 
virtual bufsize_t getSubfieldSize (size_t fieldId, size_t subField)
 
virtual QString getSubfieldName (size_t fieldId, size_t subField)
 
virtual bool canAddEntry ()
 
virtual ExeNodeWrapperaddEntry (ExeNodeWrapper *entry)
 
ExeNodeWrappergetLastEntry ()
 
virtual offset_t getNextEntryOffset ()
 
virtual bufsize_t geEntrySize ()
 
virtual bool isValid ()
 
- Public Member Functions inherited from ExeElementWrapper
 ExeElementWrapper (Executable *exe)
 
virtual ~ExeElementWrapper ()
 
virtual bufsize_t getContentSize ()
 
virtual BYTE * getContent ()
 
virtual offset_t getOffset ()
 
virtual offset_t getOffset (void *ptr, bool allowExceptions=false)
 
void * getFieldPtr (size_t fieldId)
 
virtual bufsize_t getFieldSize (size_t fieldId, size_t subField=FIELD_NONE)
 
virtual offset_t getFieldOffset (size_t fieldId, size_t subField=FIELD_NONE)
 
virtual QString translateFieldContent (size_t fieldId)
 
virtual bool hasSubfieldWrapper (size_t parentType)
 
virtual WrappedValue getWrappedValue (size_t fieldId, size_t subField)
 
virtual WrappedValue getWrappedValue (size_t fieldId)
 
virtual WrappedValue::data_type containsDataType (size_t fieldId, size_t subField=FIELD_NONE)
 
virtual uint64_t getNumValue (size_t fieldId, size_t subField, bool *isOk)
 
uint64_t getNumValue (size_t fieldId, bool *isOk)
 
virtual bool setNumValue (size_t fieldId, size_t subField, uint64_t val)
 
bool setNumValue (size_t fieldId, uint64_t val)
 
ExecutablegetExe ()
 
bool isBit64 ()
 
bool isBit32 ()
 
- Public Member Functions inherited from AbstractByteBuffer
 AbstractByteBuffer ()
 
virtual ~AbstractByteBuffer ()
 
virtual bool isTruncated ()
 
virtual bool isResized ()
 
BYTE operator[] (size_t idx)
 
virtual BYTE * getContentAt (offset_t offset, bufsize_t size, bool allowExceptions=false)
 
virtual BYTE * getContentAtPtr (BYTE *ptr, bufsize_t size, bool allowExceptions=false)
 
virtual bool setBufferedValue (BYTE *dstPtr, BYTE *srcPtr, bufsize_t srcSize, bufsize_t paddingSize, bool allowExceptions=false)
 
bool setStringValue (offset_t rawOffset, QString newText)
 
QString getStringValue (offset_t rawOffset, bufsize_t len=BUFSIZE_MAX, bool acceptNonTerminated=false)
 
QString getWStringValue (offset_t rawOffset, bufsize_t len)
 
QString getWAsciiStringValue (offset_t rawOffset, bufsize_t len, bool acceptNonTerminated=false)
 
bufsize_t getMaxSizeFromOffset (offset_t startOffset)
 
bufsize_t getMaxSizeFromPtr (BYTE *ptr)
 
bool isAreaEmpty (offset_t rawOffset, bufsize_t size)
 
bool fillContent (BYTE filling)
 
bool pasteBuffer (offset_t rawOffset, AbstractByteBuffer *buf, bool allowTrunc)
 
bool containsBlock (offset_t rawOffset, bufsize_t size)
 
bool intersectsBlock (offset_t rawOffset, bufsize_t size)
 
uint64_t getNumValue (offset_t offset, bufsize_t size, bool *isOk)
 
bool setNumValue (offset_t offset, bufsize_t size, uint64_t newVal)
 
bool setTextValue (char *textPtr, std::string newText, size_t fieldLimitLen=0)
 
virtual bool resize (bufsize_t newSize)
 
offset_t substFragmentByFile (offset_t offset, bufsize_t contentSize, QFile &fIn)
 

Static Public Member Functions

static QString translateType (WORD id)
 
- Static Public Member Functions inherited from AbstractByteBuffer
static bool isValid (AbstractByteBuffer *buf)
 

Protected Member Functions

virtual void clear ()
 
- Protected Member Functions inherited from ExeNodeWrapper
size_t getEntriesCount (std::vector< ExeNodeWrapper * > &_entries)
 
ExeNodeWrappergetEntryAt (std::vector< ExeNodeWrapper * > &_entries, size_t fieldId)
 
virtual void addMapping (ExeNodeWrapper *entry)
 
virtual bool loadNextEntry (size_t entryNum)
 
virtual ExeNodeWrapperaddEntryAt (ExeNodeWrapper *entry, offset_t nextOffset)
 
virtual bool isMyEntryType (ExeNodeWrapper *entry)
 
- Protected Member Functions inherited from ExeElementWrapper
virtual bool canCopyToOffset (offset_t rawOffset)
 
bool copyToOffset (offset_t rawOffset)
 

Additional Inherited Members

- Protected Attributes inherited from PENodeWrapper
PEFilem_PE
 
PENodeWrapperpeParentNode
 
- Protected Attributes inherited from ExeNodeWrapper
ExeNodeWrapperparentNode
 
size_t entryNum
 
std::vector< ExeNodeWrapper * > entries
 
- Protected Attributes inherited from ExeElementWrapper
Executablem_Exe
 

Detailed Description

Definition at line 66 of file ResourceDirWrapper.h.

Member Enumeration Documentation

◆ FieldID

Enumerator
NONE 
NAME_ID_ADDR 
OFFSET_TO_DATA 
FIELD_COUNTER 

Definition at line 70 of file ResourceDirWrapper.h.

Constructor & Destructor Documentation

◆ ResourceEntryWrapper()

ResourceEntryWrapper::ResourceEntryWrapper ( PEFile * pe,
ResourceDirWrapper * parentDir,
size_t entryNumber,
long topEntryId,
ResourcesAlbum * resAlbum )
inline

Definition at line 79 of file ResourceDirWrapper.h.

Here is the call graph for this function:

◆ ~ResourceEntryWrapper()

virtual ResourceEntryWrapper::~ResourceEntryWrapper ( )
inlinevirtual

Definition at line 86 of file ResourceDirWrapper.h.

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void ResourceEntryWrapper::clear ( )
protectedvirtual

Reimplemented from ExeNodeWrapper.

Definition at line 167 of file ResourceDirWrapper.cpp.

◆ containsAddrType()

virtual Executable::addr_type ResourceEntryWrapper::containsAddrType ( size_t fieldId,
size_t subField )
inlinevirtual

Reimplemented from ExeElementWrapper.

Definition at line 100 of file ResourceDirWrapper.h.

◆ getAlbumPtr()

ResourcesAlbum * ResourceEntryWrapper::getAlbumPtr ( )
inline

Definition at line 113 of file ResourceDirWrapper.h.

◆ getChildAddress()

offset_t ResourceEntryWrapper::getChildAddress ( )

Definition at line 326 of file ResourceDirWrapper.cpp.

Here is the call graph for this function:

◆ getChildOffsetToDirectory()

offset_t ResourceEntryWrapper::getChildOffsetToDirectory ( )

Definition at line 314 of file ResourceDirWrapper.cpp.

Here is the call graph for this function:

◆ getEntryPtr()

IMAGE_RESOURCE_DIRECTORY_ENTRY * ResourceEntryWrapper::getEntryPtr ( )

Definition at line 197 of file ResourceDirWrapper.cpp.

Here is the call graph for this function:

◆ getFieldName()

QString ResourceEntryWrapper::getFieldName ( size_t fieldId)
virtual

Implements ExeNodeWrapper.

Definition at line 226 of file ResourceDirWrapper.cpp.

Here is the call graph for this function:

◆ getFieldPtr()

void * ResourceEntryWrapper::getFieldPtr ( size_t fieldId,
size_t subField = FIELD_NONE )
virtual

Implements ExeElementWrapper.

Definition at line 212 of file ResourceDirWrapper.cpp.

Here is the call graph for this function:

◆ getFieldsCount()

virtual size_t ResourceEntryWrapper::getFieldsCount ( )
inlinevirtual

Implements ExeElementWrapper.

Definition at line 94 of file ResourceDirWrapper.h.

◆ getID()

WORD ResourceEntryWrapper::getID ( )

Definition at line 305 of file ResourceDirWrapper.cpp.

Here is the call graph for this function:

◆ getName()

virtual QString ResourceEntryWrapper::getName ( )
inlinevirtual

Implements ExeElementWrapper.

Definition at line 93 of file ResourceDirWrapper.h.

Here is the call graph for this function:

◆ getNameOffset()

offset_t ResourceEntryWrapper::getNameOffset ( )

Definition at line 253 of file ResourceDirWrapper.cpp.

Here is the call graph for this function:

◆ getNameStr()

IMAGE_RESOURCE_DIRECTORY_STRING * ResourceEntryWrapper::getNameStr ( )

Definition at line 266 of file ResourceDirWrapper.cpp.

Here is the call graph for this function:

◆ getPtr()

virtual void * ResourceEntryWrapper::getPtr ( )
inlinevirtual

Implements ExeElementWrapper.

Definition at line 90 of file ResourceDirWrapper.h.

Here is the call graph for this function:

◆ getSize()

virtual bufsize_t ResourceEntryWrapper::getSize ( )
inlinevirtual

Implements ExeElementWrapper.

Definition at line 91 of file ResourceDirWrapper.h.

◆ getSubFieldsCount()

virtual size_t ResourceEntryWrapper::getSubFieldsCount ( )
inlinevirtual

Reimplemented from ExeNodeWrapper.

Definition at line 95 of file ResourceDirWrapper.h.

◆ getTopEntryID()

long ResourceEntryWrapper::getTopEntryID ( )
inline

Definition at line 114 of file ResourceDirWrapper.h.

◆ isByName()

bool ResourceEntryWrapper::isByName ( )

Definition at line 237 of file ResourceDirWrapper.cpp.

Here is the call graph for this function:

◆ isDir()

bool ResourceEntryWrapper::isDir ( )

Definition at line 245 of file ResourceDirWrapper.cpp.

Here is the call graph for this function:

◆ translateType()

QString ResourceEntryWrapper::translateType ( WORD id)
static

Definition at line 276 of file ResourceDirWrapper.cpp.

◆ wrap()

bool ResourceEntryWrapper::wrap ( )
virtual

Reimplemented from ExeNodeWrapper.

Definition at line 176 of file ResourceDirWrapper.cpp.

Here is the call graph for this function:

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