From 42ccc6295db9d752bd1f78969153a77bca56988e Mon Sep 17 00:00:00 2001 From: Ryan Snyder Date: Mon, 20 Jan 2020 16:27:21 -0500 Subject: expose overriding call types at individual call sites --- function.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'function.cpp') diff --git a/function.cpp b/function.cpp index 917b1556..c218a78e 100644 --- a/function.cpp +++ b/function.cpp @@ -1069,6 +1069,15 @@ vector Function::GetIndirectBranchesAt(Architecture* arch, u } +void Function::SetAutoCallTypeAdjustment(Architecture* arch, uint64_t addr, const Confidence>& 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& 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>& 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& adjust) { BNSetUserCallStackAdjustment(m_object, arch->GetObject(), addr, adjust.GetValue(), adjust.GetConfidence()); @@ -1131,6 +1149,13 @@ void Function::SetUserCallRegisterStackAdjustment(Architecture* arch, uint64_t a } +Confidence> Function::GetCallTypeAdjustment(Architecture* arch, uint64_t addr) +{ + BNTypeWithConfidence result = BNGetCallTypeAdjustment(m_object, arch->GetObject(), addr); + return Confidence>(result.type ? new Type(result.type) : nullptr, result.confidence); +} + + Confidence Function::GetCallStackAdjustment(Architecture* arch, uint64_t addr) { BNOffsetWithConfidence result = BNGetCallStackAdjustment(m_object, arch->GetObject(), addr); -- cgit v1.3.1