diff options
| author | rollsafe <rollsafe@users.noreply.github.com> | 2019-06-11 15:29:57 -0400 |
|---|---|---|
| committer | rollsafe <rollsafe@users.noreply.github.com> | 2019-06-13 17:29:56 -0400 |
| commit | 1f885d1482d0d4e91f84c6d171672bf0d545923e (patch) | |
| tree | 9f4ff618f8f7a67a207cef5d8d3b18d32701dadd /binaryview.cpp | |
| parent | 5502500f2a605af47523847db67b4c506d8f16e4 (diff) | |
Add comments map to binaryview
Diffstat (limited to 'binaryview.cpp')
| -rw-r--r-- | binaryview.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/binaryview.cpp b/binaryview.cpp index 5811b953..f95bf2fd 100644 --- a/binaryview.cpp +++ b/binaryview.cpp @@ -2333,6 +2333,32 @@ vector<string> BinaryView::GetUniqueSectionNames(const vector<string>& names) } +string BinaryView::GetCommentForAddress(uint64_t addr) const +{ + char* comment = BNGetGlobalCommentForAddress(m_object, addr); + string result = comment; + BNFreeString(comment); + return result; +} + + +vector<uint64_t> BinaryView::GetCommentedAddresses() const +{ + size_t count; + uint64_t* addrs = BNGetGlobalCommentedAddresses(m_object, &count); + vector<uint64_t> 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<BNAddressRange> BinaryView::GetAllocatedRanges() { size_t count; |
