summaryrefslogtreecommitdiff
path: root/binaryview.cpp
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2016-09-16 19:09:01 -0400
committerRusty Wagner <rusty@vector35.com>2016-09-16 19:09:01 -0400
commit2ec606fab8754dad2135deec2e72e87d39382978 (patch)
tree4c923368406312f0366e27ac10f9a02f5e001c22 /binaryview.cpp
parent124cf1bc4f465a915621b7ac81af94b9a69a937a (diff)
Add APIs for user interaction from plugins
Diffstat (limited to 'binaryview.cpp')
-rw-r--r--binaryview.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/binaryview.cpp b/binaryview.cpp
index 0a7f23ce..863d57b2 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -1480,6 +1480,39 @@ void BinaryView::Reanalyze()
}
+void BinaryView::ShowPlainTextReport(const string& title, const string& contents)
+{
+ BNShowPlainTextReport(m_object, title.c_str(), contents.c_str());
+}
+
+
+void BinaryView::ShowMarkdownReport(const string& title, const string& contents, const string& plainText)
+{
+ BNShowMarkdownReport(m_object, title.c_str(), contents.c_str(), plainText.c_str());
+}
+
+
+void BinaryView::ShowHTMLReport(const string& title, const string& contents, const string& plainText)
+{
+ BNShowHTMLReport(m_object, title.c_str(), contents.c_str(), plainText.c_str());
+}
+
+
+bool BinaryView::GetAddressInput(uint64_t& result, const string& prompt, const string& title)
+{
+ uint64_t currentAddress = 0;
+ if (m_file)
+ currentAddress = m_file->GetCurrentOffset();
+ return BNGetAddressInput(&result, prompt.c_str(), title.c_str(), m_object, currentAddress);
+}
+
+
+bool BinaryView::GetAddressInput(uint64_t& result, const string& prompt, const string& title, uint64_t currentAddress)
+{
+ return BNGetAddressInput(&result, prompt.c_str(), title.c_str(), m_object, currentAddress);
+}
+
+
BinaryData::BinaryData(FileMetadata* file): BinaryView(BNCreateBinaryDataView(file->GetObject()))
{
}