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

#include <SectHdrsWrapper.h>

Collaboration diagram for SectHdrsWrapper:
Collaboration graph
[legend]

Public Member Functions

 SectHdrsWrapper (PEFile *pe)
 
bool wrap ()
 
virtual void reloadMapping ()
 
virtual void * getPtr ()
 
virtual bufsize_t getSize ()
 
virtual QString getName ()
 
virtual size_t getFieldsCount ()
 
virtual void * getFieldPtr (size_t fieldId, size_t subField)
 
virtual bufsize_t getFieldSize (size_t fieldId, size_t subField)
 
virtual QString getFieldName (size_t fieldId)
 
SectionHdrWrappergetSecHdrAtOffset (offset_t offset, Executable::addr_type addrType, bool roundup, bool verbose=false)
 
void printSectionsMapping (Executable::addr_type aType)
 
size_t getSecIndex (SectionHdrWrapper *sec) const
 
SectionHdrWrappergetSecHdr (size_t index) const
 
bool canAddEntry ()
 
ExeNodeWrapperaddEntry (ExeNodeWrapper *entry)
 
- 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 ()
 
virtual bool isValid ()
 
- 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 ()
 
virtual offset_t getOffset ()
 
virtual offset_t getOffset (void *ptr, bool allowExceptions=false)
 
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 ()
 
virtual bool isResized ()
 
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)
 
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 Attributes

static size_t SECT_COUNT_MAX = 0x2000
 
static size_t SECT_INVALID_INDEX = SIZE_MAX
 

Protected Member Functions

void clear ()
 
void addMapping (SectionHdrWrapper *sec)
 
virtual bool loadNextEntry (size_t entryNum)
 
bool isMyEntryType (ExeNodeWrapper *entry)
 
- 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

std::map< offset_t, SectionHdrWrapper * > vSec
 
std::map< offset_t, SectionHdrWrapper * > rSec
 
- 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
 

Additional Inherited Members

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

Detailed Description

Definition at line 115 of file SectHdrsWrapper.h.

Constructor & Destructor Documentation

◆ SectHdrsWrapper()

SectHdrsWrapper::SectHdrsWrapper ( PEFile pe)
inline

Definition at line 122 of file SectHdrsWrapper.h.

Here is the call graph for this function:

Member Function Documentation

◆ addEntry()

ExeNodeWrapper * SectHdrsWrapper::addEntry ( ExeNodeWrapper entry)
virtual

Reimplemented from ExeNodeWrapper.

Definition at line 388 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ addMapping()

void SectHdrsWrapper::addMapping ( SectionHdrWrapper sec)
protected

Definition at line 426 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ canAddEntry()

bool SectHdrsWrapper::canAddEntry ( )
virtual

Reimplemented from ExeNodeWrapper.

Definition at line 377 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ clear()

void SectHdrsWrapper::clear ( )
protectedvirtual

Reimplemented from ExeNodeWrapper.

Definition at line 404 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ getFieldName()

QString SectHdrsWrapper::getFieldName ( size_t  fieldId)
virtual

Implements ExeNodeWrapper.

Definition at line 519 of file SectHdrsWrapper.cpp.

◆ getFieldPtr()

virtual void * SectHdrsWrapper::getFieldPtr ( size_t  fieldId,
size_t  subField 
)
inlinevirtual

Implements ExeElementWrapper.

Definition at line 133 of file SectHdrsWrapper.h.

Here is the call graph for this function:

◆ getFieldsCount()

size_t SectHdrsWrapper::getFieldsCount ( )
virtual

Implements ExeElementWrapper.

Definition at line 486 of file SectHdrsWrapper.cpp.

◆ getFieldSize()

virtual bufsize_t SectHdrsWrapper::getFieldSize ( size_t  fieldId,
size_t  subField 
)
inlinevirtual

Reimplemented from ExeElementWrapper.

Definition at line 134 of file SectHdrsWrapper.h.

Here is the call graph for this function:

◆ getName()

virtual QString SectHdrsWrapper::getName ( )
inlinevirtual

Implements ExeElementWrapper.

Definition at line 129 of file SectHdrsWrapper.h.

◆ getPtr()

void * SectHdrsWrapper::getPtr ( )
virtual

Implements ExeElementWrapper.

Definition at line 491 of file SectHdrsWrapper.cpp.

◆ getSecHdr()

SectionHdrWrapper * SectHdrsWrapper::getSecHdr ( size_t  index) const
inline

Definition at line 153 of file SectHdrsWrapper.h.

◆ getSecHdrAtOffset()

SectionHdrWrapper * SectHdrsWrapper::getSecHdrAtOffset ( offset_t  offset,
Executable::addr_type  addrType,
bool  roundup,
bool  verbose = false 
)

Definition at line 525 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ getSecIndex()

size_t SectHdrsWrapper::getSecIndex ( SectionHdrWrapper sec) const
inline

Definition at line 141 of file SectHdrsWrapper.h.

◆ getSize()

bufsize_t SectHdrsWrapper::getSize ( )
virtual

Implements ExeElementWrapper.

Definition at line 497 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ isMyEntryType()

bool SectHdrsWrapper::isMyEntryType ( ExeNodeWrapper entry)
protectedvirtual

Reimplemented from ExeNodeWrapper.

Definition at line 368 of file SectHdrsWrapper.cpp.

◆ loadNextEntry()

bool SectHdrsWrapper::loadNextEntry ( size_t  entryNum)
protectedvirtual

Reimplemented from ExeNodeWrapper.

Definition at line 411 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ printSectionsMapping()

void SectHdrsWrapper::printSectionsMapping ( Executable::addr_type  aType)

Definition at line 564 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ reloadMapping()

void SectHdrsWrapper::reloadMapping ( )
virtual

Reimplemented from ExeNodeWrapper.

Definition at line 460 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

◆ wrap()

bool SectHdrsWrapper::wrap ( )
virtual

Reimplemented from ExeNodeWrapper.

Definition at line 473 of file SectHdrsWrapper.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ rSec

std::map<offset_t, SectionHdrWrapper*> SectHdrsWrapper::rSec
protected

Definition at line 170 of file SectHdrsWrapper.h.

◆ SECT_COUNT_MAX

size_t SectHdrsWrapper::SECT_COUNT_MAX = 0x2000
static

Definition at line 118 of file SectHdrsWrapper.h.

◆ SECT_INVALID_INDEX

size_t SectHdrsWrapper::SECT_INVALID_INDEX = SIZE_MAX
static

Definition at line 119 of file SectHdrsWrapper.h.

◆ vSec

std::map<offset_t, SectionHdrWrapper*> SectHdrsWrapper::vSec
protected

Definition at line 169 of file SectHdrsWrapper.h.


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