summaryrefslogtreecommitdiff
path: root/function.cpp
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 /function.cpp
parente4b45718df111abcc79eb353c4ab106e130e4ef1 (diff)
expose overriding call types at individual call sites
Diffstat (limited to 'function.cpp')
-rw-r--r--function.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/function.cpp b/function.cpp
index 917b1556..c218a78e 100644
--- a/function.cpp
+++ b/function.cpp
@@ -1069,6 +1069,15 @@ vector<IndirectBranchInfo> Function::GetIndirectBranchesAt(Architecture* arch, u
}
+void Function::SetAutoCallTypeAdjustment(Architecture* arch, uint64_t addr, const Confidence<Ref<Type>>& adjust)
+{
+ BNTypeWithConfidence apiObject;
+ apiObject.type = adjust ? adjust->GetObject() : nullptr;
+ apiObject.confidence = adjust.GetConfidence();
+ BNSetAutoCallTypeAdjustment(m_object, arch->GetObject(), addr, adjust ? &apiObject : nullptr);
+}
+
+
void Function::SetAutoCallStackAdjustment(Architecture* arch, uint64_t addr, const Confidence<int64_t>& adjust)
{
BNSetAutoCallStackAdjustment(m_object, arch->GetObject(), addr, adjust.GetValue(), adjust.GetConfidence());
@@ -1100,6 +1109,15 @@ void Function::SetAutoCallRegisterStackAdjustment(Architecture* arch, uint64_t a
}
+void Function::SetUserCallTypeAdjustment(Architecture* arch, uint64_t addr, const Confidence<Ref<Type>>& adjust)
+{
+ BNTypeWithConfidence apiObject;
+ apiObject.type = adjust ? adjust->GetObject() : nullptr;
+ apiObject.confidence = adjust.GetConfidence();
+ BNSetUserCallTypeAdjustment(m_object, arch->GetObject(), addr, adjust ? &apiObject : nullptr);
+}
+
+
void Function::SetUserCallStackAdjustment(Architecture* arch, uint64_t addr, const Confidence<int64_t>& adjust)
{
BNSetUserCallStackAdjustment(m_object, arch->GetObject(), addr, adjust.GetValue(), adjust.GetConfidence());
@@ -1131,6 +1149,13 @@ void Function::SetUserCallRegisterStackAdjustment(Architecture* arch, uint64_t a
}
+Confidence<Ref<Type>> Function::GetCallTypeAdjustment(Architecture* arch, uint64_t addr)
+{
+ BNTypeWithConfidence result = BNGetCallTypeAdjustment(m_object, arch->GetObject(), addr);
+ return Confidence<Ref<Type>>(result.type ? new Type(result.type) : nullptr, result.confidence);
+}
+
+
Confidence<int64_t> Function::GetCallStackAdjustment(Architecture* arch, uint64_t addr)
{
BNOffsetWithConfidence result = BNGetCallStackAdjustment(m_object, arch->GetObject(), addr);