summaryrefslogtreecommitdiff
path: root/view/sharedcache/api
AgeCommit message (Collapse)Author
2026-02-13[DSC] Correctly mark symbols as having local, global, or weak bindingMark Rowe
2026-01-01update copyrights for 2026Jordan Wiens
2025-10-11Fix demo ifdefsJosh Ferrell
2025-07-30Add dependency tracking to the Python code generationMark Rowe
This ensures that the Python source files are only generated and copied into the output directory if inputs have changed, rather than being done unconditionally.
2025-07-30[CMake] Specify CONFIGURE_DEPENDS for all file(GLOB ..)Mark Rowe
This ensures that CMake detects when files that match the glob are added or removed.
2025-06-25Update CXX_STANDARD to 20.Alexander Taylor
Also update minimum CMake version.
2025-06-25Remove implicit conversions from Confidence to underlying type, these can ↵Rusty Wagner
cause bugs and also issues with C++20
2025-05-13[CMake] Report compatibility with 3.15 to silence deprecation warningsGlenn Smith
2025-04-14[SharedCache] Expose cache entry name in the APIMason Reed
Allows us to display the user friendly name of the cache entry in the triage view
2025-04-08[SharedCache] Apply demangled names and types more broadlyMason Reed
Fixes the case of stub functions being applied with mangled names.
2025-04-07[SharedCache] Support loading from user plugins directory tooGlenn Smith
Check for the core plugin setting and, if it's disabled, look in the user directory
2025-04-06[SharedCache] Add a named symbol mapMason Reed
Fixes https://github.com/Vector35/binaryninja-api/issues/6561 - Also tightens the SharedCache class to move only, to prevent accidental copies. - Also removes some extra copies in FFI when should pass by ref - Also adds `get_symbol_with_name` to python API The current named symbol map is populated in a worker thread spawned in the view init. This is because populating the map can take about 1 second. If we are fine with another 1 second added to the view init time then we can add it serially but I don't think this way is _that_ bad, no analysis consults this, however a user might add a workflow that would be racing this. So we need to add a mutex.
2025-04-03[SharedCache] Identify unloaded symbols that are called in standard functionsMason Reed
Fixes https://github.com/Vector35/binaryninja-api/issues/6550
2025-04-02[SharedCache] Add python get_symbol_atMason Reed
2025-04-02[SharedCache] Fix some bugsMason Reed
2025-04-02[SharedCache] Refactor Shared CacheMason Reed
In absence of a better name, this commit refactors the shared cache code.
2025-03-28belated copyright year updateJordan Wiens
2025-03-18Documentation and type hints for sharedcache.py, properly import ↵kat
binaryninja.sharedcache automatically
2025-02-17[SharedCache] Remove using namespace statement from headersMason Reed
2025-02-17[SharedCache] Define BackingCacheTypeWeiN76LQh
Split out from https://github.com/WeiN76LQh/binaryninja-api/tree/process-local-symbols
2025-02-17[SharedCache] Split state into initial, loaded, and modifiedMark Rowe
The initial state is initialized during `PerformInitialLoad` and is immutable after that point. This required some slight restructuring of how information about memory regions is tracked as that was previously modified as regions were loaded. Memory regions are now stored in a map from their address range to the `MemoryRegion` object. This makes it cheap to look them up by address which is a common operation. The modified state consists of changes since the last save to the `DSCView` / `ViewSpecificState`. This means it is no longer necessary to copy any state when mutating a `SharedCache` instance for the first time. Instead, its data structures start off empty and are populated as images, sections, or symbol information is loaded. The loaded state consists of all modified state that has since been saved. It lives on the `ViewSpecificState`. Saving modified state merges it into the the existing loaded state. This pattern is carried over to the `Metadata` stored on the `DSCView`. The initial state is stored under its own metadata key, and each modified state is stored under a key with an incrementing number. This means each save of the state only needs to serialize the state that changed, rather than reserializing all of the state all of the time. There are two huge benefits from these changes: 1. At no point does `SharedCache` have to copy its in memory state. The basic copy-on-write approach introduced in #6129 reduced how often these copies are made, but they're still frequent and very expensive. 1. At no point does `SharedCache` have to re-serialize state to JSON that it has already serialized. JSON serialization previously added hundreds of milliseconds to any mutating operation on `SharedCache`. As a result, this speeds up the initial load of the shared cache by around 2x and loading of subsequent images improves by about the same. One trade-off is that the serialization / deserialization logic is more complicated. There are two reasons for this: 1. The state is now split across multiple metadata keys and needs to be merged when it is loaded. 2. The in-memory representation uses pointers to identify memory regions. These relationships have to be re-established after the JSON is deserialized. As a future direction it is worth considering whether the logic owned by `SharedCache` could be split in a similar manner to the data. The initial loading of the cache header, loading of images, and handling of symbol information are all mostly independent and work on separate data. If the logic were split into separate classes it would be easier to reason about which data is valid when, and would easily permit concurrent loading of multiple images from the shared library in a thread-safe manner.
2025-02-13[SharedCache] Use StringRef for performanceGlenn Smith
2025-02-12[SharedCache] Remove designator initializationMason Reed
Fixes MSVC C++17 failing to compile, hopefully.
2025-02-12[SharedCache] Make MetadataSerializable::Load staticMark Rowe
`MetadataSerializable` is updated to allow a subclass to optionally specify the return type of `Load`. If not specified it defaults to the subclass itself. `SharedCache` specifies `std::optional` to represent the case where the serialized metadata is in a format or version it does not recognize. By making `Load` a static member function and having it return a new object it becomes easier to reason about the state of objects when a deserialization failure occurs. It can return `std::optional` to indicate failure and there is no object left in an unknown state. Prior to this, `Load` worked on an existing instance of an object. It was unclear what state the object would be in if a deserialization failure occurred (its original state prior to `Load`? some partially-loaded state? a null state?). The failure itself also had to be communicated out of band.
2025-01-27Port sharedcache view to MemoryRegions, removing the need for the fake Raw ↵kat
view workaround
2024-12-26[SharedCache] Add the ability to manually trigger Objective-C processingWeiN76LQh
A problem with processing Objective-C sections at the time a library is loaded is that some of the references within those sections may refer to unload sections. This results in things like selectors not being correctly typed and named. This commit provides a way for users to manually trigger Objective-C parsing against sections for a specific library or all libraries, via the API. Combined with the previous commit a user can use the API to batch load a number of libraries and skip Objective-C processing for each one and then run it across the entire of the DSC once they are all loaded. Further improvement would be to provide a way to trigger Objective-C processing through the UI.
2024-12-26[SharedCache] Add the ability to skip Objective-C processing when loading a ↵WeiN76LQh
library This is useful when batch loading libraries to avoid extra processing (once the next commit has landed).
2024-12-10[SharedCache] Switch to SAX-based writer API for JSON serializationAuthor: Mark Rowe
2024-12-10[SharedCache] Rework metadata serialization to reduce memory overheadMark Rowe
api/MetadataSerializable.hpp is removed in favor of including core/MetadataSerializable.hpp. Both headers defined types with the same name leading to One Definition Rule violations and surprising behavior. The serialization and deserialization context are now created on-demand during serialization rather than being a member of `MetadataSerializable`. This reduces the size of every serializable object by ~220 bytes. The context is passed explicitly as an argument to `Serialize` / `Deserialize`. As a result, `Serialize` / `Deserialize` can now be free functions rather than member functions. Since `MetadataSerializable` is not used for dynamic dispatch, the virtual methods are removed and the class is updated to be a class template using CRTP. This allows delegating to the derived class's `Load` and `Store` methods without the additional size overhead of the vtable pointer in every serializable object. These changes reduce the memory footprint of Binary Ninja after loading the macOS shared cache and loading a single dylib from it from 8.3GB to 4.6GB.
2024-11-06normalize Shared Cache nameJordan Wiens
2024-11-05[SharedCache] very Hotfix for 'SharedCache.load_image_with_install_name'kat
2024-11-05[SharedCache] Implement LoadedImage API, Fix serialized image names, more ↵kat
robust system for out-of-date databases
2024-10-28[SharedCache] Fix UI causing BV leakskat
2024-10-23Initial commit of the alpha dyld_shared_cache view API Plugin.kat
This is an early release of our DSC processing plugin. We're still hard at work improving this feature. You should be able to just drop in a dyld_shared_cache and use the 'Shared Cache Triage' view to load and analyze images.