summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/SharedCacheView.cpp
AgeCommit message (Collapse)Author
2025-12-20Fix many of the warnings that show up when compiling with GCC 15.2Mark Rowe
2025-11-26[DSC] Place synthetic sections after the cache's address rangeMark Rowe
This ensures they do not overlap with any images that may later be loaded from the shared cache.
2025-10-14Fix issue #7247WeiN76LQh
See https://github.com/Vector35/binaryninja-api/issues/7247#issuecomment-3392192797 for details.
2025-08-13[DSC] Add support for DriverKit shared cachesMark Rowe
2025-07-28Improve and migrate to fmt logging functions in Mach-O/KernelCache/SharedCachekat
2025-05-30Misc shared cache improvementsMason Reed
- Removed last use of user object creation in objective-c - Fixed function type info being omitted from certain images loaded automatically - Add TODO about undo action in view init. This is not critical, just a non-actionable warning because of a design flaw I will restate this again for anyone in the future, until the undo action system is thread-safe avoid calling it from any thread other than the main thread, it is very easy to deadlock or cause other issues. That goes for basically all user analysis object creation.
2025-05-06[SharedCache] Add activities to core.function.metaAnalysis rather than a new ↵Mark Rowe
named workflow Activities are registered with a `viewType` predicate to ensure they only run in shared cache views. Adding activities to `core.function.metaAnalysis` lets activities registered by plug-ins run in the shared cache without the plug-ins having to be aware of the shared cache. Work towards #6779.
2025-05-03[SharedCache] Avoid reading header fields outside of the bounds of the headerDaniel Roethlisberger
Use mappingOffset as an upper bound for the header size, and avoid reading any header fields from beyond that offset. Co-authored-by: Mason Reed <mason@vector35.com>
2025-04-28[SharedCache] Support loading iOS shared caches older than 11Mason Reed
Still need to fix branch island images not being picked up
2025-04-14[SharedCache] Evict file accessors from the global file accessor cache on ↵Mason Reed
file metadata destruction Previously we would just let them continue to exist after view destruction, this is fine assuming we expect the user to be re-opening the same cache over and over, but if a user wants to load a bunch of different caches they might want to evict the old file accessors so that COW pages are known to be evicted, along with other paged in memory.
2025-04-14[SharedCache] Fix overzealous alert about missing shared cache entriesMason Reed
Following the conversation in https://github.com/Vector35/binaryninja-api/issues/6631 we are going to make the edited alerts warnings and then also fix the warning showing on certain shared caches even when all entries are present.
2025-04-14[SharedCache] Allow project databases to be stored in a separate folderMason Reed
However the primary file will need to be selected each time you open, for that to be resolved we need to use project file UUID's or the cache entry UUID's themselves to traverse all project files
2025-04-14[SharedCache] Improve the gathering of cache entries in view initMason Reed
This commit addresses some of the issues regarding the retrieval of cache entries during view init, we now will try and store information in the database about the given shared cache entries so that we can better alert the user to possible issues during the loading of saved shared cache databases. We also simplified the logic so that the flow for retrieving the primary file cache is easier and users should be prompted when necessary to select the primary cache file if we cannot. More errors will also be shown to provide the users with more information about the shared cache and what issues they might have. For example we will now try and warn the users when they are opening a shared cache with less entries than what the shared cache reports having. We will also warn the users when opening a database if a previous secondary cache file is no longer available. In the future we can also utilize the shared cache UUID's for individual files to do a more aggressive search across directories in a project. This will make the file name lookup stuff potentially unnecessary, at least when opening a database with all file UUID's stored.
2025-04-14[SharedCache] Misc cleanupMason Reed
- Make `SharedCache::m_entries` a simple std::vector we never lookup based off the entry ID - Remove some old comments - Rename some old variables so that they are accurate - Fix compiler warnings - Remove some unneeded copying
2025-04-10[SharedCache] Fix building on some toolchainsMason Reed
Implicit std::filesystem::path conversion oops
2025-04-10[SharedCache] Make the shared cache file lookup more straightforwardMason Reed
We already had separated this part out into the `CacheProcessor` but its more like a builder than anything, so this refactors that out into a `SharedCacheBuilder`. - Separate out the `CacheProcessor` and simplify its implementation - Move more implementation specific stuff to the shared cache view - Prepare for more validation of the shared cache to detect irregular or incomplete shared cache information - Deduplicate a lot of file vs. project file lookup stuff - Stop copying all images when getting the number of images to log - Allow user to select another directory to scan for shared cache files, might make this a warning instead to prevent users from relying on this behavior We will likely follow this commit up soon with better open behavior, maybe open with options can specify a list of cache entry files? Shouldn't be too much effort aside from making the UI modal for that.
2025-04-08[SharedCache] Fix older BNDBs not updating workflow to use new workflow nameMason Reed
2025-04-07[SharedCache] Respect workflow override on shared cache databasesMason Reed
Fixes: https://github.com/Vector35/binaryninja-api/issues/6571
2025-04-07[SharedCache] Don't process shared cache when view is not file backedMason Reed
This fixes a case where the remote file is downloaded and the shared cache view is selected, we _only_ work for file backed views, as our shared cache specific file accessors work on those. So this is not a loss in functionality. In the future if we wanted to load shared caches without touching disk (yikes) than we would need to remove this restriction, or provide a way in the API for user to process their own cache entries (after view init).
2025-04-07[SharedCache] Allow the user to select the original shared cache file on diskMason Reed
This gives the user the ability to take a database with no original file path continue processing entries with the user supplied base file. This also will set the original file path for future loads, we might want to make that optional. And the behavior with remote projects for that might be undesired.
2025-04-06[SharedCache] Replace write log with callback registration for reapplying ↵Mason Reed
slide info This improves performance by ~10x with the only real issue being a copy of the cache entry existing for each weak ref. Also fixes - Some old TODO's that are no longer relevant - Some function signatures not being const - FileAccessorCache not evicting enough accessors to fit under an adjusted cache size - Added a warning if we are over the global cache size in view initialization - Logger name not having a `.` in `SlideInfoProcessor::SlideInfoProcessor` - Re-added the accessor dirty check before applying slide info to fix https://github.com/Vector35/binaryninja-api/issues/6570
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] Log the time it takes to load initial images in the viewMason Reed
2025-04-02[SharedCache] Misc formattingMason Reed
2025-04-02[SharedCache] Consistent logger naming and misc changesMason 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.