summaryrefslogtreecommitdiff
path: root/python/basicblock.py
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2018-09-05 14:39:46 -0400
committerRusty Wagner <rusty@vector35.com>2018-09-05 14:39:46 -0400
commitf4d75c9229d2d76f36f80e97dd49c7aece242600 (patch)
tree0390fc2b624149274c5c01b847d59698055a2974 /python/basicblock.py
parentc02c863367ff88c1e562a1110e069bf2842798aa (diff)
parente51031010b107089dd7b5b69039ac42b856a0769 (diff)
Merge branch 'test_stack_adjust' into 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