diff options
| author | Rusty Wagner <rusty@vector35.com> | 2018-08-17 22:11:20 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2018-08-17 22:11:20 -0400 |
| commit | 8e320c4be695cd47ae93673320d525ce513cec90 (patch) | |
| tree | c04f8c9c3a05016fd5bce94496c1a9fe72fd137e | |
| parent | 1df50c8093bf3b949055d2670836fa1bb742fc1b (diff) | |
Fix report collection reference count bug and add debug report support
| -rw-r--r-- | binaryninjaapi.h | 2 | ||||
| -rw-r--r-- | binaryninjacore.h | 2 | ||||
| -rw-r--r-- | function.cpp | 6 | ||||
| -rw-r--r-- | interaction.cpp | 2 | ||||
| -rw-r--r-- | python/function.py | 4 |
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): |
