diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2024-01-03 15:56:01 -0700 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2024-01-04 12:42:14 -0700 |
| commit | 7e8de24c479672261b8a5c9911cac8800bad180b (patch) | |
| tree | 6992a8a6f59a46c4be93f7a4693b52fc871fbfce /binaryview.cpp | |
| parent | a9cfac7ff14d93ff22092366f99eb2dd3213ea7e (diff) | |
Add GetRelocationsAt API
Diffstat (limited to 'binaryview.cpp')
| -rw-r--r-- | binaryview.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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<Ref<Relocation>> BinaryView::GetRelocationsAt(uint64_t addr) const +{ + size_t count = 0; + BNRelocation** relocations = BNGetRelocationsAt(m_object, addr, &count); + std::vector<Ref<Relocation>> 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()); |
