summaryrefslogtreecommitdiff
path: root/python/function.py
diff options
context:
space:
mode:
authorRyan Snyder <ryan@vector35.com>2020-01-20 16:27:21 -0500
committerRyan Snyder <ryan@vector35.com>2020-01-20 16:27:58 -0500
commit42ccc6295db9d752bd1f78969153a77bca56988e (patch)
tree5ce408ea99f3a5ddab3e2fb5b276ce4da26cefb5 /python/function.py
parente4b45718df111abcc79eb353c4ab106e130e4ef1 (diff)
expose overriding call types at individual call sites
Diffstat (limited to 'python/function.py')
-rw-r--r--python/function.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/python/function.py b/python/function.py
index 4707aa45..4ecece2a 100644
--- a/python/function.py
+++ b/python/function.py
@@ -2225,6 +2225,17 @@ class Function(object):
core.BNSetAutoCallRegisterStackAdjustmentForRegisterStack(self.handle, arch.handle, addr, reg_stack,
adjust.value, adjust.confidence)
+ def set_call_type_adjustment(self, addr, adjust_type, arch=None):
+ if arch is None:
+ arch = self.arch
+ if adjust_type is None:
+ tc = None
+ else:
+ tc = core.BNTypeWithConfidence()
+ tc.type = adjust_type.handle
+ tc.confidence = adjust_type.confidence
+ core.BNSetUserCallTypeAdjustment(self.handle, arch.handle, addr, tc)
+
def set_call_stack_adjustment(self, addr, adjust, arch=None):
if arch is None:
arch = self.arch
@@ -2256,6 +2267,15 @@ class Function(object):
core.BNSetUserCallRegisterStackAdjustmentForRegisterStack(self.handle, arch.handle, addr, reg_stack,
adjust.value, adjust.confidence)
+ def get_call_type_adjustment(self, addr, arch=None):
+ if arch is None:
+ arch = self.arch
+ result = core.BNGetCallTypeAdjustment(self.handle, arch.handle, addr)
+ if result.type:
+ platform = self.platform
+ return types.Type(result.type, platform = platform, confidence = result.confidence)
+ return None
+
def get_call_stack_adjustment(self, addr, arch=None):
if arch is None:
arch = self.arch