summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/lowlevelil.py7
-rw-r--r--python/mediumlevelil.py7
2 files changed, 14 insertions, 0 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py
index 10bebcc5..b2379164 100644
--- a/python/lowlevelil.py
+++ b/python/lowlevelil.py
@@ -2891,6 +2891,13 @@ class LowLevelILBasicBlock(basicblock.BasicBlock):
def __hash__(self):
return hash((self.start, self.end, self._il_function))
+ def __repr__(self):
+ arch = self.arch
+ if arch:
+ return "<llil block: %s@%d-%d>" % (arch.name, self.start, self.end)
+ else:
+ return "<llil block: %d-%d>" % (self.start, self.end)
+
def __contains__(self, instruction):
if type(instruction) != LowLevelILInstruction or instruction.il_basic_block != self:
return False
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index a90fb0aa..8400d33a 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -1172,6 +1172,13 @@ class MediumLevelILBasicBlock(basicblock.BasicBlock):
def __hash__(self):
return hash((self.start, self.end, self.il_function))
+ def __repr__(self):
+ arch = self.arch
+ if arch:
+ return "<mlil block: %s@%d-%d>" % (arch.name, self.start, self.end)
+ else:
+ return "<mlil block: %d-%d>" % (self.start, self.end)
+
def __contains__(self, instruction):
if type(instruction) != MediumLevelILInstruction or instruction.il_basic_block != self:
return False