summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/basicblock.py4
-rw-r--r--python/highlevelil.py7
-rw-r--r--python/lowlevelil.py7
-rw-r--r--python/mediumlevelil.py7
4 files changed, 23 insertions, 2 deletions
diff --git a/python/basicblock.py b/python/basicblock.py
index 98cc79fa..64f2101b 100644
--- a/python/basicblock.py
+++ b/python/basicblock.py
@@ -68,9 +68,9 @@ class BasicBlock:
def __repr__(self):
arch = self.arch
if arch:
- return f"<{self.__class__.__name__}: {arch.name}@{self.start}-{self.end}>"
+ return f"<{self.__class__.__name__}: {arch.name}@{self.start:#x}-{self.end:#x}>"
else:
- return f"<{self.__class__.__name__}: {self.start}-{self.end}>"
+ return f"<{self.__class__.__name__}: {self.start:#x}-{self.end:#x}>"
def __len__(self):
return int(core.BNGetBasicBlockLength(self.handle))
diff --git a/python/highlevelil.py b/python/highlevelil.py
index 5e5708b5..4795ff7f 100644
--- a/python/highlevelil.py
+++ b/python/highlevelil.py
@@ -3013,6 +3013,13 @@ class HighLevelILBasicBlock(basicblock.BasicBlock):
else:
return False
+ def __repr__(self):
+ arch = self.arch
+ if arch:
+ return f"<{self.__class__.__name__}: {arch.name}@{self.start}-{self.end}>"
+ else:
+ return f"<{self.__class__.__name__}: {self.start}-{self.end}>"
+
@property
def instruction_count(self) -> int:
return self.end - self.start
diff --git a/python/lowlevelil.py b/python/lowlevelil.py
index 4ab79621..3354dae4 100644
--- a/python/lowlevelil.py
+++ b/python/lowlevelil.py
@@ -5291,6 +5291,13 @@ class LowLevelILBasicBlock(basicblock.BasicBlock):
else:
return self._il_function[self.end + idx]
+ def __repr__(self):
+ arch = self.arch
+ if arch:
+ return f"<{self.__class__.__name__}: {arch.name}@{self.start}-{self.end}>"
+ else:
+ return f"<{self.__class__.__name__}: {self.start}-{self.end}>"
+
def _create_instance(self, handle):
"""Internal method by super to instantiate child instances"""
return LowLevelILBasicBlock(handle, self._il_function, self.view)
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index 1f122d2a..c1c4d231 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -3752,6 +3752,13 @@ class MediumLevelILBasicBlock(basicblock.BasicBlock):
else:
return False
+ def __repr__(self):
+ arch = self.arch
+ if arch:
+ return f"<{self.__class__.__name__}: {arch.name}@{self.start}-{self.end}>"
+ else:
+ return f"<{self.__class__.__name__}: {self.start}-{self.end}>"
+
def _create_instance(
self, handle: core.BNBasicBlockHandle) -> 'MediumLevelILBasicBlock':
"""Internal method by super to instantiate child instances"""