summaryrefslogtreecommitdiff
path: root/view/sharedcache
AgeCommit message (Collapse)Author
2026-05-27Pull lambdas out into separate functions.Alexander Taylor
Addresses feedback from PR #8188.
2026-05-27Better handling for shared cache files in projects.Alexander Taylor
Closes #6630.
2026-05-27Improve UX when loading shared cache.Alexander Taylor
Closes #8020 and #8021.
2026-05-22Refactor calling conventions to support correct representation of structuresRusty Wagner
2026-05-19Fix leaks due to missing parenting of Qt objectsMark Rowe
2026-04-22Always show the triage view when opening a shared cache or kernel cacheMark Rowe
BinaryViewType gains a HasNoInitialContent function that views can use to suppress layout restoration when opening a file. The layout will still be restored when the view is loaded from a saved database. Fixes https://github.com/Vector35/binaryninja-api/issues/8083.
2026-03-31Prevent a crash whenever readLEB128 is passed a nullptr0cyn
2026-03-30[DSC] Process Objective-C metadata when loading view from .bndbMark Rowe
The processed Objective-C metadata is not saved to the .bdnb. It must be recomputed when the view is loaded. Fixes https://github.com/Vector35/binaryninja-api/issues/8030.
2026-02-24[DSC] Simplify file mapping to fix intermittent unrelocated pointersMark Rowe
The `FileAccessorCache`'s LRU eviction could discard a file's mapped data after slide info had already been applied to it. Future accesses to the file produced a fresh mapping, but failed to reapply the slide info. This could result in pointers not correctly being slid, such as in https://github.com/Vector35/binaryninja-api/issues/7689. The LRU cache existed to stay within OS file descriptor limits, since the old `MappedFile` held its fd open for the lifetime of the mapping. There's no real reason for it to hold the file descriptor open like this. Closing it after `mmap` is sufficient to avoid the file descriptor limits. `MappedFileRegion` replaces the combination of `FileAccessorCache`, `WeakFileAccessor`, and `MappedFileAccessor`. It closes the fd immediately after mmap, so all files can stay mapped without consuming descriptors, making the cache unnecessary. `MappedFileRegion` is owned directly by the `CacheEntry` for its full lifetime. Slide info is applied exactly once to each `MappedFileRegion`.
2026-02-13[DSC] Correctly mark symbols as having local, global, or weak bindingMark Rowe
2026-02-06Add regex and case sensitivity options to FilterEditJosh Ferrell
2026-01-14Allow controlling which address is used for instructions created when ↵Mark Rowe
inlining during analysis Previously the address of the instruction in the function being inlined was used as the new instruction's address when copying it during inlining. Now there is an additional option: use the address of the call instruction that is being replaced as the new instruction's address. This new mode is useful when inlining thunks or stub functions, but care must be taken if using it beyond that. The benefit is that it ensures that when a function contains multiple calls to the same stub function, each inlined copy ends up with distinct addresses. This ensures that call type adjustments and other overrides that are stored on the function and keyed by address can be applied independently to each callsite that was inlined. The trade-off is that if the function being inlined contains non-trivial logic, all of the inlined instructions sharing an address will limit what type of adjustments can be applied to them. The Objective-C and shared cache workflows are updated to take advantage of this new mode when they enable inlining of stub functions. This will make it possible for multiple calls to the same runtime function within a single function to have separate call type adjustments applied in the future.
2026-01-01update copyrights for 2026Jordan Wiens
2025-12-20Fix many of the warnings that show up when compiling with GCC 15.2Mark Rowe
2025-12-08[DSC] Wrap section creation within BeginBulkAddSegments / EndBulkAddSegmentsMark Rowe
This defers rebuilding of the section map until after all sections for an image have been added, rather than having the section map be rebuilt after adding each section.
2025-12-08Introduce an RAII type for managing bulk symbol modificationsMark Rowe
Fixes https://github.com/Vector35/binaryninja-api/issues/7666. Correctly managing the state of bulk symbol modifications via `BeginBulkModifySymbols` / `EndBulkModifySymbols` is error-prone in the face of exceptions and early returns. Leaking a bulk symbol modification can leave the view in a state where no further changes to symbols will be applied. All users of the C++ API are encouraged to move from `BeginBulkModifySymbols` / `EndBulkModifySymbols` to the new `BulkSymbolModification` class.
2025-12-04[DSC] Fix unhandled exception when opening secondary cache file with ↵Mason Reed
unbacked regions Fixes https://github.com/Vector35/binaryninja-api/issues/7724
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-11-25Update to Qt 6.10.1Rusty Wagner
2025-11-04Update FilterEdit and FilterTarget to preserve existing selectionsMark Rowe
The down and enter keys now preserve an existing selection in the associated list or table views, rather than unconditionally selecting or activating the first item.
2025-10-14Fix issue #7247WeiN76LQh
See https://github.com/Vector35/binaryninja-api/issues/7247#issuecomment-3392192797 for details.
2025-10-11Fix demo ifdefsJosh Ferrell
2025-10-07Remove old banners from DSC and KC pluginsMason Reed
Extra noise in the CMake configure step, much of the value from these has been removed after the refactor(s), e.g. metadata version is no longer used
2025-09-25Sort table views in the shared cache / kernel cache triage views by address ↵Mark Rowe
by default The table views previously visually suggested they were being sorted by address, but in practice they were not sorted until the user set an explicit sort order by clicking on a column header.
2025-09-17[DSC] Ignore .a2s files when loading a shared cacheMark Rowe
These files are present alongside iOS 26 shared caches. Explicitly ignoring them avoids an error being logged to the console.
2025-09-17[DSC] Rework handling of .symbols files to be compatible with iOS 15Mark Rowe
In some iOS 15 caches, the .symbols file's mapping has an address of 0. This would cause it to be returned by `SharedCache::GetEntryContaining` and loaded into the view. The .symbols file contains the local symbol tables for images in the shared cache. It is not intended to be mapped into the same address space as the rest of the shared cache. `SharedCache` now tracks the symbols cache entry separately from other entries. A dedicated `VirtualMemory` region is used when accessing the data it contains. This could be a `FileAccessor`, but that would require additional changes within `SharedCacheMachOHeader`. `SharedCacheMachOProcessor` now directly accesses the local symbols cache entry rather than needing to search for it.
2025-09-17[DSC] Support relative direct selectors in older shared cache versionsMark Rowe
Prior to macOS 13 / iOS 16, the base offset to use for relative direct selector references within Objective-C message lists was stored within the `__TEXT,__objc_opt_ro` section of /usr/lib/libobjc.A.dylib.
2025-09-02[SharedCache] Move plugin_rpath calls into BN_INTERNAL_BUILD blocksMark Rowe
These calls set the rpaths used for release builds of the dylibs using a macro that isn't available in the API repository. They are not necessary when building the shared cache plug-in outside of the context of the app.
2025-08-27Rewrite Obj-C workflow in RustMark Rowe
This is functionally equivalent to the previous workflow_objc, with the following changes: 1. It mutates the `core.function.metaAnalysis` workflow rather than registering a new named workflow. The activities now all check for the presence of the Objective-C metadata added by `ObjCProcessor` to determine whether they should do work, rather than relying on `MachoView` to override the function workflow when Objective-C metadata is present. This fixes https://github.com/Vector35/binaryninja-api/issues/6779. 2. The auto-inlining of `objc_msgSend` selector stub functions is performed in a separate activity from the processing of `objc_msgSend` call sites. The selector stub inlining activity is configured so that it does not run in `DSCView` as the shared cache needs different behavior for stub functions more generally that `SharedCacheWorkflow` already provides. 3. The way that types like `id` and `SEL` are referenced is fixed so that they show up as `id` rather than `objc_struct*`. This also replaces the Objective-C portion of the shared cache's workflow, and incorporates several bug fixes that had been applied to it but not the standalone Objective-C workflow.
2025-08-20Deprecate Workflow::Instance in favor of Workflow::Get and Workflow::GetOrCreateMark Rowe
Calls to `Workflow::Instance` that were looking up a built-in workflow name are updated to use `Workflow::Get`. Others use `Workflow::GetOrCreate`.
2025-08-14[Mac] Consistently specify rpaths for plug-insMark Rowe
C++ plug-ins now consistently use the `plugin_rpath` or `ui_plugin_rpath` macros to ensure they have `SKIP_BUILD_RPATH` set when building on Mac (i.e., no `LC_RPATH` is added). Rust plug-ins have their build.rs updated to only specify `-Wl,-rpath` when building for Linux. It is not needed on macOS. On macOS we instead explicitly specify an `@rpath`-relative install name. This doesn't change any behavior, but avoids leaving an absolute path as the library's install name and is consistent with CMake's behavior for C++ plug-ins.
2025-08-13[DSC] Add support for DriverKit shared cachesMark Rowe
2025-08-01Add LogForException APIs to pass stack trace information separate from the ↵Rusty Wagner
message
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-07-28SharedCache: Fix a compile error w/ GCCkat
2025-07-28Improve and migrate to fmt logging functions in Mach-O/KernelCache/SharedCachekat
2025-07-15Added search placeholder for DSCView and KCView.Hongyu Chen
2025-07-10[DSC] Performance improvements and clean-up in SymbolTableViewMark Rowe
Avoid copying the vector of symbols where possible. When no filter string is applied we no longer copy the entire vector symbols by having the symbols used for display be indirected via a pointer. It points either to the unfiltered symbols or the filtered symbols. Some unncessary copies have been removed by using `std::move` where appropriate. Filtering has been updated to avoid `std::vector::reserve` / `std::vector::shrink_to_fit` in favor of letting the filtered vector control its own growth and reuse its buffer. This avoids allocating a ~100MB buffer every time we update the filter only to later reallocate and move the contents into a smaller buffer. Instead the buffer grows via `std::vector`'s usual growth algorithm and it is preserved across filter calls to avoid unnecessarily reallocating it, and only shrink the buffer if it has shrunk significantly vs previous iterations.
2025-07-10[DSC] Use BNAllocStringWithLength when copying strings for the APIMark Rowe
We're copying `std::string` objects that know their length. There's no reason to force a call to `strlen`.
2025-07-10[DSC] Fix GetRegionAt / optimize GetRegionContainingMark Rowe
`GetRegionAt` was really providing the semantics of `GetRegionContaining` due to `m_regions` being an `AddressRangeMap` and using transparent comparators to allow `find` to work with any address in the range. `GetRegionAt` is updated to verify that the start address of the region that was found matches the requested address. `GetRegionContaining` is updated to use `AddressRangeMap::find` rather than doing a linear search over all regions.
2025-07-08Parse sections containing Objective-C constantsMark Rowe
This adds support for the `__objc_arrayobj`, `_objc_dictobj`, `__objc_intobj`, `__objc_floatobj`, `__objc_doubleobj` and `__objc_dateobj` sections that contain Objective-C constants. These are emitted by Apple's versions of Clang for `const` literals, amongst other things.
2025-07-07[ObjC] Fix handling of relative method selectors with MSVCMark Rowe
The order that the operands to `+` are evaluated in is unspecified. Clang happens to evaluate them left to right and gives the expected answer. MSVC picks the opposite order and so the value it computes is off by 4. This was resulting in missing method names when arm64 binaries containing Objective-C are analyzed on Windows.
2025-07-04[SharedCache] Enqueue pointer sweep on image/region loadMason Reed
This is enabled as is, there might need to be some restrictions later on, does not seem to have an unreasonable impact analysis time
2025-06-25Fix cxx20 build issue on Linux.Alexander Taylor
Apparently the compiler on macOS is less strict about this change?
2025-06-25Fix cxx20 compiler warnings.Alexander Taylor
2025-06-25Fix cxx20 compiler errors.Alexander Taylor
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-06-06Objective-C Processor: Remove vestigial code tracking whether view was ↵kat
backed by a database