diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2025-05-22 18:06:32 -0600 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2025-05-23 19:30:52 -0600 |
| commit | 98d81b780952c2c91fe686c55bb867d193472749 (patch) | |
| tree | ab768c350bc5b717ca10970fc51555c5519749ca /python/function.py | |
| parent | 6248965db87082e5f27a5f222a63d8eddeafe6fc (diff) | |
Add UI action and API to control expression folding
Diffstat (limited to 'python/function.py')
| -rw-r--r-- | python/function.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/python/function.py b/python/function.py index 429b6f69..dc7add3a 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 + BuiltinType, ExprFolding ) from . import associateddatastore # Required in the main scope due to being an argument for _FunctionAssociatedDataStore @@ -3456,6 +3456,16 @@ class Function: assert isinstance(value, dict), "core.BNFunctionGetAutoMetadata did not return a dict" return value + def get_expr_folding(self, addr: Union[int, highlevelil.HighLevelILInstruction]) -> ExprFolding: + if isinstance(addr, highlevelil.HighLevelILInstruction): + addr = addr.address + return ExprFolding(core.BNGetExprFolding(self.handle, addr)) + + def set_expr_folding(self, addr: Union[int, highlevelil.HighLevelILInstruction], value: ExprFolding): + if isinstance(addr, highlevelil.HighLevelILInstruction): + addr = addr.address + core.BNSetExprFolding(self.handle, addr, value) + class AdvancedFunctionAnalysisDataRequestor: def __init__(self, func: Optional['Function'] = None): |
