Classes | |
class | BinaryNinja::DataBuffer |
class BinaryNinja::DataBuffer |
Public Member Functions | |
DataBuffer () | |
DataBuffer (size_t len) | |
DataBuffer (const void *data, size_t len) | |
DataBuffer (const DataBuffer &buf) | |
DataBuffer (DataBuffer &&buf) | |
DataBuffer (BNDataBuffer *buf) | |
~DataBuffer () | |
DataBuffer & | operator= (const DataBuffer &buf) |
DataBuffer & | operator= (DataBuffer &&buf) |
BNDataBuffer * | GetBufferObject () const |
void * | GetData () |
Get the raw pointer to the data contained within this buffer. | |
const void * | GetData () const |
Get the raw pointer to the data contained within this buffer, as a const pointer. | |
void * | GetDataAt (size_t offset) |
Get the raw pointer to the data contained within this buffer, starting at a given offset. | |
const void * | GetDataAt (size_t offset) const |
Get the const raw pointer to the data contained within this buffer, starting at a given offset. | |
size_t | GetLength () const |
Get the length of the data contained within this buffer. | |
void | SetSize (size_t len) |
Set the size of the data pointed to by this buffer. | |
void | Clear () |
Clear the data contained by this buffer. | |
void | Append (const void *data, size_t len) |
Append len contents of the pointer data to the end of the buffer. | |
void | Append (const DataBuffer &buf) |
Append the contents of databuffer buf to the current DataBuffer. | |
void | AppendByte (uint8_t val) |
Append a single byte. | |
DataBuffer | GetSlice (size_t start, size_t len) |
Get the contents of a given slice of data, as a DataBuffer. | |
uint8_t & | operator[] (size_t offset) |
const uint8_t & | operator[] (size_t offset) const |
bool | operator== (const DataBuffer &other) const |
bool | operator!= (const DataBuffer &other) const |
std::string | ToEscapedString (bool nullTerminates=false, bool escapePrintable=false) const |
Convert the contents of the DataBuffer to a string. | |
std::string | ToBase64 () const |
Convert the contents of this DataBuffer to a base64 representation. | |
bool | ZlibCompress (DataBuffer &output) const |
Compress this databuffer via ZLIB compression. | |
bool | ZlibDecompress (DataBuffer &output) const |
Decompress the contents of this buffer via ZLIB compression. | |
bool | LzmaDecompress (DataBuffer &output) const |
Decompress the contents of this buffer via LZMA compression. | |
bool | Lzma2Decompress (DataBuffer &output) const |
Decompress the contents of this buffer via LZMA2 compression. | |
bool | XzDecompress (DataBuffer &output) const |
Decompress the contents of this buffer via XZ compression. | |
Static Public Member Functions | |
static DataBuffer | FromEscapedString (const std::string &src) |
Create a DataBuffer from a given escaped string. | |
static DataBuffer | FromBase64 (const std::string &src) |
Create a DataBuffer from a given base64 string. | |
DataBuffer::DataBuffer | ( | ) |
DataBuffer::DataBuffer | ( | size_t | len | ) |
DataBuffer::DataBuffer | ( | const void * | data, |
size_t | len ) |
DataBuffer::DataBuffer | ( | const DataBuffer & | buf | ) |
DataBuffer::DataBuffer | ( | DataBuffer && | buf | ) |
DataBuffer::DataBuffer | ( | BNDataBuffer * | buf | ) |
DataBuffer::~DataBuffer | ( | ) |
DataBuffer & DataBuffer::operator= | ( | const DataBuffer & | buf | ) |
DataBuffer & DataBuffer::operator= | ( | DataBuffer && | buf | ) |
|
inline |
void * DataBuffer::GetData | ( | ) |
Get the raw pointer to the data contained within this buffer.
const void * DataBuffer::GetData | ( | ) | const |
Get the raw pointer to the data contained within this buffer, as a const pointer.
void * DataBuffer::GetDataAt | ( | size_t | offset | ) |
Get the raw pointer to the data contained within this buffer, starting at a given offset.
const void * DataBuffer::GetDataAt | ( | size_t | offset | ) | const |
Get the const raw pointer to the data contained within this buffer, starting at a given offset.
size_t DataBuffer::GetLength | ( | ) | const |
Get the length of the data contained within this buffer.
void DataBuffer::SetSize | ( | size_t | len | ) |
Set the size of the data pointed to by this buffer.
void DataBuffer::Clear | ( | ) |
Clear the data contained by this buffer.
free()
on this buffer's data pointer. You shouldn't call it yourself, typically ever.void DataBuffer::Append | ( | const void * | data, |
size_t | len ) |
Append len
contents of the pointer data
to the end of the buffer.
realloc()
on this buffer's data pointer. You should hold this DataBuffer and use it for accesses, instead of storing the raw pointer.void DataBuffer::Append | ( | const DataBuffer & | buf | ) |
Append the contents of databuffer buf
to the current DataBuffer.
realloc()
on this buffer's data pointer. You should hold this DataBuffer and use it for accesses, instead of storing the raw pointer.void DataBuffer::AppendByte | ( | uint8_t | val | ) |
Append a single byte.
realloc()
on this buffer's data pointer. You should hold this DataBuffer and use it for accesses, instead of storing the raw pointer.DataBuffer DataBuffer::GetSlice | ( | size_t | start, |
size_t | len ) |
Get the contents of a given slice of data, as a DataBuffer.
uint8_t & DataBuffer::operator[] | ( | size_t | offset | ) |
const uint8_t & DataBuffer::operator[] | ( | size_t | offset | ) | const |
bool DataBuffer::operator== | ( | const DataBuffer & | other | ) | const |
bool DataBuffer::operator!= | ( | const DataBuffer & | other | ) | const |
string DataBuffer::ToEscapedString | ( | bool | nullTerminates = false, |
bool | escapePrintable = false ) const |
Convert the contents of the DataBuffer to a string.
nullTerminates | Whether the decoder should stop and return the string after encountering a null (\x00) byte. |
|
static |
Create a DataBuffer from a given escaped string.
src | Input string |
string DataBuffer::ToBase64 | ( | ) | const |
Convert the contents of this DataBuffer to a base64 representation.
|
static |
Create a DataBuffer from a given base64 string.
src | Input base64 string |
bool DataBuffer::ZlibCompress | ( | DataBuffer & | output | ) | const |
Compress this databuffer via ZLIB compression.
[out] | output | Output DataBuffer the compressed contents will be stored in. |
bool DataBuffer::ZlibDecompress | ( | DataBuffer & | output | ) | const |
Decompress the contents of this buffer via ZLIB compression.
[out] | output | Output DataBuffer the decompressed contents will be stored in. |
bool DataBuffer::LzmaDecompress | ( | DataBuffer & | output | ) | const |
Decompress the contents of this buffer via LZMA compression.
[out] | output | Output DataBuffer the decompressed contents will be stored in. |
bool DataBuffer::Lzma2Decompress | ( | DataBuffer & | output | ) | const |
Decompress the contents of this buffer via LZMA2 compression.
[out] | output | Output DataBuffer the decompressed contents will be stored in. |
bool DataBuffer::XzDecompress | ( | DataBuffer & | output | ) | const |
Decompress the contents of this buffer via XZ compression.
[out] | output | Output DataBuffer the decompressed contents will be stored in. |