Skip to content

fix(ghidra): admit carved MIPS ELF with incomplete section tables - #1629

Merged
N0zoM1z0 merged 2 commits into
mainfrom
fix/mips-carved-section-table-20261010
Oct 10, 2026
Merged

N0zoM1z0 merged 2 commits into
mainfrom
fix/mips-carved-section-table-20261010

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

A carved MIPS ELF with intact program headers and a valid PT_MIPS_ABIFLAGS record was refused before Ghidra because its section table extended past EOF. Read all complete captured section headers, retain their declarations, and report unavailable headers as unknown. Valid program-header ABI declarations can then support the existing MIPS32r2/o32 lane.

Carry the missing-section limitation from target resolution into Ghidra Evidence and profile-bound snapshots. If no ABI record is observed, retain unknown and the existing admission failure. Available duplicate, contradictory, malformed or unreadable ABI records and damaged program tables remain errors; extended numbering and unspecified ABI admission are outside this change.

The optional real-Ghidra lane now carves both endian fixtures after independently checking that every program-header payload remains captured. Public CLI/MCP decompilation, actual loaded language/digests, Evidence/snapshot limitations, source-byte preservation and verified process cleanup cover the recovered artifacts. The lane passes caller-selected Ghidra heap controls to its child workflows.

Shared filesystem fixture helpers also remove repeated MIPS setup and ASAR cleanup assertions that pushed the integrated branch over the existing duplication gate. All failure injection, retained-handle checks and retry scenarios remain covered; the CI threshold is unchanged.

Fixes #1619.

Validation:

  • Source-owned Clang/LLD fixture reproduced the original rejection. Six LE/BE whole/partial-table filesystem regressions failed before the fix.
  • npm run test:focused -- tests/boundary/filesystem/mipsAbiFlags.test.ts src/ghidra/GhidraProvider.behavior.test.ts tests/boundary/filesystem/asarStreamingAllocation.test.ts — 86 passed, including conflicting/duplicate/unreadable records in partial tables and missing declarations remaining unknown.
  • Real Ghidra 12.1.4, JDK 21, Clang/LLD 14.0.6 and GNU readelf: complete and carved LE/BE ELF workflows passed through public CLI/stdio MCP; loaded MIPS:LE:32:default / MIPS:BE:32:default; final owned process lineage verified empty. Java heap capped at 512 MiB and runs serialized on one CPU.
  • npm run check:ci — all eight tasks and architecture guards passed; npm run docs:check passed. Focused tests (86), the unchanged duplication gate, static checks and architecture guards passed after the fixture cleanup; documentation checks also passed.

Linux x64. Real-provider verification passed under pinned Node 24.18.0 on c7003e0; the subsequent test-only cleanup leaves all six runtime/verifier source digests unchanged. No target code execution, native macOS/Windows verification or real Hopper/IDA testing. No new tool or ISA/ABI lane.

@N0zoM1z0 N0zoM1z0 added bug Something isn't working area: providers Provider and capability discovery, including provider proposal triage area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 10, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@N0zoM1z0 N0zoM1z0 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer self-review at b17fbe3: captured section declarations remain checked; unavailable headers remain explicit unknowns, and missing ABI data is still refused. Public CLI/MCP and snapshot evidence passed with real Ghidra for both endian fixtures. The follow-up only shares test fixtures/assertions: 86 focused tests and the unchanged static/duplication gate pass. Real-provider runtime/verifier digests match the tested c7003e0 revision. Native macOS/Windows and live Hopper/IDA were not verified.

@N0zoM1z0
N0zoM1z0 merged commit d6f698d into main Oct 10, 2026
19 checks passed
@N0zoM1z0
N0zoM1z0 deleted the fix/mips-carved-section-table-20261010 branch October 10, 2026 20:33
@CassieFox23

Copy link
Copy Markdown
Contributor

TL;DR: The carved MIPS ELF check passes on Linux with Ghidra. Nothing new turned up.

I ran the optional MIPS check on main at 0f605bca9 (#1602), which includes d6f698d (#1629). Both byte orders passed. Each carved copy lost its section table but kept every program header. Ghidra loaded MIPS:LE:32:default and MIPS:BE:32:default. REA reported that it examined 0 of 24 section headers. The check ended with the process lineage verified and no leftover processes.

Results

Check Result
Focused tests (3 files from the PR) 87 passed. The PR text says 86
npm run verify:ghidra:mips passed, exit 0, about 80 seconds
GNU readelf 2.46.1 against REA's own reading matched for both byte orders

Not run

  • macOS and Windows.
  • Hopper and IDA.
  • The full CI gate. I ran the focused tests only.

Thanks, N0zoM1z0, for the fix, and bqw371 for the report in #1619.

Test setup

🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊

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 area: providers Provider and capability discovery, including provider proposal triage 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] MIPS ELF whose section header table lies past EOF is refused although PT_MIPS_ABIFLAGS is present

3 participants