From 231afab8b0ba6c8c9eff879681c52724b6688c18 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Mon, 3 Dec 2018 22:20:28 -0500 Subject: Commonize all InstructionTextToken generation --- python/basicblock.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'python/basicblock.py') diff --git a/python/basicblock.py b/python/basicblock.py index d66a41c2..d68189ab 100644 --- a/python/basicblock.py +++ b/python/basicblock.py @@ -338,17 +338,7 @@ class BasicBlock(object): else: il_instr = None color = highlight.HighlightColor._from_core_struct(lines[i].highlight) - tokens = [] - for j in range(0, lines[i].count): - token_type = InstructionTextTokenType(lines[i].tokens[j].type) - text = lines[i].tokens[j].text - value = lines[i].tokens[j].value - size = lines[i].tokens[j].size - operand = lines[i].tokens[j].operand - context = lines[i].tokens[j].context - confidence = lines[i].tokens[j].confidence - address = lines[i].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].tokens, lines[i].count) result.append(binaryninja.function.DisassemblyTextLine(tokens, addr, il_instr, color)) core.BNFreeDisassemblyTextLines(lines, count.value) return result -- cgit v1.3.1