summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2018-08-17 22:11:20 -0400
committerRusty Wagner <rusty@vector35.com>2018-08-17 22:11:20 -0400
commit8e320c4be695cd47ae93673320d525ce513cec90 (patch)
treec04f8c9c3a05016fd5bce94496c1a9fe72fd137e
parent1df50c8093bf3b949055d2670836fa1bb742fc1b (diff)
Fix report collection reference count bug and add debug report support
-rw-r--r--binaryninjaapi.h2
-rw-r--r--binaryninjacore.h2
-rw-r--r--function.cpp6
-rw-r--r--interaction.cpp2
-rw-r--r--python/function.py4
5 files changed, 15 insertions, 1 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index 67d2f7f8..32ed38d2 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -2545,6 +2545,8 @@ namespace BinaryNinja
void SetAnalysisSkipOverride(BNFunctionAnalysisSkipOverride skip);
Ref<FlowGraph> GetUnresolvedStackAdjustmentGraph();
+
+ void RequestDebugReport(const std::string& name);
};
class AdvancedFunctionAnalysisDataRequestor
diff --git a/binaryninjacore.h b/binaryninjacore.h
index 7e353ff0..c8fb9f8f 100644
--- a/binaryninjacore.h
+++ b/binaryninjacore.h
@@ -2626,6 +2626,8 @@ extern "C"
BINARYNINJACOREAPI BNFlowGraph* BNGetUnresolvedStackAdjustmentGraph(BNFunction* func);
+ BINARYNINJACOREAPI void BNRequestFunctionDebugReport(BNFunction* func, const char* name);
+
// Disassembly settings
BINARYNINJACOREAPI BNDisassemblySettings* BNCreateDisassemblySettings(void);
BINARYNINJACOREAPI BNDisassemblySettings* BNNewDisassemblySettingsReference(BNDisassemblySettings* settings);
diff --git a/function.cpp b/function.cpp
index 1236cec6..35fe4123 100644
--- a/function.cpp
+++ b/function.cpp
@@ -1412,6 +1412,12 @@ Ref<FlowGraph> Function::GetUnresolvedStackAdjustmentGraph()
}
+void Function::RequestDebugReport(const string& name)
+{
+ BNRequestFunctionDebugReport(m_object, name.c_str());
+}
+
+
AdvancedFunctionAnalysisDataRequestor::AdvancedFunctionAnalysisDataRequestor(Function* func): m_func(func)
{
if (m_func)
diff --git a/interaction.cpp b/interaction.cpp
index b2e62482..5650f629 100644
--- a/interaction.cpp
+++ b/interaction.cpp
@@ -215,7 +215,7 @@ static void ShowGraphReportCallback(void* ctxt, BNBinaryView* view, const char*
static void ShowReportCollectionCallback(void* ctxt, const char* title, BNReportCollection* reports)
{
InteractionHandler* handler = (InteractionHandler*)ctxt;
- handler->ShowReportCollection(title, new ReportCollection(reports));
+ handler->ShowReportCollection(title, new ReportCollection(BNNewReportCollectionReference(reports)));
}
diff --git a/python/function.py b/python/function.py
index 64aea87f..295eec7e 100644
--- a/python/function.py
+++ b/python/function.py
@@ -1591,6 +1591,10 @@ class Function(object):
arch = self.arch
return core.BNIsCallInstruction(self.handle, arch.handle, addr)
+ def request_debug_report(self, name):
+ core.BNRequestFunctionDebugReport(self.handle, name)
+ self.view.update_analysis()
+
class AdvancedFunctionAnalysisDataRequestor(object):
def __init__(self, func = None):