summaryrefslogtreecommitdiff
path: root/function.cpp
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2015-07-22 16:49:15 -0700
committerRusty Wagner <rusty@vector35.com>2015-07-22 16:49:15 -0700
commit8901295fceabdd598e6f63e81ba79d6c5e503f4a (patch)
treee96263e456b71e57ea137eb27caa103af59c9563 /function.cpp
parent290661e66c9983e696bd434f271b033263a0f5c3 (diff)
Add support for commenting in disassembly graph
Diffstat (limited to 'function.cpp')
-rw-r--r--function.cpp26
1 files changed, 26 insertions, 0 deletions
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<uint64_t> Function::GetCommentedAddresses() const
+{
+ size_t count;
+ uint64_t* addrs = BNGetCommentedAddresses(m_func, &count);
+ vector<uint64_t> 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<LowLevelILFunction> Function::GetLowLevelIL() const
{
return new LowLevelILFunction(BNGetFunctionLowLevelIL(m_func));