From 7e8de24c479672261b8a5c9911cac8800bad180b Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Wed, 3 Jan 2024 15:56:01 -0700 Subject: Add GetRelocationsAt API --- binaryview.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'binaryview.cpp') diff --git a/binaryview.cpp b/binaryview.cpp index 1588d23a..e0708148 100644 --- a/binaryview.cpp +++ b/binaryview.cpp @@ -1607,6 +1607,20 @@ bool BinaryView::RangeContainsRelocation(uint64_t addr, size_t size) const } +std::vector> BinaryView::GetRelocationsAt(uint64_t addr) const +{ + size_t count = 0; + BNRelocation** relocations = BNGetRelocationsAt(m_object, addr, &count); + std::vector> result(count); + for (size_t i = 0; i < count; i++) + { + result.push_back(new Relocation(relocations[i])); + } + BNFreeRelocationList(relocations, count); + return result; +} + + void BinaryView::RegisterNotification(BinaryDataNotification* notify) { BNRegisterDataNotification(m_object, notify->GetCallbacks()); -- cgit v1.3.1