From 4677622997632557385187477331110706520731 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Tue, 10 Jun 2025 01:37:13 -0400 Subject: Fix IL BasicBlock repr using hex IL instr indices --- python/basicblock.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'python/basicblock.py') diff --git a/python/basicblock.py b/python/basicblock.py index 712d1d33..cd9227d5 100644 --- a/python/basicblock.py +++ b/python/basicblock.py @@ -118,10 +118,17 @@ class BasicBlock: def __repr__(self): arch = self.arch - if arch: - return f"<{self.__class__.__name__}: {arch.name}@{self.start:#x}-{self.end:#x}>" + if self.is_il: + # IL indices are shown as decimal + if arch: + return f"<{self.__class__.__name__}: {arch.name}@{self.start}-{self.end}>" + else: + return f"<{self.__class__.__name__}: {self.start}-{self.end}>" else: - return f"<{self.__class__.__name__}: {self.start:#x}-{self.end:#x}>" + if arch: + return f"<{self.__class__.__name__}: {arch.name}@{self.start:#x}-{self.end:#x}>" + else: + return f"<{self.__class__.__name__}: {self.start:#x}-{self.end:#x}>" def __len__(self): return int(core.BNGetBasicBlockLength(self.handle)) -- cgit v1.3.1