diff options
Diffstat (limited to 'python/lowlevelil.py')
| -rw-r--r-- | python/lowlevelil.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 4564bf13..419e8513 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -118,8 +118,7 @@ class LowLevelILInstruction(object): self.function = func self.expr_index = expr_index self.instr_index = instr_index - self.operation = instr.operation - self.operation_name = LowLevelILOperation(instr.operation) + self.operation = LowLevelILOperation(instr.operation) self.size = instr.size self.address = instr.address self.source_operand = instr.sourceOperand @@ -1261,6 +1260,15 @@ class LowLevelILBasicBlock(basicblock.BasicBlock): for idx in xrange(self.start, self.end): yield self.il_function[idx] + def __getitem__(self, idx): + size = self.end - self.start + if idx > size or idx < -size: + raise IndexError("list index is out of range") + if idx >= 0: + return self.il_function[idx + self.start] + else: + return self.il_function[self.end + idx] + def LLIL_TEMP(n): return n | 0x80000000 |
