diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/highlevelil.py | 7 | ||||
| -rw-r--r-- | python/lowlevelil.py | 11 | ||||
| -rw-r--r-- | python/mediumlevelil.py | 15 |
3 files changed, 26 insertions, 7 deletions
diff --git a/python/highlevelil.py b/python/highlevelil.py index 1ac81617..6398bc26 100644 --- a/python/highlevelil.py +++ b/python/highlevelil.py @@ -2552,10 +2552,13 @@ class HighLevelILFunction: def __repr__(self): arch = self.source_function.arch + form = "" + if self.il_form == FunctionGraphType.HighLevelILSSAFormFunctionGraph: + form += " ssa form" if arch: - return "<hlil func: %s@%#x>" % (arch.name, self.source_function.start) + return f"<HighLevelILFunction{form}: {arch.name}@{self.source_function.start:#x}>" else: - return "<hlil func: %#x>" % self.source_function.start + return f"<HighLevelILFunction{form}: {self.source_function.start:#x}>" def __eq__(self, other): if not isinstance(other, self.__class__): diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 79919efe..c9c478dd 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -3311,12 +3311,17 @@ class LowLevelILFunction: core.BNFreeLowLevelILFunction(self.handle) def __repr__(self): + form = "" + if self.il_form == FunctionGraphType.LiftedILFunctionGraph: + form += " lifted il" + if self.il_form == FunctionGraphType.LowLevelILSSAFormFunctionGraph: + form += " ssa form" if self.source_function is not None and self.source_function.arch is not None: - return f"<{self.__class__.__name__}: {self.source_function.arch.name}@{self.source_function.start:#x}>" + return f"<{self.__class__.__name__}{form}: {self.source_function.arch.name}@{self.source_function.start:#x}>" elif self.source_function is not None: - return f"<{self.__class__.__name__}: {self.source_function.start:#x}>" + return f"<{self.__class__.__name__}{form}: {self.source_function.start:#x}>" else: - return f"<{self.__class__.__name__}: anonymous>" + return f"<{self.__class__.__name__}{form}: anonymous>" def __len__(self): return int(core.BNGetLowLevelILInstructionCount(self.handle)) diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index 6d4ae036..577a48ef 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -3283,10 +3283,21 @@ class MediumLevelILFunction: def __repr__(self): arch = self.source_function.arch + form = "" + if self.il_form in [ + FunctionGraphType.MappedMediumLevelILFunctionGraph, + FunctionGraphType.MappedMediumLevelILSSAFormFunctionGraph, + ]: + form += " mapped mlil" + if self.il_form in [ + FunctionGraphType.MediumLevelILSSAFormFunctionGraph, + FunctionGraphType.MappedMediumLevelILSSAFormFunctionGraph, + ]: + form += " ssa form" if arch: - return f"<MediumLevelILFunction: {arch.name}@{self.source_function.start:#x}>" + return f"<MediumLevelILFunction{form}: {arch.name}@{self.source_function.start:#x}>" else: - return f"<MediumLevelILFunction: {self.source_function.start:#x}>" + return f"<MediumLevelILFunction{form}: {self.source_function.start:#x}>" def __len__(self): return int(core.BNGetMediumLevelILInstructionCount(self.handle)) |
