diff options
| author | Brian Potchik <brian@vector35.com> | 2022-02-07 13:38:21 -0500 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2022-02-07 13:38:21 -0500 |
| commit | a9ecb3d5566f86eb4d690a0672e6d5cdcb6ecbe8 (patch) | |
| tree | 7d866ff8d09aa70a661e40858f120b69c59b4188 /python | |
| parent | b64a191308ae7e69d6810a72b39ac85b19bc2a92 (diff) | |
Add python wrapper for MLIL generate_ssa_form.
Diffstat (limited to 'python')
| -rw-r--r-- | python/mediumlevelil.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index e0bc60d1..b767070c 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -2900,6 +2900,28 @@ class MediumLevelILFunction: """ core.BNFinalizeMediumLevelILFunction(self.handle) + def generate_ssa_form(self, analyze_conditionals : bool = True, handle_aliases : bool = True, known_not_aliases: Optional[List["variable.Variable"]] = None, known_aliases: Optional[List["variable.Variable"]] = None) -> None: + """ + ``generate_ssa_form`` generate SSA form given the current MLIL + + :param bool analyze_conditionals: whether or not to analyze conditionals, defaults to ``True`` + :param bool handle_aliases: whether or not to handle aliases, defaults to ``True`` + :param list(Variable) known_not_aliases: optional list of variables known to be not aliased + :param list(Variable) known_aliases: optional list of variables known to be aliased + :rtype: None + """ + if known_not_aliases is None: + known_not_aliases = [] + if known_aliases is None: + known_aliases = [] + known_not_alias_list = (core.BNVariable * len(known_not_aliases))() + for i in range(len(known_not_aliases)): + known_not_alias_list[i] = known_not_aliases[i].to_BNVariable() + known_alias_list = (core.BNVariable * len(known_aliases))() + for i in range(len(known_aliases)): + known_alias_list[i] = known_aliases[i].to_BNVariable() + core.BNGenerateMediumLevelILSSAForm(self.handle, analyze_conditionals, handle_aliases, known_not_alias_list, len(known_not_alias_list), known_alias_list, len(known_alias_list)) + def get_ssa_instruction_index(self, instr: InstructionIndex) -> InstructionIndex: return InstructionIndex(core.BNGetMediumLevelILSSAInstructionIndex(self.handle, instr)) |
