BearParser
Portable Executable parsing library (from PE-bear)
Loading...
Searching...
No Matches
parser
include
bearparser
ByteBuffer.h
Go to the documentation of this file.
1
#pragma once
2
#include "
AbstractByteBuffer.h
"
3
4
#define DEFAULT_PADDING 2
5
6
class
ByteBuffer
:
public
AbstractByteBuffer
7
{
8
public
:
9
ByteBuffer
(
bufsize_t
v_size,
bufsize_t
padding
=
DEFAULT_PADDING
);
10
ByteBuffer
(BYTE *v_content,
bufsize_t
v_size,
bufsize_t
padding
=
DEFAULT_PADDING
);
11
ByteBuffer
(
AbstractByteBuffer
*sourceBuf,
offset_t
offset,
bufsize_t
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
21
protected
:
22
BYTE*
allocContent
(
bufsize_t
v_size,
bufsize_t
padding
);
23
24
BYTE *
content
;
25
bufsize_t
contentSize
;
26
bufsize_t
padding
;
27
28
bufsize_t
originalSize
;
29
};
30
AbstractByteBuffer.h
bufsize_t
uint32_t bufsize_t
Definition
AbstractByteBuffer.h:14
offset_t
uint64_t offset_t
Definition
AbstractByteBuffer.h:17
DEFAULT_PADDING
#define DEFAULT_PADDING
Definition
ByteBuffer.h:4
AbstractByteBuffer
Definition
AbstractByteBuffer.h:32
ByteBuffer
Definition
ByteBuffer.h:7
ByteBuffer::getContent
virtual BYTE * getContent()
Definition
ByteBuffer.h:16
ByteBuffer::getContentSize
virtual bufsize_t getContentSize()
Definition
ByteBuffer.h:15
ByteBuffer::isResized
virtual bool isResized()
Definition
ByteBuffer.h:19
ByteBuffer::originalSize
bufsize_t originalSize
Definition
ByteBuffer.h:28
ByteBuffer::content
BYTE * content
Definition
ByteBuffer.h:24
ByteBuffer::~ByteBuffer
virtual ~ByteBuffer()
Definition
ByteBuffer.cpp:83
ByteBuffer::contentSize
bufsize_t contentSize
Definition
ByteBuffer.h:25
ByteBuffer::ByteBuffer
ByteBuffer(bufsize_t v_size, bufsize_t padding=DEFAULT_PADDING)
Definition
ByteBuffer.cpp:3
ByteBuffer::allocContent
BYTE * allocContent(bufsize_t v_size, bufsize_t padding)
Definition
ByteBuffer.cpp:45
ByteBuffer::padding
bufsize_t padding
Definition
ByteBuffer.h:26
ByteBuffer::resize
virtual bool resize(bufsize_t newSize)
Definition
ByteBuffer.cpp:57
Generated by
1.12.0