diff options
| author | kat <kat@vector35.com> | 2025-03-12 18:54:51 -0400 |
|---|---|---|
| committer | kat <kat@vector35.com> | 2025-03-19 15:04:23 -0400 |
| commit | d2371c2edabb7d70c2b31150bfa0e46d7acd1e5e (patch) | |
| tree | cd87b95725be78b859921cebb97faee6f0cb5d92 /binaryninjaapi.h | |
| parent | 7b1813b331f8872ec9bded4fd2df6059fae3d902 (diff) | |
Add API for BinaryView::FinalizeNewSegments
Diffstat (limited to 'binaryninjaapi.h')
| -rw-r--r-- | binaryninjaapi.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 2e4ec080..5fc2f5a6 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -5123,6 +5123,19 @@ namespace BinaryNinja { */ bool Save(const std::string& path); + /*! Performs "finalization" on segments added after initial Finalization (performed after an Init() has completed). + + Finalizing a segment involves optimizing the relocation info stored in that segment, so if a segment is added + and relocations are defined for that segment by some automated process, this function should be called afterwards. + + An example of this can be seen in the KernelCache plugin, in `KernelCache::LoadImageWithInstallName`. + After we load an image, map new segments, and define relocations for all of them, we call this function + to let core know it is now safe to finalize the new segments + + \return Whether finalization was successful. + */ + bool FinalizeNewSegments(); + void DefineRelocation(Architecture* arch, BNRelocationInfo& info, uint64_t target, uint64_t reloc); void DefineRelocation(Architecture* arch, BNRelocationInfo& info, Ref<Symbol> target, uint64_t reloc); std::vector<std::pair<uint64_t, uint64_t>> GetRelocationRanges() const; |
