summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--binaryninjaapi.h1
-rw-r--r--binaryview.cpp1
-rw-r--r--databuffer.cpp6
3 files changed, 8 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index edf4cbb7..880924cd 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -181,6 +181,7 @@ namespace BinaryNinja
size_t GetLength() const;
void SetSize(size_t len);
+ void Clear();
void Append(const void* data, size_t len);
void Append(const DataBuffer& buf);
void AppendByte(uint8_t val);
diff --git a/binaryview.cpp b/binaryview.cpp
index d0274f95..cabd7783 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -659,6 +659,7 @@ vector<ReferenceSource> BinaryView::GetCodeReferences(uint64_t addr)
src.func = new Function(BNNewFunctionReference(refs[i].func));
src.arch = new CoreArchitecture(refs[i].arch);
src.addr = refs[i].addr;
+ result.push_back(src);
}
BNFreeCodeReferences(refs, count);
diff --git a/databuffer.cpp b/databuffer.cpp
index fff2a74f..e75bad3e 100644
--- a/databuffer.cpp
+++ b/databuffer.cpp
@@ -84,6 +84,12 @@ void DataBuffer::SetSize(size_t len)
}
+void DataBuffer::Clear()
+{
+ BNClearDataBuffer(m_buffer);
+}
+
+
void DataBuffer::Append(const void* data, size_t len)
{
BNAppendDataBufferContents(m_buffer, data, len);