From 468d9184a343beeac9cac2e492a1f842a6a3234e Mon Sep 17 00:00:00 2001 From: Galen Williamson Date: Wed, 7 Jul 2021 17:11:22 -0400 Subject: Added slicing support to __getitem__ in all basic block classes --- python/lowlevelil.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'python/lowlevelil.py') diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 310d9d79..6b9d09b4 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -3089,6 +3089,8 @@ class LowLevelILBasicBlock(basicblock.BasicBlock): def __getitem__(self, idx): size = self.end - self.start + if isinstance(idx, slice): + return [self[index] for index in range(*idx.incides(size))] if idx > size or idx < -size: raise IndexError("list index is out of range") if idx >= 0: -- cgit v1.3.1