summaryrefslogtreecommitdiff
path: root/python/function.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2017-01-09 21:58:55 -0500
committerPeter LaFosse <peter@vector35.com>2017-01-09 21:58:55 -0500
commitaae6c3aecdb04e8a6e33799287737a33a634418d (patch)
treed9812259f3ce96123b3310f9ee332e8dc34ab643 /python/function.py
parent9d1cac8ee55553cdb20c36deb3b15c9219b02d9b (diff)
Wrapping some unwrapped enumeration values, and adding il basic block indexing
Diffstat (limited to 'python/function.py')
-rw-r--r--python/function.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/python/function.py b/python/function.py
index e3c79312..1843dd3d 100644
--- a/python/function.py
+++ b/python/function.py
@@ -25,7 +25,8 @@ import ctypes
# Binary Ninja components
import _binaryninjacore as core
from enums import (FunctionGraphType, BranchType, SymbolType, InstructionTextTokenType,
- HighlightStandardColor, RegisterValueType, ImplicitRegisterExtend, DisassemblyOption, IntegerDisplayType)
+ HighlightStandardColor, HighlightColorStyle, RegisterValueType, ImplicitRegisterExtend,
+ DisassemblyOption, IntegerDisplayType)
import architecture
import highlight
import associateddatastore
@@ -47,7 +48,7 @@ class LookupTableEntry(object):
class RegisterValue(object):
def __init__(self, arch, value):
- self.type = value.state
+ self.type = RegisterValueType(value.state)
if value.state == RegisterValueType.EntryValue:
self.reg = arch.get_reg_name(value.reg)
elif value.state == RegisterValueType.OffsetFromEntryValue:
@@ -682,7 +683,7 @@ class Function(object):
def get_int_display_type(self, instr_addr, value, operand, arch=None):
if arch is None:
arch = self.arch
- return core.BNGetIntegerConstantDisplayType(self.handle, arch.handle, instr_addr, value, operand)
+ return IntegerDisplayType(core.BNGetIntegerConstantDisplayType(self.handle, arch.handle, instr_addr, value, operand))
def set_int_display_type(self, instr_addr, value, operand, display_type, arch=None):
"""
@@ -831,7 +832,7 @@ class DisassemblyTextLine(object):
class FunctionGraphEdge:
def __init__(self, branch_type, arch, target, points):
- self.type = branch_type
+ self.type = BranchType(branch_type)
self.arch = arch
self.target = target
self.points = points
@@ -1237,7 +1238,7 @@ class InstructionTextToken(object):
"""
def __init__(self, token_type, text, value = 0, size = 0, operand = 0xffffffff):
- self.type = token_type
+ self.type = InstructionTextTokenType(token_type)
self.text = text
self.value = value
self.size = size