summaryrefslogtreecommitdiff
path: root/view/macho
AgeCommit message (Collapse)Author
2026-04-21[MachO] Improve library tracking for imported symbolsMark Rowe
2026-03-30This reverts commit 7228ba0b889765bc3474fbd5475870e24efc79ca.Brian Potchik
2026-03-23[MachO] Apply the correct calling convention for objc_retain_xN / ↵Mark Rowe
objc_release_xN The type library for the Objective-C runtime does not apply the custom calling conventions these functions use. Detect these functions when creating symbols for imported functions and apply the custom calling convention to them. Fixes https://github.com/Vector35/binaryninja-api/issues/8031.
2026-03-20Add option to disable dedicated Universal architecture picker and use ↵Brian Potchik
Container Browser Add the ui.files.universal.dedicatedPicker setting, allowing users to choose between the dedicated architecture picker dialog and the standard container browser for opening Universal (fat) Mach-O binaries. Previously the dedicated picker was always used with no way to opt out. Implementing this required restructuring how Universal binaries are handled during file open. The previous approach intercepted Universal binaries during container processing, bypassing the container browser's normal pipeline with dedicated routing logic. This tightly coupled Universal-specific behavior into the container system, prevented the container browser from handling Universal binaries natively, and introduced several bugs around exclusion settings, nested containers, and multi-child container hierarchies. Bug fixes: - The previous implementation always intercepted Universal binaries during container processing with its own routing logic, bypassing the container browser entirely. There was no way for the container browser to handle Universal binaries natively, even when that was the desired behavior. - Universal binaries inside multi-child containers were not detected. The previous implementation only traversed single-child paths in the container hierarchy, silently ignoring Universal binaries that appeared as siblings among multiple children. - Nested containers (e.g., archives) inside Universal slices were not handled. The previous implementation intercepted Universal binaries at the transform routing level before the container browser could perform recursive delayering. When the dedicated picker is disabled, the container browser now processes the full hierarchy including Universal slices and any containers within them. - Reverted incorrect IsInteractive to IsUIEnabled change in UniversalTransform. The previous change conflated headless mode with non-interactive processing. The UI can be enabled while still performing a non-interactive auto-open (e.g., container browser auto-resolving with a preferred architecture). The IsInteractive() flag captures the actual intent and enables the transform to produce only the preferred architecture child for non-interactive sessions, avoiding unnecessary BinaryView construction for all slices.
2026-03-16Refactor where architecture selection is performed for universal binariesMark Rowe
Responsibility for selecting an architecture is moved out of `UniversalTransform` and into a new `ContainerOpenRequest` class. `UniversalTransform` still handles architecture selection in headless operation (for now).
2026-02-27[MachO] Ensure that weak bound symbols are not resolved to their import addressMark Rowe
Fixes https://github.com/Vector35/binaryninja-api/issues/7989. Also corrects an oversight from d92b3684 in handling of library ordinals >= 128.
2026-02-27[MachO] Fix incorrect handling of BIND_SPECIAL_DYLIB_*_LOOKUP in chained fixupsMark Rowe
These lookup modes are negative values that are encoded in the library ordinal, an unsigned field, of an import fixup entry. Incorrect sign extension when converting these ordinals back to signed values led to them being misinterpreted.
2026-02-17Handle Universal binaries through container transform system.Brian Potchik
2026-02-02[MachO] Set segment flags for kernel images based on how XNU initially maps themMark Rowe
This was done for kernel cache in https://github.com/Vector35/binaryninja-api/pull/7519, and is now being extended to Mach-O images that appear to be XNU kernels (that is, they contain `__KLD` segments). This improves the experience when opening kernels from the macOS Kernel Debug Kit.
2026-01-22[Mach-O] Improve how section types are identifiedwanghaiwei
1. A section's `flags` are masked with `SECTION_TYPE` before being compared. This prevents misclassifying a section when its low bits are shared with other section types. 2. `__mod_init_func` and `__init_offsets` are identified by section type flags, rather than by name. There's no documented reason why these were being matched by name. 3. A fallback is added to detect `__got` sections by name. This is necessary as some kext bundles that have their `__got` sections as `S_REGULAR` rather than `S_NON_LAZY_SYMBOL_POINTERS`. This fixes https://github.com/Vector35/binaryninja-api/issues/7891. Thanks to @WHW0x455 for these fixes.
2026-01-22architecturePreference description updateJordan Wiens
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-15[MachO] Fix handling of relocations for self-bound data symbolsMark Rowe
Fixes https://github.com/Vector35/binaryninja-api/issues/7781.
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-11-17Fix some compiler warningsRusty Wagner
2025-11-04[MachO] Set display name of memory regions to match the segment names they ↵Mark Rowe
correspond to
2025-10-22[MachO] Fix GCC buildMark Rowe
Clang, MSVC and GCC all have different opinions about what's permissible with initialization from a braced initializer list.
2025-10-22[MachO] Fix Windows buildMark Rowe
2025-10-22[Mach-O] Refactor fixup chain parsingMark Rowe
The parsing of fix-up chains is moved out of `MachoView` and into its own class. It deals purely in terms of offsets into the Mach-O slice. `MachoView` translates those offsets to mapped addresses when needed. This is primarily aimed at fixing incorrect handling of pointer formats that use offsets where in some cases the relocations would be applied at incorrect addresses due to confusion between file offsets, Mach-O slice offsets, and VM offsets. It incidentally fixes addends from bind operations not being respected. These show up most frequently in C++ RTTI information.
2025-10-02[MachO] Tweak handling of LC_FUNCTION_STARTSMark Rowe
`LC_FUNCTION_STARTS` includes both functions and jump tables. We want to avoid calling `AddFunctionForAnalysis` on jump tables since it can result in a function being created at the jump table's location with a bogus body. We already skip adding functions for entries in `LC_FUNCTION_STARTS` if the lifting of their first few bytes end up including `LLIL_UNDEF`. However, arm64 intentionally lifts `udf` instructions (i.e., opcodes in the Permanently Undefined range) to `LLIL_TRAP` in order to preserve the immediate portion of the instruction. To address this, `MachoView::IsValidFunctionStart` now returns false if the first lifted instruction is `LLIL_TRAP` in addition to when the lifting contains `LLIL_UNDEF`.
2025-09-17[MachO] Populate external links with library imports for files in projectsMark Rowe
A mapping from imported symbol names to libraries is added to metadata. This is used to populate external links for files within projects, following the lead of `PEView`.
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-01Add LogForException APIs to pass stack trace information separate from the ↵Rusty Wagner
message
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-28Improve and migrate to fmt logging functions in Mach-O/KernelCache/SharedCachekat
2025-07-21Fix MachO loading some settings too earlyGlenn Smith
Fixes #7117
2025-07-16Miscellaneous leak fixes in MachoView and ObjCProcessorMark Rowe
2025-07-16Mach-O/KernelCache warning cleanupkat
2025-07-14Revert "Update Objective-C Workflow to use the meta workflow."Brian Potchik
This reverts commit 5bafe5c7bdb0b56037a0b5c573236f9c6367353a.
2025-07-14Update Objective-C Workflow to use the meta workflow.Brian Potchik
2025-07-14[Mach-O] Handling for special library ordinals used in binding informationkat
2025-07-09[MachO] Treat a binary as containing Objective-C metadata if it has __objc_stubsMark Rowe
`__objc_stubs` is not technically Objective-C metadata, but binaries containing Objective-C stubs need the same processing. `MachoView` was previously only enabling the Objective-C workflow if it thinks there is type metadata. The same criteria was used to determine whether to process Objective-C metadata via `MachoObjCProcessor`. This meant binaries with `__objc_stubs` but no Objective-C type metadata were not running the Objective-C workflow, preventing stub functions from being inlined during analysis.
2025-07-08[MachO] Avoid leaking MachoObjCProcessorMark Rowe
This would leak if parsing of CFStrings was enabled while parsing of Objective-C metadata was disabled. It would also leak if exceptions were thrown or early returns were taken in the ~500 lines between where the object was allocated and it was deleted.
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-07KernelCache rewritekat
2025-07-02Added no export trie data detection.Hongyu Chen
2025-06-25Fix cxx20 compiler warnings.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
2025-06-04[MachO] Don't add symbols when processing bind fixupsMark Rowe
The target of the bind opcode has its symbol applied when the dynamic symbol table is parsed. This was previously adding a symbol at the fixed-up address with the name of the symbol being bound. This was resulting in dozens of `_OBJC_CLASS_$_NSObject`, `_OBJC_METACLASS_$_NSObject`, and `__objc_empty_cache` symbols being created: one for each `objc_class` that referenced those symbols.
2025-06-03[MachoView] Add support of __init_offsetsObriv Mostov
2025-05-30Don't query the template simplifier setting while demangling symbolsPeter LaFosse
2025-05-13[CMake] Report compatibility with 3.15 to silence deprecation warningsGlenn Smith
2025-05-13Rework Export Trie parser to avoid recursion, improve error checkingkat
2025-04-28[MachO] Handle chained imports with addendsMark Rowe
They show up in some macOS system executables.
2025-04-14Avoid MH_FILESET in Mach-O view during magic check.Alexander Taylor
2025-04-09More gracefully ignore MH_FILESET in MachOView.Alexander Taylor
This avoids the 3 errors on view initialization for all supported kernel caches that aren't "real".
2025-04-09Revert "Disable MH_FILESET parsing in Mach-O view"Alexander Taylor
This reverts commit 9169a13c818fc7f3b09246360c31e200b01bda23.