summaryrefslogtreecommitdiff
path: root/python/basicblock.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2018-09-12 17:03:38 -0400
committerPeter LaFosse <peter@vector35.com>2018-09-12 17:03:38 -0400
commit74a8547853dd66fe62d2e75b93c1b723eb6f69cf (patch)
tree067119496c2beaf0636c955d27291d4620e17c0b /python/basicblock.py
parent097a2e4c8849d4938d8a027985ce3816fd9785ed (diff)
parent59a2824b1ad36ea5d0520919e86ad779cd97cc8f (diff)
Merging with dev
Diffstat (limited to 'python/basicblock.py')
-rw-r--r--python/basicblock.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/python/basicblock.py b/python/basicblock.py
index 11d5a7f4..353771d9 100644
--- a/python/basicblock.py
+++ b/python/basicblock.py
@@ -245,14 +245,7 @@ class BasicBlock(object):
>>> current_basic_block.highlight
<color: blue>
"""
- color = core.BNGetBasicBlockHighlight(self.handle)
- if color.style == HighlightColorStyle.StandardHighlightColor:
- return highlight.HighlightColor(color=color.color, alpha=color.alpha)
- elif color.style == HighlightColorStyle.MixedHighlightColor:
- return highlight.HighlightColor(color=color.color, mix_color=color.mixColor, mix=color.mix, alpha=color.alpha)
- elif color.style == HighlightColorStyle.CustomHighlightColor:
- return highlight.HighlightColor(red=color.r, green=color.g, blue=color.b, alpha=color.alpha)
- return highlight.HighlightColor(color=HighlightStandardColor.NoHighlightColor)
+ return highlight.HighlightColor._from_core_struct(core.BNGetBasicBlockHighlight(self.handle))
@highlight.setter
def highlight(self, value):
@@ -345,6 +338,7 @@ class BasicBlock(object):
il_instr = self.il_function[lines[i].instrIndex]
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)
@@ -356,7 +350,7 @@ class BasicBlock(object):
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))
- result.append(binaryninja.function.DisassemblyTextLine(addr, tokens, il_instr))
+ result.append(binaryninja.function.DisassemblyTextLine(tokens, addr, il_instr, color))
core.BNFreeDisassemblyTextLines(lines, count.value)
return result