summaryrefslogtreecommitdiff
path: root/python/function.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/function.py')
-rw-r--r--python/function.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/python/function.py b/python/function.py
index 7d14c2bb..ccecb992 100644
--- a/python/function.py
+++ b/python/function.py
@@ -29,7 +29,7 @@ from . import _binaryninjacore as core
from .enums import (
AnalysisSkipReason, FunctionGraphType, SymbolType, InstructionTextTokenType, HighlightStandardColor,
HighlightColorStyle, DisassemblyOption, IntegerDisplayType, FunctionAnalysisSkipOverride, FunctionUpdateType,
- BuiltinType, ExprFolding, EarlyReturn
+ BuiltinType, ExprFolding, EarlyReturn, SwitchRecovery
)
from . import associateddatastore # Required in the main scope due to being an argument for _FunctionAssociatedDataStore
@@ -3538,6 +3538,16 @@ class Function:
addr = addr.address
core.BNSetEarlyReturn(self.handle, addr, value)
+ def get_switch_recovery(self, addr: Union[int, highlevelil.HighLevelILInstruction]) -> SwitchRecovery:
+ if isinstance(addr, highlevelil.HighLevelILInstruction):
+ addr = addr.address
+ return SwitchRecovery(core.BNGetSwitchRecovery(self.handle, addr))
+
+ def set_switch_recovery(self, addr: Union[int, highlevelil.HighLevelILInstruction], value: SwitchRecovery):
+ if isinstance(addr, highlevelil.HighLevelILInstruction):
+ addr = addr.address
+ core.BNSetSwitchRecovery(self.handle, addr, value)
+
class AdvancedFunctionAnalysisDataRequestor:
def __init__(self, func: Optional['Function'] = None):