BearParser
Portable Executable parsing library (from PE-bear)
|
#include <OptHdrWrapper.h>
Public Types | |
enum | OptHdrFID { NONE = FIELD_NONE , MAGIC = 0 , LINKER_MAJOR , LINKER_MINOR , CODE_SIZE , INITDATA_SIZE , UNINITDATA_SIZE , EP , CODE_BASE , DATA_BASE , IMAGE_BASE , SEC_ALIGN , FILE_ALIGN , OSVER_MAJOR , OSVER_MINOR , IMGVER_MAJOR , IMGVER_MINOR , SUBSYSVER_MAJOR , SUBSYSVER_MINOR , WIN32_VER , IMAGE_SIZE , HDRS_SIZE , CHECKSUM , SUBSYS , DLL_CHARACT , STACK_RSRV_SIZE , STACK_COMMIT_SIZE , HEAP_RSRV_SIZE , HEAP_COMMIT_SIZE , LDR_FLAGS , RVAS_SIZES_NUM , DATA_DIR , FIELD_COUNTER } |
Public Member Functions | |
OptHdrWrapper (PEFile *pe) | |
bool | wrap () |
virtual void * | getPtr () |
virtual bufsize_t | getSize () |
virtual QString | getName () |
virtual size_t | getFieldsCount () |
virtual void * | getFieldPtr (size_t fieldId, size_t subField=FIELD_NONE) |
virtual bufsize_t | getFieldSize (size_t fieldId, size_t subField=FIELD_NONE) |
virtual QString | translateFieldContent (size_t fieldId) |
virtual QString | getFieldName (size_t fieldId) |
virtual Executable::addr_type | containsAddrType (size_t fieldId, size_t subField=FIELD_NONE) |
Executable::exe_bits | getHdrBitMode () |
IMAGE_NT_HEADERS32 * | nt32 () |
IMAGE_NT_HEADERS64 * | nt64 () |
Public Member Functions inherited from PEElementWrapper | |
PEElementWrapper (PEFile *pe) | |
virtual | ~PEElementWrapper () |
PEFile * | getPE () |
Public Member Functions inherited from ExeElementWrapper | |
ExeElementWrapper (Executable *exe) | |
virtual | ~ExeElementWrapper () |
virtual bufsize_t | getContentSize () |
virtual BYTE * | getContent () |
virtual size_t | getSubFieldsCount () |
virtual offset_t | getOffset () |
virtual offset_t | getOffset (void *ptr, bool allowExceptions=false) |
void * | getFieldPtr (size_t fieldId) |
virtual offset_t | getFieldOffset (size_t fieldId, size_t subField=FIELD_NONE) |
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) |
Executable * | getExe () |
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 void | initDllCharact () |
static std::vector< DWORD > | splitDllCharact (DWORD characteristics) |
static QString | translateDllCharacteristics (DWORD charact) |
static QString | translateOptMagic (DWORD magic) |
static QString | translateOSVersion (WORD major, WORD minor) |
static QString | translateSubsystem (DWORD subsystem) |
Static Public Member Functions inherited from AbstractByteBuffer | |
static bool | isValid (AbstractByteBuffer *buf) |
Static Public Attributes | |
static std::map< DWORD, QString > | s_optMagic |
static std::map< std::pair< WORD, WORD >, QString > | s_osVersion |
static std::map< DWORD, QString > | s_dllCharact |
static std::map< DWORD, QString > | s_subsystem |
Protected Attributes | |
IMAGE_OPTIONAL_HEADER32 * | opt32 |
IMAGE_OPTIONAL_HEADER64 * | opt64 |
std::vector< DWORD > | dllCharact |
Protected Attributes inherited from PEElementWrapper | |
PEFile * | m_PE |
Protected Attributes inherited from ExeElementWrapper | |
Executable * | m_Exe |
Additional Inherited Members | |
Protected Member Functions inherited from ExeElementWrapper | |
virtual bool | canCopyToOffset (offset_t rawOffset) |
bool | copyToOffset (offset_t rawOffset) |
Definition at line 5 of file OptHdrWrapper.h.
Definition at line 9 of file OptHdrWrapper.h.
|
inline |
|
virtual |
Reimplemented from ExeElementWrapper.
Definition at line 331 of file OptHdrWrapper.cpp.
|
virtual |
Implements ExeElementWrapper.
Definition at line 282 of file OptHdrWrapper.cpp.
|
virtual |
Implements ExeElementWrapper.
Definition at line 184 of file OptHdrWrapper.cpp.
|
inlinevirtual |
Implements ExeElementWrapper.
Definition at line 66 of file OptHdrWrapper.h.
|
virtual |
Reimplemented from ExeElementWrapper.
Definition at line 174 of file OptHdrWrapper.cpp.
Executable::exe_bits OptHdrWrapper::getHdrBitMode | ( | ) |
|
inlinevirtual |
Implements ExeElementWrapper.
Definition at line 65 of file OptHdrWrapper.h.
|
virtual |
Implements ExeElementWrapper.
Definition at line 149 of file OptHdrWrapper.cpp.
|
virtual |
Implements ExeElementWrapper.
Definition at line 164 of file OptHdrWrapper.cpp.
|
static |
Definition at line 11 of file OptHdrWrapper.cpp.
IMAGE_NT_HEADERS32 * OptHdrWrapper::nt32 | ( | ) |
IMAGE_NT_HEADERS64 * OptHdrWrapper::nt64 | ( | ) |
|
static |
|
static |
|
virtual |
Reimplemented from ExeElementWrapper.
Definition at line 264 of file OptHdrWrapper.cpp.
|
static |
Definition at line 50 of file OptHdrWrapper.cpp.
|
static |
Definition at line 61 of file OptHdrWrapper.cpp.
|
static |
Definition at line 84 of file OptHdrWrapper.cpp.
|
virtual |
Reimplemented from ExeElementWrapper.
Definition at line 106 of file OptHdrWrapper.cpp.
|
protected |
Definition at line 85 of file OptHdrWrapper.h.
|
protected |
Definition at line 83 of file OptHdrWrapper.h.
|
protected |
Definition at line 84 of file OptHdrWrapper.h.
|
static |
Definition at line 47 of file OptHdrWrapper.h.
|
static |
Definition at line 45 of file OptHdrWrapper.h.
|
static |
Definition at line 46 of file OptHdrWrapper.h.
|
static |
Definition at line 48 of file OptHdrWrapper.h.