From 5369369447df3b182e51d9305e1ed49659b63b10 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Tue, 28 Jul 2020 23:11:42 +0800 Subject: add __repr__ for LowLevelILFunction --- python/lowlevelil.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 59521a67..9435f07b 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -1305,11 +1305,14 @@ class LowLevelILFunction(object): core.BNFreeLowLevelILFunction(self.handle) def __repr__(self): - arch = self.source_function.arch - if arch: + source_function = getattr(self, "source_function", None) + arch = getattr(source_function, "arch", None) + if arch and source_function: return "" % (arch.name, self.source_function.start) - else: + elif source_function: return "" % self.source_function.start + else: + return "" def __len__(self): return int(core.BNGetLowLevelILInstructionCount(self.handle)) -- cgit v1.3.1