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

#include <FileBuffer.h>

Collaboration diagram for FileBuffer:

Public Member Functions

 FileBuffer (QString &fileName, bufsize_t minSize, bool allowTruncate)
 
virtual ~FileBuffer ()
 
virtual bufsize_t getContentSize ()
 
virtual BYTE * getContent ()
 
offset_t getFileSize ()
 
bool resize (bufsize_t newSize)
 
virtual bool isResized ()
 
virtual bool isTruncated ()
 
- Public Member Functions inherited from AbstractByteBuffer
 AbstractByteBuffer ()
 
virtual ~AbstractByteBuffer ()
 
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)
 
- Public Member Functions inherited from AbstractFileBuffer
QString getFileName ()
 

Protected Attributes

ByteBufferm_Buf
 
- Protected Attributes inherited from AbstractFileBuffer
QString fileName
 
qint64 fileSize
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractByteBuffer
static bool isValid (AbstractByteBuffer *buf)
 
- Static Public Member Functions inherited from AbstractFileBuffer
static ByteBufferread (QString &file, bufsize_t minBufSize, const bool allowTruncate)
 
static bufsize_t getReadableSize (QFile &fIn)
 
static bufsize_t getReadableSize (const QString &path)
 
static bufsize_t dump (const QString &fileName, AbstractByteBuffer &buf, bool allowExceptions=false)
 
- Protected Member Functions inherited from AbstractFileBuffer
 AbstractFileBuffer (QString v_fileName)
 
- Static Protected Member Functions inherited from AbstractFileBuffer
static ByteBufferread (QFile &fIn, bufsize_t minBufSize, const bool allowTruncate)
 

Detailed Description

Definition at line 55 of file FileBuffer.h.

Constructor & Destructor Documentation

◆ FileBuffer()

FileBuffer::FileBuffer ( QString & fileName,
bufsize_t minSize,
bool allowTruncate )
inline

Definition at line 58 of file FileBuffer.h.

Here is the call graph for this function:

◆ ~FileBuffer()

virtual FileBuffer::~FileBuffer ( )
inlinevirtual

Definition at line 70 of file FileBuffer.h.

Member Function Documentation

◆ getContent()

virtual BYTE * FileBuffer::getContent ( )
inlinevirtual

Implements AbstractByteBuffer.

Definition at line 73 of file FileBuffer.h.

Here is the call graph for this function:

◆ getContentSize()

virtual bufsize_t FileBuffer::getContentSize ( )
inlinevirtual

Implements AbstractByteBuffer.

Definition at line 72 of file FileBuffer.h.

Here is the call graph for this function:

◆ getFileSize()

offset_t FileBuffer::getFileSize ( )
inline

Definition at line 74 of file FileBuffer.h.

◆ isResized()

virtual bool FileBuffer::isResized ( )
inlinevirtual

Reimplemented from AbstractByteBuffer.

Definition at line 77 of file FileBuffer.h.

Here is the call graph for this function:

◆ isTruncated()

virtual bool FileBuffer::isTruncated ( )
inlinevirtual

Reimplemented from AbstractByteBuffer.

Definition at line 79 of file FileBuffer.h.

Here is the call graph for this function:

◆ resize()

bool FileBuffer::resize ( bufsize_t newSize)
inlinevirtual

Reimplemented from AbstractByteBuffer.

Definition at line 75 of file FileBuffer.h.

Here is the call graph for this function:

Member Data Documentation

◆ m_Buf

ByteBuffer* FileBuffer::m_Buf
protected

Definition at line 86 of file FileBuffer.h.


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