summaryrefslogtreecommitdiff
path: root/python/lowlevelil.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2017-01-09 21:58:55 -0500
committerPeter LaFosse <peter@vector35.com>2017-01-09 21:58:55 -0500
commitaae6c3aecdb04e8a6e33799287737a33a634418d (patch)
treed9812259f3ce96123b3310f9ee332e8dc34ab643 /python/lowlevelil.py
parent9d1cac8ee55553cdb20c36deb3b15c9219b02d9b (diff)
Wrapping some unwrapped enumeration values, and adding il basic block indexing
Diffstat (limited to 'python/lowlevelil.py')
-rw-r--r--python/lowlevelil.py12
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