diff options
Diffstat (limited to 'function.cpp')
| -rw-r--r-- | function.cpp | 25 |
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); |
