diff options
| author | Josh Ferrell <josh@vector35.com> | 2023-01-22 14:12:04 -0500 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2023-01-22 14:12:04 -0500 |
| commit | b0e1de7d3dae3844e4dfff45ad2d6d7dfb6fa651 (patch) | |
| tree | 957e6f12a07c968d588e3fedfd0628b784c58425 /python/scriptingprovider.py | |
| parent | fae8134d7e8e8102515844c0f85573927548f857 (diff) | |
Add current_*_ssa to python console, fix #3661
Diffstat (limited to 'python/scriptingprovider.py')
| -rw-r--r-- | python/scriptingprovider.py | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py index 5bc030a2..f18020b9 100644 --- a/python/scriptingprovider.py +++ b/python/scriptingprovider.py @@ -801,10 +801,23 @@ from binaryninja import * self.locals["current_llil"] = None self.locals["current_mlil"] = None self.locals["current_hlil"] = None + self.locals["current_llil_ssa"] = None + self.locals["current_mlil_ssa"] = None + self.locals["current_hlil_ssa"] = None else: - self.locals["current_llil"] = self.active_func.llil_if_available - self.locals["current_mlil"] = self.active_func.mlil_if_available - self.locals["current_hlil"] = self.active_func.hlil_if_available + current_llil = self.active_func.llil_if_available + current_mlil = self.active_func.mlil_if_available + current_hlil = self.active_func.hlil_if_available + self.locals["current_llil"] = current_llil + self.locals["current_mlil"] = current_mlil + self.locals["current_hlil"] = current_hlil + if current_llil is not None: + self.locals["current_llil_ssa"] = current_llil.ssa_form + if current_mlil is not None: + self.locals["current_mlil_ssa"] = current_mlil.ssa_form + if current_hlil is not None: + self.locals["current_hlil_ssa"] = current_hlil.ssa_form + if self.active_view is not None: self.locals["current_data_var"] = self.active_view.get_data_var_at(self.active_addr) @@ -866,10 +879,16 @@ from binaryninja import * ilType = view_location.getILViewType() if ilType == FunctionGraphType.LowLevelILFunctionGraph: self.active_il_function = self.locals["current_llil"] + elif ilType == FunctionGraphType.LowLevelILSSAFormFunctionGraph: + self.active_il_function = self.locals["current_llil_ssa"] elif ilType == FunctionGraphType.MediumLevelILFunctionGraph: self.active_il_function = self.locals["current_mlil"] + elif ilType == FunctionGraphType.MediumLevelILSSAFormFunctionGraph: + self.active_il_function = self.locals["current_mlil_ssa"] elif ilType == FunctionGraphType.HighLevelILFunctionGraph: self.active_il_function = self.locals["current_hlil"] + elif ilType == FunctionGraphType.HighLevelILSSAFormFunctionGraph: + self.active_il_function = self.locals["current_hlil_ssa"] else: self.active_il_function = None |
