Repository navigation
feat(ghidra): configurable import language and analysis seeds - #1667
Conversation
REA_GHIDRA_LANGUAGE_ID and REA_GHIDRA_COMPILER_SPEC_ID set the import language when the header cannot identify the compiler (for example, Borland C++ PE images). REA_GHIDRA_SEED_FILE seeds functions, code and labels before auto-analysis, for code reached only through computed jumps or data. Both are validated before launch, recorded in the analysis profile and verified in the bridge handshake.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
TL;DR: I tested the new language setting on Linux with Ghidra 12.1.4. It does not change what #1620 reports, since REA still refuses the MIPS32 files before Ghidra starts. On the one file REA opens, the setting works and is recorded, and bad input fails early. I used the eight little-endian MIPS32 files from my #1620 test, with Results
Not run
Thanks, sqmagellan, for the PR. Bad input messages
CommandsEach file ran on its own. I first ran the two boundary files under MCP probe, with a fresh server per case and Test setup
🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊 |
|
The Borland reproduction makes the need for these Ghidra controls clear, @sqmagellan. Thanks for adding language/compiler selection and analysis seeds, and for recording the supplied choices in the analysis profile. Welcome to the project. |
Summary
Ghidra imports always auto-detect the language and use default analysis. That misses Borland C++ PE images (wrong compiler spec) and code reached only through computed jumps or data. No linked issue.
Change and scope
REA_GHIDRA_LANGUAGE_ID/REA_GHIDRA_COMPILER_SPEC_ID: passed as-processor/-cspec; checked against the installation's.ldefs; rejected for DOS imports.REA_GHIDRA_SEED_FILE:address<TAB>function|code|label[<TAB>name]lines applied by a pre-script before auto-analysis.Contract and boundary impact
language_id,compiler_spec_id,language_selectionandanalysis_seeds(digest and counts). The handshake must report the committed language and seed digest, or the session fails closed. Limitations report seed outcome counts.bridge/ghidra/ReaGhidraApplySeeds.java.Evidence and regression coverage
.ldefsadmission, profile digests, launcher arguments, seed parsing/snapshot/tamper, handshake mismatch.borlandcppand 17,183 seeds: 14,961 functions, 1,592 code seeds and 484 labels applied; xrefs to a computed-jump dispatch global went from 0 to 17.Validation performed
npm run check: pass.npx vitest run src/ghidra tests/boundary/providers/ghidra src/config.test.ts: 366 passed.