diff options
| author | Glenn Smith <glenn@vector35.com> | 2025-06-10 01:37:13 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2025-06-11 17:37:29 -0400 |
| commit | 4677622997632557385187477331110706520731 (patch) | |
| tree | ebc3d511613e024814fc2f290af6bbbeece9f186 /python/basicblock.py | |
| parent | 9606367988085312068316551025114832489391 (diff) | |
Fix IL BasicBlock repr using hex IL instr indices
Diffstat (limited to 'python/basicblock.py')
| -rw-r--r-- | python/basicblock.py | 13 |
1 files changed, 10 insertions, 3 deletions
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)) |
