BearParser
Portable Executable parsing library (from PE-bear)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
SectionHdrWrapper Class Reference

#include <SectHdrsWrapper.h>

Collaboration diagram for SectionHdrWrapper:
Collaboration graph
[legend]

Public Types

enum  SecFieldId {
  NAME = 0 , VSIZE , VPTR , RSIZE ,
  RPTR , RELOC_PTR , LINENUM_PTR , RELOC_NUM ,
  LINENUM_NUM , CHARACT , FIELD_COUNTER
}
 

Public Member Functions

 SectionHdrWrapper (PEFile *pe, size_t sectionNumber)
 
 ~SectionHdrWrapper ()
 
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=FIELD_NONE)
 
virtual WrappedValue::data_type containsDataType (size_t fieldId, size_t subField=FIELD_NONE)
 
offset_t getContentOffset (Executable::addr_type aType, bool useMapped=true)
 
offset_t getContentEndOffset (Executable::addr_type aType, bool roundup)
 
bufsize_t getContentSize (Executable::addr_type aType, bool roundup)
 
DWORD getCharacteristics ()
 
bool setCharacteristics (DWORD newCharacteristics)
 
- 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 bool wrap ()
 
virtual void reloadMapping ()
 
virtual ExeNodeWrappergetEntryAt (size_t fieldId)
 
virtual size_t getEntriesCount ()
 
virtual size_t getEntriesNum ()
 
virtual size_t getSubFieldsCount ()
 
virtual ExeNodeWrappergetParentNode ()
 
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 QString getFieldName (size_t fieldId)=0
 
virtual bool canAddEntry ()
 
virtual ExeNodeWrapperaddEntry (ExeNodeWrapper *entry)
 
ExeNodeWrappergetLastEntry ()
 
virtual offset_t getNextEntryOffset ()
 
virtual bufsize_t geEntrySize ()
 
- Public Member Functions inherited from ExeElementWrapper
 ExeElementWrapper (Executable *exe)
 
virtual ~ExeElementWrapper ()
 
virtual bool wrap ()
 
virtual bufsize_t getContentSize ()
 
virtual BYTE * getContent ()
 
virtual void * getPtr ()=0
 
virtual bufsize_t getSize ()=0
 
virtual QString getName ()=0
 
virtual size_t getFieldsCount ()=0
 
virtual size_t getSubFieldsCount ()
 
offset_t getOffset ()
 
offset_t getOffset (void *ptr)
 
virtual void * getFieldPtr (size_t fieldId, size_t subField)=0
 
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 QString getFieldName (size_t fieldId)=0
 
virtual WrappedValue getWrappedValue (size_t fieldId, size_t subField)
 
virtual WrappedValue getWrappedValue (size_t fieldId)
 
virtual Executable::addr_type containsAddrType (size_t fieldId, size_t subField=FIELD_NONE)
 
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 bufsize_t getContentSize ()=0
 
virtual BYTE * getContent ()=0
 
virtual bool isTruncated ()
 
BYTE operator[] (size_t idx)
 
virtual offset_t getOffset (void *ptr, bool allowExceptions=false)
 
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)
 
QString getWStringValue (offset_t rawOffset, bufsize_t len)
 
QString getWAsciiStringValue (offset_t rawOffset, bufsize_t len)
 
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)
 
virtual bool resize (bufsize_t newSize)
 

Protected Member Functions

 SectionHdrWrapper (PEFile *pe, IMAGE_SECTION_HEADER *v_header)
 
offset_t getContentDeclaredOffset (Executable::addr_type aType)
 
bufsize_t getContentDeclaredSize (Executable::addr_type aType)
 
bufsize_t getMappedRawSize ()
 
bufsize_t getMappedVirtualSize ()
 
bool reloadName ()
 
- Protected Member Functions inherited from ExeNodeWrapper
size_t getEntriesCount (std::vector< ExeNodeWrapper * > &_entries)
 
ExeNodeWrappergetEntryAt (std::vector< ExeNodeWrapper * > &_entries, size_t fieldId)
 
virtual void clear ()
 
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)
 

Protected Attributes

char * name
 
size_t sectNum
 
- 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
 

Friends

class PEFile
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractByteBuffer
static bool isValid (AbstractByteBuffer *buf)
 

Detailed Description

Definition at line 6 of file SectHdrsWrapper.h.

Member Enumeration Documentation

◆ SecFieldId

Enumerator
NAME 
VSIZE 
VPTR 
RSIZE 
RPTR 
RELOC_PTR 
LINENUM_PTR 
RELOC_NUM 
LINENUM_NUM 
CHARACT 
FIELD_COUNTER 

Definition at line 11 of file SectHdrsWrapper.h.

Constructor & Destructor Documentation

◆ SectionHdrWrapper() [1/2]

