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

#include <ByteBuffer.h>

Collaboration diagram for ByteBuffer:

Public Member Functions

 ByteBuffer (bufsize_t v_size, bufsize_t padding=DEFAULT_PADDING)
 
 ByteBuffer (BYTE *v_content, bufsize_t v_size, bufsize_t padding=DEFAULT_PADDING)
 
 ByteBuffer (AbstractByteBuffer *sourceBuf, offset_t offset, bufsize_t size, bufsize_t padding=DEFAULT_PADDING)
 
virtual ~ByteBuffer ()
 
virtual bufsize_t getContentSize ()
 
virtual BYTE * getContent ()
 
virtual bool resize (bufsize_t newSize)
 
virtual bool isResized ()
 
- Public Member Functions inherited from AbstractByteBuffer
 AbstractByteBuffer ()
 
virtual ~AbstractByteBuffer ()
 
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, 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)
 
offset_t substFragmentByFile (offset_t offset, bufsize_t contentSize, QFile &fIn)
 

Protected Member Functions

BYTE * allocContent (bufsize_t v_size, bufsize_t padding)
 

Protected Attributes

BYTE * content
 
bufsize_t contentSize
 
bufsize_t padding
 
bufsize_t originalSize
 

Additional Inherited Members

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

Detailed Description

Definition at line 6 of file ByteBuffer.h.

Constructor & Destructor Documentation

◆ ByteBuffer() [1/3]

ByteBuffer::ByteBuffer ( bufsize_t v_size,
bufsize_t padding = DEFAULT_PADDING )

Definition at line 3 of file ByteBuffer.cpp.

Here is the call graph for this function:

◆ ByteBuffer() [2/3]

ByteBuffer::ByteBuffer ( BYTE * v_content,
bufsize_t v_size,
bufsize_t padding = DEFAULT_PADDING )

Definition at line 13 of file ByteBuffer.cpp.

Here is the call graph for this function:

◆ ByteBuffer() [3/3]

ByteBuffer::ByteBuffer ( AbstractByteBuffer * sourceBuf,
offset_t offset,
bufsize_t size,
bufsize_t padding = DEFAULT_PADDING )

Definition at line 24 of file ByteBuffer.cpp.

Here is the call graph for this function:

◆ ~ByteBuffer()

ByteBuffer::~ByteBuffer ( )
virtual

Definition at line 83 of file ByteBuffer.cpp.

Member Function Documentation

◆ allocContent()

BYTE * ByteBuffer::allocContent ( bufsize_t v_size,
bufsize_t padding )
protected

Definition at line 45 of file ByteBuffer.cpp.

◆ getContent()

virtual BYTE * ByteBuffer::getContent ( )
inlinevirtual

Implements AbstractByteBuffer.

Definition at line 16 of file ByteBuffer.h.

◆ getContentSize()

virtual bufsize_t ByteBuffer::getContentSize ( )
inlinevirtual

Implements AbstractByteBuffer.

Definition at line 15 of file ByteBuffer.h.

◆ isResized()

virtual bool ByteBuffer::isResized ( )
inlinevirtual

Reimplemented from AbstractByteBuffer.

Definition at line 19 of file ByteBuffer.h.

◆ resize()

bool ByteBuffer::resize ( bufsize_t newSize)
virtual

Reimplemented from AbstractByteBuffer.

Definition at line 57 of file ByteBuffer.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ content

BYTE* ByteBuffer::content
protected

Definition at line 24 of file ByteBuffer.h.

◆ contentSize

bufsize_t ByteBuffer::contentSize
protected

Definition at line 25 of file ByteBuffer.h.

◆ originalSize

bufsize_t ByteBuffer::originalSize
protected

Definition at line 28 of file ByteBuffer.h.

◆ padding

bufsize_t ByteBuffer::padding
protected

Definition at line 26 of file ByteBuffer.h.


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