summaryrefslogtreecommitdiff
path: root/python/mediumlevelil.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2018-12-03 22:20:28 -0500
committerPeter LaFosse <peter@vector35.com>2018-12-13 13:32:18 -0500
commit231afab8b0ba6c8c9eff879681c52724b6688c18 (patch)
tree38026cfa20f34702b7267e9c397652119f27ebe7 /python/mediumlevelil.py
parent7357dd114a145ca64e7356233c3cb8b9dd9eae84 (diff)
Commonize all InstructionTextToken generation
Diffstat (limited to 'python/mediumlevelil.py')
-rw-r--r--python/mediumlevelil.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index c88ab6b8..2dae008a 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -331,17 +331,7 @@ class MediumLevelILInstruction(object):
if not core.BNGetMediumLevelILExprText(self.function.handle, self.function.arch.handle,
self.expr_index, tokens, count):
return None
- result = []
- for i in range(0, count.value):
- token_type = InstructionTextTokenType(tokens[i].type)
- text = tokens[i].text
- value = tokens[i].value
- size = tokens[i].size
- operand = tokens[i].operand
- context = tokens[i].context
- confidence = tokens[i].confidence
- address = tokens[i].address
- result.append(function.InstructionTextToken(token_type, text, value, size, operand, context, address, confidence))
+ result = binaryninja.function.InstructionTextToken.get_instruction_lines(tokens, count.value)
core.BNFreeInstructionText(tokens, count.value)
return result