BearParser
Portable Executable parsing library (from PE-bear)
Loading...
Searching...
No Matches
ByteBuffer.h
Go to the documentation of this file.
1#pragma once
3
4#define DEFAULT_PADDING 2
5
7{
8public:
10 ByteBuffer(BYTE *v_content, bufsize_t v_size, bufsize_t padding = DEFAULT_PADDING);
12
13 virtual ~ByteBuffer();
14
15 virtual bufsize_t getContentSize() { return contentSize; }
16 virtual BYTE* getContent() { return content; }
17 virtual bool resize(bufsize_t newSize);
18
19 virtual bool isResized() { return originalSize != contentSize; }
20
21protected:
23
24 BYTE *content;
27
29};
30
uint32_t bufsize_t
uint64_t offset_t
#define DEFAULT_PADDING
Definition ByteBuffer.h:4
virtual BYTE * getContent()
Definition ByteBuffer.h:16
virtual bufsize_t getContentSize()
Definition ByteBuffer.h:15
virtual bool isResized()
Definition ByteBuffer.h:19
bufsize_t originalSize
Definition ByteBuffer.h:28
BYTE * content
Definition ByteBuffer.h:24
virtual ~ByteBuffer()
bufsize_t contentSize
Definition ByteBuffer.h:25
ByteBuffer(bufsize_t v_size, bufsize_t padding=DEFAULT_PADDING)
Definition ByteBuffer.cpp:3
BYTE * allocContent(bufsize_t v_size, bufsize_t padding)
bufsize_t padding
Definition ByteBuffer.h:26
virtual bool resize(bufsize_t newSize)