From 00d5b250d8cd676d33bc83b0dd7a27ddecb987bc Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Sun, 24 May 2015 02:23:32 -0400 Subject: Add UI for cross references, and generate them for code to data refs --- binaryninjaapi.h | 1 + binaryview.cpp | 1 + databuffer.cpp | 6 ++++++ 3 files changed, 8 insertions(+) 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 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); -- cgit v1.3.1