SectionHdrWrapper::SectionHdrWrapper ( PEFile pe,
size_t  sectionNumber 
)
inline

Definition at line 29 of file SectHdrsWrapper.h.

Here is the call graph for this function:

◆ ~SectionHdrWrapper()

SectionHdrWrapper::~SectionHdrWrapper ( )
inline

Definition at line 32 of file SectHdrsWrapper.h.

◆ SectionHdrWrapper() [2/2]

SectionHdrWrapper::SectionHdrWrapper ( PEFile pe,
IMAGE_SECTION_HEADER *  v_header 
)
inlineprotected

Definition at line 72 of file SectHdrsWrapper.h.

Here is the call graph for this function:

Member Function Documentation

◆ containsAddrType()

Executable::addr_type SectionHdrWrapper::containsAddrType ( size_t  fieldId,
size_t  subField = FIELD_NONE 
)
virtual

Reimplemented from ExeElementWrapper.

Definition at line 116 of file SectHdrsWrapper.cpp.

◆ containsDataType()

WrappedValue::data_type SectionHdrWrapper::containsDataType ( size_t  fieldId,
size_t  subField = FIELD_NONE 
)
virtual

Reimplemented from ExeElementWrapper.

Definition at line 127 of file SectHdrsWrapper.cpp.

◆ getCharacteristics()

DWORD SectionHdrWrapper::getCharacteristics ( )
inline

Definition at line 55 of file SectHdrsWrapper.h.

◆ getContentDeclaredOffset()

offset_t SectionHdrWrapper::getContentDeclaredOffset ( Executable::addr_type  aType)
protected

Definition at line 137 of file SectHdrsWrapper.cpp.

◆ getContentDeclaredSize()

bufsize_t SectionHdrWrapper::getContentDeclaredSize ( Executable::addr_type  aType)
protected

Definition at line 177 of file SectHdrsWrapper.cpp.

◆ getContentEndOffset()

offset_t SectionHdrWrapper::getContentEndOffset ( Executable::addr_type  aType,
bool  roundup 
)

Definition at line 166 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ getContentOffset()

offset_t SectionHdrWrapper::getContentOffset ( Executable::addr_type  aType,
bool  useMapped = true 
)

Definition at line 150 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ getContentSize()

bufsize_t SectionHdrWrapper::getContentSize ( Executable::addr_type  aType,
bool  roundup 
)

Definition at line 251 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ getFieldName()

QString SectionHdrWrapper::getFieldName ( size_t  fieldId)
virtual

Implements ExeNodeWrapper.

Definition at line 98 of file SectHdrsWrapper.cpp.

◆ getFieldPtr()

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

Implements ExeElementWrapper.

Definition at line 75 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ getFieldsCount()

virtual size_t SectionHdrWrapper::getFieldsCount ( )
inlinevirtual

Implements ExeElementWrapper.

Definition at line 40 of file SectHdrsWrapper.h.

◆ getMappedRawSize()

bufsize_t SectionHdrWrapper::getMappedRawSize ( )
protected

Definition at line 191 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ getMappedVirtualSize()

bufsize_t SectionHdrWrapper::getMappedVirtualSize ( )
protected

Definition at line 230 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ getName()

QString SectionHdrWrapper::getName ( )
virtual

Implements ExeElementWrapper.

Definition at line 68 of file SectHdrsWrapper.cpp.

◆ getPtr()

void * SectionHdrWrapper::getPtr ( )
virtual

Implements ExeElementWrapper.

Definition at line 21 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ getSize()

bufsize_t SectionHdrWrapper::getSize ( )
virtual

Implements ExeElementWrapper.

Definition at line 62 of file SectHdrsWrapper.cpp.

◆ getSubFieldsCount()

virtual size_t SectionHdrWrapper::getSubFieldsCount ( )
inlinevirtual

Reimplemented from ExeNodeWrapper.

Definition at line 41 of file SectHdrsWrapper.h.

◆ reloadName()

bool SectionHdrWrapper::reloadName ( )
protected

Definition at line 39 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ setCharacteristics()

bool SectionHdrWrapper::setCharacteristics ( DWORD  newCharacteristics)
inline

Definition at line 62 of file SectHdrsWrapper.h.

◆ wrap()

bool SectionHdrWrapper::wrap ( )
virtual

Reimplemented from ExeNodeWrapper.

Definition at line 11 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ PEFile

friend class PEFile
friend

Definition at line 92 of file SectHdrsWrapper.h.

Member Data Documentation

◆ name

char* SectionHdrWrapper::name
protected

Definition at line 86 of file SectHdrsWrapper.h.

◆ sectNum

size_t SectionHdrWrapper::sectNum
protected

Definition at line 87 of file SectHdrsWrapper.h.


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