Skip to content

fix(ghidra): refuse ambiguous universal Mach-O imports - #713

Merged
kaoru0822-kitauji merged 1 commit into
morluto:mainfrom
kaoru0822-kitauji:fix/ghidra-universal-macho-refusal
Oct 6, 2026
Merged

kaoru0822-kitauji merged 1 commit into
morluto:mainfrom
kaoru0822-kitauji:fix/ghidra-universal-macho-refusal

Conversation

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Summary

  • refuse universal Mach-O targets before Ghidra import because the current auto-loader cannot enforce REA's selected slice
  • return the existing typed architecture_unsupported outcome with the selected and available architectures in diagnostics
  • preserve Ghidra support for thin Mach-O targets

Closes #656.

Evidence

Issue #656 records a complete macOS reproduction where REA selects arm64 for a universal Mach-O, but Ghidra imports the x86_64 slice and returns x86-64 instructions, sections, and pseudocode under an arm64 subject/profile. The current launcher passes the original universal file to Ghidra's auto-loader without a slice choice.

A regression against current main first observed inspectTargetSupport returning supported for an x86_64 + arm64 Mach-O. The test now verifies that the production provider-support seam returns a typed refusal with both architectures, while a thin arm64 Mach-O remains supported. This implements the issue's accepted safe outcome without changing artifact identity or silently analyzing a different slice.

Validation

Passed:

  • npx vitest run src/ghidra/GhidraProvider.behavior.test.ts (22 tests)
  • npm exec [email protected] -- tsc --noEmit
  • npm run lint
  • npm run knip
  • npm run metadata:check
  • targeted oxfmt --check for both changed files
  • git diff --check

Materially unverified:

  • Real Ghidra/macOS execution was unavailable because this Linux environment has no configured Ghidra installation.
  • npm run check could not complete because the repository's TypeScript 7 binary panics while resolving /proc/self/exe in this sandbox. Stable TypeScript 5.9 passed; lint, knip, metadata, and targeted formatting were run separately.

@kaoru0822-kitauji
kaoru0822-kitauji force-pushed the fix/ghidra-universal-macho-refusal branch from 1911fbf to 6582b24 Compare October 6, 2026 12:01
@kaoru0822-kitauji
kaoru0822-kitauji merged commit b1b687f into morluto:main Oct 6, 2026
19 checks passed
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
…ersal-macho-refusal

fix(ghidra): refuse ambiguous universal Mach-O imports
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
@morluto morluto added the provider: ghidra Analysis provider / engine: ghidra label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working provider: ghidra Analysis provider / engine: ghidra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Ghidra provider analyzes the x86_64 slice of a universal Mach-O while reporting arm64

2 participants