summaryrefslogtreecommitdiff
path: root/python/mediumlevelil.py
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2019-12-19 16:04:11 -0500
committerRusty Wagner <rusty@vector35.com>2019-12-19 16:04:11 -0500
commit741fb0538e0ac6ab14928f78697196803dbd2ed5 (patch)
treedd0b8da88791b03553d659e6672c8d5ba0fdecfa /python/mediumlevelil.py
parent98771ab9f325e310ae07120cf559f601837380f9 (diff)
LLIL_JUMP_TO/MLIL_JUMP_TO now contain mappings from address to destination instruction
Diffstat (limited to 'python/mediumlevelil.py')
-rw-r--r--python/mediumlevelil.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index 806dc063..24b87ac7 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -170,7 +170,7 @@ class MediumLevelILInstruction(object):
MediumLevelILOperation.MLIL_ZX: [("src", "expr")],
MediumLevelILOperation.MLIL_LOW_PART: [("src", "expr")],
MediumLevelILOperation.MLIL_JUMP: [("dest", "expr")],
- MediumLevelILOperation.MLIL_JUMP_TO: [("dest", "expr"), ("targets", "int_list")],
+ MediumLevelILOperation.MLIL_JUMP_TO: [("dest", "expr"), ("targets", "target_map")],
MediumLevelILOperation.MLIL_RET_HINT: [("dest", "expr")],
MediumLevelILOperation.MLIL_CALL: [("output", "var_list"), ("dest", "expr"), ("params", "expr_list")],
MediumLevelILOperation.MLIL_CALL_UNTYPED: [("output", "expr"), ("dest", "expr"), ("params", "expr"), ("stack", "expr")],
@@ -335,6 +335,16 @@ class MediumLevelILInstruction(object):
for j in range(count.value):
value.append(MediumLevelILInstruction(func, operand_list[j]))
core.BNMediumLevelILFreeOperandList(operand_list)
+ elif operand_type == "target_map":
+ count = ctypes.c_ulonglong()
+ operand_list = core.BNMediumLevelILGetOperandList(func.handle, self._expr_index, i, count)
+ i += 1
+ value = {}
+ for j in range(count.value // 2):
+ key = operand_list[j * 2]
+ target = operand_list[(j * 2) + 1]
+ value[key] = target
+ core.BNMediumLevelILFreeOperandList(operand_list)
self._operands.append(value)
self.__dict__[name] = value
i += 1