summaryrefslogtreecommitdiff
path: root/python/binaryview.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/binaryview.py
parent7357dd114a145ca64e7356233c3cb8b9dd9eae84 (diff)
Commonize all InstructionTextToken generation
Diffstat (limited to 'python/binaryview.py')
-rw-r--r--python/binaryview.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index 612632d3..cefe6481 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -3271,17 +3271,7 @@ class BinaryView(object):
block = basicblock.BasicBlock(self, core.BNNewBasicBlockReference(lines[i].block))
color = highlight.HighlightColor._from_core_struct(lines[i].contents.highlight)
addr = lines[i].contents.addr
- tokens = []
- for j in range(0, lines[i].contents.count):
- token_type = InstructionTextTokenType(lines[i].contents.tokens[j].type)
- text = lines[i].contents.tokens[j].text
- value = lines[i].contents.tokens[j].value
- size = lines[i].contents.tokens[j].size
- operand = lines[i].contents.tokens[j].operand
- context = lines[i].contents.tokens[j].context
- confidence = lines[i].contents.tokens[j].confidence
- address = lines[i].contents.tokens[j].address
- tokens.append(binaryninja.function.InstructionTextToken(token_type, text, value, size, operand, context, address, confidence))
+ tokens = binaryninja.function.InstructionTextToken.get_instruction_lines(lines[i].contents.tokens, lines[i].contents.count)
contents = binaryninja.function.DisassemblyTextLine(tokens, addr, color = color)
result.append(lineardisassembly.LinearDisassemblyLine(lines[i].type, func, block, lines[i].lineOffset, contents))