diff options
| author | Xusheng <xusheng@vector35.com> | 2022-08-22 12:38:39 +0800 |
|---|---|---|
| committer | Xusheng <xusheng@vector35.com> | 2022-08-22 12:38:39 +0800 |
| commit | b6682e134a670e7bfc8cc6171d3d81d890007b12 (patch) | |
| tree | 1ed6b633d0b1b5ee92581eb13bdeb52bb027e2d3 /python | |
| parent | 3195e413073ae3e6a6aee845c36f4bc48d4696e9 (diff) | |
let .vars of an SSA MLIL/HLIL function return a list of SSA variables
Diffstat (limited to 'python')
| -rw-r--r-- | python/highlevelil.py | 7 | ||||
| -rw-r--r-- | python/mediumlevelil.py | 11 |
2 files changed, 12 insertions, 6 deletions
diff --git a/python/highlevelil.py b/python/highlevelil.py index 2acaea74..451942fc 100644 --- a/python/highlevelil.py +++ b/python/highlevelil.py @@ -2435,9 +2435,10 @@ class HighLevelILFunction: if self.source_function is None: return [] - if self.il_form in [ - FunctionGraphType.HighLevelILFunctionGraph, FunctionGraphType.HighLevelILSSAFormFunctionGraph - ]: + if self.il_form == FunctionGraphType.HighLevelILSSAFormFunctionGraph: + return self.ssa_vars + + if self.il_form == FunctionGraphType.HighLevelILFunctionGraph: count = ctypes.c_ulonglong() core_variables = core.BNGetHighLevelILVariables(self.handle, count) assert core_variables is not None, "core.BNGetHighLevelILVariables returned None" diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index bdc9b954..06298e6e 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -3150,9 +3150,14 @@ class MediumLevelILFunction: return [] if self.il_form in [ - FunctionGraphType.MediumLevelILFunctionGraph, FunctionGraphType.MediumLevelILSSAFormFunctionGraph, - FunctionGraphType.MappedMediumLevelILFunctionGraph, - FunctionGraphType.MappedMediumLevelILSSAFormFunctionGraph + FunctionGraphType.MediumLevelILSSAFormFunctionGraph, + FunctionGraphType.MappedMediumLevelILSSAFormFunctionGraph + ]: + return self.ssa_vars + + if self.il_form in [ + FunctionGraphType.MediumLevelILFunctionGraph, + FunctionGraphType.MappedMediumLevelILFunctionGraph ]: count = ctypes.c_ulonglong() core_variables = core.BNGetMediumLevelILVariables(self.handle, count) |
