summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-02-12[SharedCache] Simplify MMappedFileAccessor::Read* methodsMark Rowe
This change is mostly motivated by simplifying the code, but it also brings minor correctness and performance benefits. 1. The pointer returned by mmap is stored as a uint8_t* rather than void* as that is how it is used. This reduces how often it needs to be cast to a different type before it is used. 2. Read methods for primitives delegate to a new Read template function that in turn delegates to the general-purpose `Read(void* dest, size_t address, size_t length)`. This improves the consistency of bounds checking and simplifies the code. The compiler is more than willing to inline this so we get less repetition with no overhead. 3. ReadNullTermString now uses std::find to find the nul byte and directly constructs the string from that range of bytes. This removes an unnecessary allocation that was previously being forced by the use reserve followed by shrink_to_fit. It also avoids repeated reallocation for longer strings as they grew past the the reserved size as they were being built up a character at a time.
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-02-12bugfix: ARM64: missing break in il.cpp's switchMaxime Meignan
A `break` was missing in the switch, making the LDXRH instruction generate 2 IL instructions
2025-02-12Fix setter in FWN relationships Python APIBrandon Miller
2025-02-11Fix partial initialization of `DisassemblyTextLine`Mason Reed
The usage of `DisassemblyTextLine` in the FFI was unsound, we would forget to initialize some fields causing a myriad of issues where round-tripping through the FFI was losing information.
2025-02-11Fix memory leak when calling `DataRenderer::GetLinesForData` or ↵Mason Reed
`DataRenderer::RenderLinesForData`
2025-02-11Rust API misc formattingMason Reed
2025-02-11Fix FlowGraph::low_level_il crash in Rust APi with no LLIL function objectMason Reed
2025-02-11Do not load user or repo plugins by default when initializing a headless ↵Mason Reed
instance in Rust API
2025-02-11Fix Rust InstructionTextTokenKind not consulting the string token contextMason Reed
This caused a crash if we visited a builtin with a "fake" string. Where the token value is not actually the string type.
2025-02-11Add AsMut impl for Ref in Rust APIMason Reed
2025-02-11Truncate requested section names to 16 bytes when importing DWARF info from ↵Josh Ferrell
a Mach-O
2025-02-11Implement Snapshot::HasData()Glenn Smith
2025-02-11Add SplitTabWidget::setTabSizesGlenn Smith
2025-02-11Add typedef for ProgressFunction and add DefaultProgressFunctionGlenn Smith
2025-02-11Add LowLevelILOperation.LLIL_BOOL_TO_INT. Fix ↵Xusheng
https://github.com/Vector35/binaryninja-api/issues/6408
2025-02-10[mips] Merging PR https://github.com/Vector35/binaryninja-api/pull/6013: ↵Galen Williamson
adding mips3 support
2025-02-10Add API to get remote server build versionJosh Ferrell
2025-02-10Fix item indices getting desynced when moving nested items in project browserJosh Ferrell
2025-02-10[SharedCache] Optimizations regarding stl container usage in SharedCache.cppkat
2025-02-10Fix some issues regarding allocations within the sharedcache plugin FFIkat
2025-02-10[SharedCache] Make `m_exportInfos` map's values a `shared_ptr`WeiN76LQh
This avoids expensive copying when returning a value from the map in `SharedCache::GetExportListForHeader`. Additionally it ensures that the value stays alive and at the same location in memory if `m_exportInfos` is modified and requires its storage to be re-allocated. I was unable to use a `unique_ptr` instead of a `shared_ptr` because of copy semantics with `m_exportInfos` in `ViewStateCacheStore`. I don't see things being any worse using `shared_ptr` instead of `unique_ptr` anyway and it means less code changes.
2025-02-10[SharedCache] Only setup undo actions and bulk modify in ↵WeiN76LQh
`SharedCache::FindSymbolAtAddrAndApplyToAddr` if a symbol is found
2025-02-10[SharedCache] Improve the types for `m_exportInfos`WeiN76LQh
This commit changes 2 things; 1. `m_exportInfos` is now a map where its values are also a map rather than a vector of pairs. The reason for this is that `SharedCache::FindSymbolAtAddrAndApplyToAddr` is a hot path which does by far the most accesses to `m_exportInfos`. In that function it must find the correct symbol for a given address so a map lookup will be much quicker than iterating a vector. The other use cases of `m_exportInfos` would prefer a vector but they are executed very infrequently. 2. The symbols are stored in `m_exportInfos` as references to the `Symbol` type. This makes more sense because otherwise there is a lot of time spent converting to and from a `Symbol` type and a pair of `BNSymbolType` + a `std::string`.
2025-02-10[SharedCache] Add parameter to `SharedCache::InitializeHeader` to check if ↵WeiN76LQh
`m_exportInfos` was modified This probably makes more sense than the current solution of using execution of the callback parameter to determine if `m_exportInfos` was modified.
2025-02-10[SharedCache] Use `m_exportInfos` as an export list cacheWeiN76LQh
`SharedCache::ParseExportTrie` is getting called a lot during DSC library loading and analysis. In large part due to the hot path `SharedCache::FindSymbolAtAddrAndApplyToAddr`. Its unnecessary for it to be being called more than once per DSC header as the export list symbol information is stored in `SharedCache::m_exportInfos`. This commit adds the function `SharedCache::GetExportListForHeader`, which will either return the header's list of symbol information cached in `SharedCache::m_exportInfos` or call `SharedCache::ParseExportTrie` and cache the results in `SharedCache::m_exportInfos`. This should also improve the execution time of `SharedCache::LoadAllSymbolsAndWait`. Further improvement here would be to add locking to `SharedCache::GetExportListForHeader` so that races don't result in redundant parsing of the export trie for the same header if multiple threads call `SharedCache::GetExportListForHeader` at the same time for the same header. This only really matters during initial loading because from what I can tell that parses all the export trie's anyway.
2025-02-07Fix misc Rust example unused varMason Reed
2025-02-07Implement Rust BaseAddressDetectionRubens Brandao
2025-02-07Implement Rust DisassemblyTextRendererRubens Brandao
2025-02-07Implement Rust WebsocketProviderRubens Brandao
2025-02-07Fix incorrect casts in Rust RepositoryPluginMason Reed
Was causing linux arm builds to fail
2025-02-07Add server error to EnterpriseCheckoutError::RefreshExpiredLicenseFailedMason Reed
2025-02-07Move session registration for Rust headless initialization to be immediateMason Reed
This fixes a possible race if another thread can successfully shutdown before the current thread can register its session
2025-02-07Fix Rust LinearDisassemblyLine not freeing properlyMason Reed
2025-02-07Update types Rust test to check for type deletionMason Reed
2025-02-07Fix secrets_provider Rust tests failing for enterprise buildsMason Reed
Try and just initialize once
2025-02-06Update Rust tests to respect image baseMason Reed
2025-02-06Fix BinaryReader and BinaryWriter not respecting image base in Rust APIMason Reed
2025-02-06Fix rust decompile exampleMason Reed
2025-02-06Misc rust API formattingMason Reed
2025-02-06Fix double ref increment for misc Repository C++ APIsMason Reed
Noticed these when reviewing the Rust Repository API
2025-02-06Correctly quote the string in the Debug impl for BnStringMason Reed
2025-02-06Implement Rust RepositoryRubens Brandao
2025-02-06Implement Rust SecretsProviderRubens Brandao
2025-02-06Add ability to query IL functions in FlowGraph for Rust APIMason Reed
2025-02-06Add simple type to view test for Rust APIMason Reed
2025-02-06[mips] Fix decoding of MIPS ds*32 instructions, add lifting for MIPS drotr* ↵Galen Williamson
instructions; clean up some warnings in powerpc/il.cpp
2025-02-06Add After variants for looking up variables at instructionsGlenn Smith
Fixes #6397
2025-02-05fix mis-named type library action in docsJordan Wiens
2025-02-05correct user/auto api differences explanationJordan Wiens