From 1f885d1482d0d4e91f84c6d171672bf0d545923e Mon Sep 17 00:00:00 2001 From: rollsafe Date: Tue, 11 Jun 2019 15:29:57 -0400 Subject: Add comments map to binaryview --- binaryview.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'binaryview.cpp') diff --git a/binaryview.cpp b/binaryview.cpp index 5811b953..f95bf2fd 100644 --- a/binaryview.cpp +++ b/binaryview.cpp @@ -2333,6 +2333,32 @@ vector BinaryView::GetUniqueSectionNames(const vector& names) } +string BinaryView::GetCommentForAddress(uint64_t addr) const +{ + char* comment = BNGetGlobalCommentForAddress(m_object, addr); + string result = comment; + BNFreeString(comment); + return result; +} + + +vector BinaryView::GetCommentedAddresses() const +{ + size_t count; + uint64_t* addrs = BNGetGlobalCommentedAddresses(m_object, &count); + vector result; + result.insert(result.end(), addrs, &addrs[count]); + BNFreeAddressList(addrs); + return result; +} + + +void BinaryView::SetCommentForAddress(uint64_t addr, const string& comment) +{ + BNSetGlobalCommentForAddress(m_object, addr, comment.c_str()); +} + + vector BinaryView::GetAllocatedRanges() { size_t count; -- cgit v1.3.1