summaryrefslogtreecommitdiff
path: root/python/function.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2018-01-09 16:47:47 -0500
committerPeter LaFosse <peter@vector35.com>2018-01-09 16:47:47 -0500
commit6ef9dd016c957e796f89f94f00c6d71e2f7589e8 (patch)
tree5ab4ab48cf8f47c4e5325f3b3ae4cf9e5e8d5194 /python/function.py
parent16a4d413d58d2cb29be97781bba0b52546afa390 (diff)
parent26edabfdd7211012c7c8a03186d3025eea9aa345 (diff)
Merge branch 'dev'
Diffstat (limited to 'python/function.py')
-rw-r--r--python/function.py31
1 files changed, 23 insertions, 8 deletions
diff --git a/python/function.py b/python/function.py
index f8aaae44..58bee8f4 100644
--- a/python/function.py
+++ b/python/function.py
@@ -123,6 +123,8 @@ class PossibleValueSet(object):
self.reg = arch.get_reg_name(value.value)
elif value.state == RegisterValueType.ConstantValue:
self.value = value.value
+ elif value.state == RegisterValueType.ConstantPointerValue:
+ self.value = value.value
elif value.state == RegisterValueType.StackFrameOffset:
self.offset = value.value
elif value.state == RegisterValueType.SignedRangeValue:
@@ -164,6 +166,8 @@ class PossibleValueSet(object):
return "<entry %s>" % self.reg
if self.type == RegisterValueType.ConstantValue:
return "<const %#x>" % self.value
+ if self.type == RegisterValueType.ConstantPointerValue:
+ return "<const ptr %#x>" % self.value
if self.type == RegisterValueType.StackFrameOffset:
return "<stack frame offset %#x>" % self.offset
if self.type == RegisterValueType.SignedRangeValue:
@@ -307,6 +311,8 @@ class Function(object):
self._view = view
self.handle = core.handle_of_type(handle, core.BNFunction)
self._advanced_analysis_requests = 0
+ self._arch = None
+ self._platform = None
def __del__(self):
if self._advanced_analysis_requests > 0:
@@ -358,18 +364,26 @@ class Function(object):
@property
def arch(self):
"""Function architecture (read-only)"""
- arch = core.BNGetFunctionArchitecture(self.handle)
- if arch is None:
- return None
- return architecture.Architecture(arch)
+ if self._arch:
+ return self._arch
+ else:
+ arch = core.BNGetFunctionArchitecture(self.handle)
+ if arch is None:
+ return None
+ self._arch = architecture.Architecture(arch)
+ return self._arch
@property
def platform(self):
"""Function platform (read-only)"""
- plat = core.BNGetFunctionPlatform(self.handle)
- if plat is None:
- return None
- return platform.Platform(None, handle = plat)
+ if self._platform:
+ return self._platform
+ else:
+ plat = core.BNGetFunctionPlatform(self.handle)
+ if plat is None:
+ return None
+ self._platform = platform.Platform(None, handle = plat)
+ return self._platform
@property
def start(self):
@@ -1741,6 +1755,7 @@ class InstructionBranch(object):
class InstructionInfo(object):
def __init__(self):
self.length = 0
+ self.arch_transition_by_target_addr = False
self.branch_delay = False
self.branches = []