From 8901295fceabdd598e6f63e81ba79d6c5e503f4a Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Wed, 22 Jul 2015 16:49:15 -0700 Subject: Add support for commenting in disassembly graph --- function.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'function.cpp') diff --git a/function.cpp b/function.cpp index 6e0a221d..45b29752 100644 --- a/function.cpp +++ b/function.cpp @@ -53,6 +53,32 @@ void Function::MarkRecentUse() } +string Function::GetCommentForAddress(uint64_t addr) const +{ + char* comment = BNGetCommentForAddress(m_func, addr); + string result = comment; + BNFreeString(comment); + return result; +} + + +vector Function::GetCommentedAddresses() const +{ + size_t count; + uint64_t* addrs = BNGetCommentedAddresses(m_func, &count); + vector result; + result.insert(result.end(), addrs, &addrs[count]); + BNFreeAddressList(addrs); + return result; +} + + +void Function::SetCommentForAddress(uint64_t addr, const string& comment) +{ + BNSetCommentForAddress(m_func, addr, comment.c_str()); +} + + Ref Function::GetLowLevelIL() const { return new LowLevelILFunction(BNGetFunctionLowLevelIL(m_func)); -- cgit v1.3.1