summaryrefslogtreecommitdiff
path: root/python/function.py
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2022-03-02 13:42:32 -0500
committerBrian Potchik <brian@vector35.com>2022-03-02 13:42:32 -0500
commit5bddd6ff72cd1aff613f76b952ef35b31776fd2e (patch)
tree4e8c7ad1c74ad4cff6e565c65db6a16081caf006 /python/function.py
parenta79ea22f3b271c8834f616403f2400b4597a9dc7 (diff)
Add function update request API.
Diffstat (limited to 'python/function.py')
-rw-r--r--python/function.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/python/function.py b/python/function.py
index fbaa2b96..006677b8 100644
--- a/python/function.py
+++ b/python/function.py
@@ -28,7 +28,7 @@ from dataclasses import dataclass
from . import _binaryninjacore as core
from .enums import (
AnalysisSkipReason, FunctionGraphType, SymbolType, InstructionTextTokenType, HighlightStandardColor,
- HighlightColorStyle, DisassemblyOption, IntegerDisplayType, FunctionAnalysisSkipOverride
+ HighlightColorStyle, DisassemblyOption, IntegerDisplayType, FunctionAnalysisSkipOverride, FunctionUpdateType
)
from . import associateddatastore # Required in the main scope due to being an argument for _FunctionAssociatedDataStore
@@ -2525,13 +2525,32 @@ class Function:
display_type = IntegerDisplayType[display_type]
core.BNSetIntegerConstantDisplayType(self.handle, arch.handle, instr_addr, value, operand, display_type)
- def reanalyze(self) -> None:
+ def reanalyze(self, update_type: Optional[FunctionUpdateType] = FunctionUpdateType.UserFunctionUpdate) -> None:
"""
``reanalyze`` causes this functions to be reanalyzed. This function does not wait for the analysis to finish.
+ :param enums.FunctionUpdateType update_type: (optional) Desired update type
:rtype: None
"""
- core.BNReanalyzeFunction(self.handle)
+ core.BNReanalyzeFunction(self.handle, update_type)
+
+ def mark_updates_required(self, update_type: Optional[FunctionUpdateType] = FunctionUpdateType.UserFunctionUpdate) -> None:
+ """
+ ``mark_updates_required`` indicates that this function needs to be reanalyzed during the next update cycle
+ :param enums.FunctionUpdateType update_type: (optional) Desired update type
+
+ :rtype: None
+ """
+ core.BNMarkUpdatesRequired(self.handle, update_type)
+
+ def mark_caller_updates_required(self, update_type: Optional[FunctionUpdateType] = FunctionUpdateType.UserFunctionUpdate) -> None:
+ """
+ ``mark_caller_updates_required`` indicates that callers of this function need to be reanalyzed during the next update cycle
+ :param enums.FunctionUpdateType update_type: (optional) Desired update type
+
+ :rtype: None
+ """
+ core.BNMarkCallerUpdatesRequired(self.handle, update_type)
def request_advanced_analysis_data(self) -> None:
core.BNRequestAdvancedFunctionAnalysisData(self.handle)