Repository navigation
feat(ghidra): apply validated analyzer overrides before analysis - #1913
Conversation
…ALYZERS Default auto-analysis can stall in a single analyzer, such as ObjcMessageAnalyzer on a Swift/Objective-C arm64 Mach-O, and a caller had no way around it: the headless launcher passed -preScript only for DOS COM preparation and seed files, and the analysis profile always recorded analyzer_preset "ghidra-default" (#1783). REA_GHIDRA_DISABLED_ANALYZERS now names comma-separated Ghidra auto-analyzers that a pre-analysis script disables before default auto-analysis, following the same packaged pre-script precedent. The analysis profile records the override in analyzer_preset and analysis_options, and a session refuses to open when its committed profile and the setting differ, so snapshots and Evidence stay bound to the analysis that actually ran. Validation: new tests for the setting parser, launcher argv injection and ordering, and profile recording plus fail-closed profile binding; existing launcher, DOS COM, seeds, language-override, and Ghidra MCP evidence coverage rerun green (314 src/ghidra module tests, 54 ghidra boundary tests, check:fast, verify:test-discovery, generated-file checks). Real Ghidra was not exercised: this machine has no Ghidra installation; the stall reproduction and the disable-one-analyzer control come from the issue report's out-of-repo analyzeHeadless runs on Ghidra 12.1.4.
…ndows verifier The caller-cwd shadowing verifier enumerated exactly the bridge scripts the launcher passes as arguments, but missed the new ReaGhidraAnalysisOptions.java preScript, leaving the new script outside the shadowing coverage and the caller-cwd preservation assertion. Sorting the list is required, not cosmetic: the assertion compares readdir(callerDirectory).sort() against it, so the pre-sort order introduced in 162f9bf and af88184 could never match on any platform (reproduced with a local readdir+sort probe; the lane itself requires a Windows x64 host and was not run here). Also documents the 120-character single-name limit next to the 32-name cap in the installation guide.
Preserve the contributor implementation and both Hopper and Ghidra startup settings after the shared timeout parser rename. Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Check exact analyzer registration and read back disabled options. Use HeadlessScript so an unknown or ineffective override aborts before auto-analysis and bridge startup instead of leaving a misleading successful profile. Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Reuse the owned headless seed-regression lane to read back a disabled option and ensure a mixed known/unknown name list aborts before the post-script. Preserve seed controls and retry ownership when process cleanup fails. Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Pin main 23d50ea for analyzer override verification. Preserve both packaged COM/raw script collision controls alongside the options script. Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Commit analyzer overrides for both raw and header-based imports. Select registered gcc compiler specs for raw x86/x86_64 and validate actual mappings, byte readback and decompilation in the existing real-provider verifier. Refs: #1836, #1783 Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Reuse the independently merged tool wording audit and corrected managed fixture contract for the Ghidra adoption integration. Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0fda68872
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .refine( | ||
| (names) => names.every((name) => ghidraAnalyzerNamePattern.test(name)), | ||
| "must be Ghidra analyzer names starting with a letter or digit and containing only letters, digits, spaces, periods, underscores, and hyphens", |
There was a problem hiding this comment.
Allow valid analyzer-name characters
When an installed Ghidra analyzer has an exact registered name containing +, parentheses, a colon, or non-ASCII text, parseConfig rejects REA_GHIDRA_DISABLED_ANALYZERS before Ghidra can validate the name. These characters are valid in Ghidra analyzer names, and several are already safe in both direct argv and quoteWindowsBatchToken; the restrictive ASCII allowlist therefore prevents disabling otherwise valid built-in or extension analyzers. Reject only characters required by the comma encoding or launcher protocol rather than this narrower set.
AGENTS.md reference: AGENTS.md:L42-L42
Useful? React with 👍 / 👎.
Configured Ghidra analyzer opt-outs now apply before analysis and bind to the same provider profile. This adopts @akushonkamen’s implementation from #1800 with validated corrections. Every requested registered name is checked before any option changes; disabled values are read back, and rejection aborts headless analysis before bridge readiness. Raw and header-based imports share this commitment.
A real six-byte raw repro also exposed unsupported x86 compiler specs. x86/x86_64 now use supported
gccspecs consistently in profile, launch and independent load-image verification. These specs select analysis conventions; they do not identify the original compiler or ABI. Existing real seed/raw verifiers cover analyzer readback, mixed known/unknown-name rejection, byte controls and lifecycle behavior.Validation:
9878bb72and six focused files passed: 93 tests, one platform-specific skip. No new full local typecheck is claimed.e0fda688.9878bb72: 16 public MCP checks on a 1,536-byte PE passed withWindowsResourceReference, return 42, call edge, mapped bytes, failed-query recovery, P0 mutation denial and unchanged target bytes. Repeated open retained the run ID and actual native observation showed no analysis JVM before the first query. The analysis JVM’s override preScript, requested name and-Xmx256Mwere observed. Close, closed-session status, ping, empty private TEMP and native Job settlement all passed (exit 0, zero active processes).e0fda688: publicexecution_failure, ping, close, closed-session status, unchanged target and empty TEMP passed before bridge readiness.Scope: Windows raw remains unsupported. Windows workflows used a private 280-second SDK first-query budget; default-deadline success and the reported Objective-C Mach-O performance remain unverified. These runs do not establish a timing improvement. The native run stayed within its 1.75 GiB Job commit limit. Original contributor commits are retained in the PR branch; GitHub recognizes the original contributor and maintenance coauthors in the merged commit.
Refs #1783, #1836. Follow-up to #1800 and #1868.