[PR #6240] [MERGED] feat(ghidra): analyze GameCube/Wii DOL executables through Ghidra #7218

Closed
opened 2026-11-01 21:46:14 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6240
Author: @arielfikru
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @gensokyo-dev

Base: main ← Head: feat/ghidra-dol-header


📝 Commits (10+)

  • f9beb68 feat(domain): parse and validate GameCube/Wii DOL headers
  • 70ac99e feat(binary): admit caller-selected GameCube/Wii DOL targets
  • 4639d20 feat(ghidra): import GameCube/Wii DOL targets through a section-map pre-script
  • e8aeedb test(ghidra): cover DOL launcher arguments, attestation and raw profile digests
  • 52102c7 test(ghidra): add the real verify:ghidra:dol lane and DOL docs
  • 64794a4 fix(ghidra): read only the DOL header and section ranges instead of the whole file
  • f84cd0d test(ghidra): derive DOL lane addresses from readelf and admit Gekko from the install catalog
  • 13192a7 fix(ghidra): attest DOL block permissions, space, overlay and load state
  • a94001f fix(ghidra): keep load-image permissions optional for older inspections
  • 4dbad83 fix(contracts): accept DOL targets in binary_session output

📊 Changes

71 files changed (+4682 additions, -116 deletions)

View changed files

📝 bridge/ghidra/ReaGhidraBridge.java (+3 -0)
➕ bridge/ghidra/ReaGhidraPrepareDol.java (+193 -0)
📝 docs/.vitepress/config.ts (+1 -0)
📝 docs/cli.md (+1 -1)
➕ docs/ghidra-dol.md (+129 -0)
📝 docs/ghidra-ppc.md (+2 -1)
📝 docs/index.md (+1 -1)
📝 docs/raw-binary.md (+3 -0)
📝 docs/testing.md (+11 -10)
➕ docs/verification/ghidra-dol-2026-10-24.md (+261 -0)
📝 package.json (+2 -0)
📝 scripts/verify-packaged-ghidra-windows.mjs (+1 -0)
➕ scripts/verify-real-ghidra-dol.mjs (+323 -0)
📝 src/application/BinaryTargetResolver.ts (+71 -0)
📝 src/application/binary/BinaryTargetSummary.ts (+3 -1)
📝 src/cli/coreBinaryCommands.ts (+2 -1)
📝 src/cli/options.ts (+3 -3)
➕ src/contracts/gamecubeDolContracts.test.ts (+81 -0)
📝 src/contracts/sessionLifecycleInputs.ts (+3 -3)
📝 src/contracts/toolOutputSchemaGroups.ts (+25 -14)

...and 51 more files

📄 Description

Behavior

Import explicitly selected gamecube-dol images through existing POSIX Ghidra, with header-owned text/data/BSS ranges and attestation of imported bytes, permissions and address spaces. Cached MEM1 only; Wii MEM2, uncached aliases, REL/RPX, r2/r13 recovery and target execution are outside scope. Hopper/IDA/Windows decline this format. Refs #1741; this does not complete the broader console-analysis request.

Native procedure search/list contracts share the domain row schema and preserve symbol provenance through complete, summary and retained-page delivery. The import fixes preserve real inventory symbol provenance, request complete verifier delivery, reuse cleanup owners, derive BSS once, apply a counted/bounded private v2 plan and preserve qualified foreign-space observations. Main's newer package/process ownership is retained; its Windows verifier gains only the DOL collision fixture.

Verification

  • Real Linux Ghidra 12.1.4/JDK 21 public CLI/MCP stock-PowerPC passes before/after the feature refactor and again on the final combined source. Independent readelf/header, mapping/BSS, entry/callee, decompilation/bytes and final empty lineage pass. Gekko is unavailable and skipped; no new real Windows/Hopper/IDA or commercial-console claim.
  • Final combined snapshot: 1,062 passing checks / 4 platform skips across IPS, Android, IL2CPP, DOL and main's changed process/package owners. Cached build passes. check:fast reproduces only main's release-test includeFiles type error; this is a recorded failure. Standalone lint, full formatting and documentation pass. Earlier pinned feature-source check:fast and all 326 DOL checks pass (3 Windows skips).
  • Six actual SDK query tasks preserve requested facts/input digests. Whole-task token estimates, elapsed/CPU/family-memory costs, cache scope and unverified coverage are in the report. No general performance gain is claimed. Earlier contributor macOS/commercial-image evidence was not rerun here.

The final public-search correction passes 42 targeted checks and a real SDK matching-search task. The old schema fails with the captured symbol-bearing row. The real task records an initial Java-readiness cleanup failure and a successful fresh-session retry; both attempts, catalogs and calls are included in the report. Earlier 1,062-check combined validation keeps its stated source pin.

Author readiness

Human owner: @arielfikru

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6240 **Author:** [@arielfikru](https://github.com/arielfikru) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `feat/ghidra-dol-header` --- ### 📝 Commits (10+) - [`f9beb68`](https://github.com/morluto/rea/commit/f9beb685608ee85b009e8a938338381bd16e3134) feat(domain): parse and validate GameCube/Wii DOL headers - [`70ac99e`](https://github.com/morluto/rea/commit/70ac99ec3dfeace6a7dd233fe7f7a63dbb28051f) feat(binary): admit caller-selected GameCube/Wii DOL targets - [`4639d20`](https://github.com/morluto/rea/commit/4639d208e92ac3eb41d46df3b23b49cb6fe0afb0) feat(ghidra): import GameCube/Wii DOL targets through a section-map pre-script - [`e8aeedb`](https://github.com/morluto/rea/commit/e8aeedb2d168b65298996eb3039fda66f83dae8d) test(ghidra): cover DOL launcher arguments, attestation and raw profile digests - [`52102c7`](https://github.com/morluto/rea/commit/52102c78f85aae324db34403dabe0a128c1bdf2e) test(ghidra): add the real verify:ghidra:dol lane and DOL docs - [`64794a4`](https://github.com/morluto/rea/commit/64794a4f19830c0e7149bac67d8c0eb6f7a25b59) fix(ghidra): read only the DOL header and section ranges instead of the whole file - [`f84cd0d`](https://github.com/morluto/rea/commit/f84cd0d6661f71a3cb9351ef29cc10cb70ed311e) test(ghidra): derive DOL lane addresses from readelf and admit Gekko from the install catalog - [`13192a7`](https://github.com/morluto/rea/commit/13192a7a624ba33fa5d8d063cc3f1b2c5b5d6c10) fix(ghidra): attest DOL block permissions, space, overlay and load state - [`a94001f`](https://github.com/morluto/rea/commit/a94001fbbeb3af9cf117880d56e16f5841d4f35a) fix(ghidra): keep load-image permissions optional for older inspections - [`4dbad83`](https://github.com/morluto/rea/commit/4dbad83f3572ea7a9367c5f8753c7c4cf399ccfa) fix(contracts): accept DOL targets in binary_session output ### 📊 Changes **71 files changed** (+4682 additions, -116 deletions) <details> <summary>View changed files</summary> 📝 `bridge/ghidra/ReaGhidraBridge.java` (+3 -0) ➕ `bridge/ghidra/ReaGhidraPrepareDol.java` (+193 -0) 📝 `docs/.vitepress/config.ts` (+1 -0) 📝 `docs/cli.md` (+1 -1) ➕ `docs/ghidra-dol.md` (+129 -0) 📝 `docs/ghidra-ppc.md` (+2 -1) 📝 `docs/index.md` (+1 -1) 📝 `docs/raw-binary.md` (+3 -0) 📝 `docs/testing.md` (+11 -10) ➕ `docs/verification/ghidra-dol-2026-10-24.md` (+261 -0) 📝 `package.json` (+2 -0) 📝 `scripts/verify-packaged-ghidra-windows.mjs` (+1 -0) ➕ `scripts/verify-real-ghidra-dol.mjs` (+323 -0) 📝 `src/application/BinaryTargetResolver.ts` (+71 -0) 📝 `src/application/binary/BinaryTargetSummary.ts` (+3 -1) 📝 `src/cli/coreBinaryCommands.ts` (+2 -1) 📝 `src/cli/options.ts` (+3 -3) ➕ `src/contracts/gamecubeDolContracts.test.ts` (+81 -0) 📝 `src/contracts/sessionLifecycleInputs.ts` (+3 -3) 📝 `src/contracts/toolOutputSchemaGroups.ts` (+25 -14) _...and 51 more files_ </details> ### 📄 Description ## Behavior Import explicitly selected `gamecube-dol` images through existing POSIX Ghidra, with header-owned text/data/BSS ranges and attestation of imported bytes, permissions and address spaces. Cached MEM1 only; Wii MEM2, uncached aliases, REL/RPX, r2/r13 recovery and target execution are outside scope. Hopper/IDA/Windows decline this format. Refs #1741; this does not complete the broader console-analysis request. Native procedure search/list contracts share the domain row schema and preserve symbol provenance through complete, summary and retained-page delivery. The import fixes preserve real inventory symbol provenance, request complete verifier delivery, reuse cleanup owners, derive BSS once, apply a counted/bounded private v2 plan and preserve qualified foreign-space observations. Main's newer package/process ownership is retained; its Windows verifier gains only the DOL collision fixture. ## Verification - Real Linux Ghidra 12.1.4/JDK 21 public CLI/MCP stock-PowerPC passes before/after the feature refactor and again on the final combined source. Independent readelf/header, mapping/BSS, entry/callee, decompilation/bytes and final empty lineage pass. Gekko is unavailable and skipped; no new real Windows/Hopper/IDA or commercial-console claim. - Final combined snapshot: 1,062 passing checks / 4 platform skips across IPS, Android, IL2CPP, DOL and main's changed process/package owners. Cached build passes. check:fast reproduces only main's release-test `includeFiles` type error; this is a recorded failure. Standalone lint, full formatting and documentation pass. Earlier pinned feature-source check:fast and all 326 DOL checks pass (3 Windows skips). - Six actual SDK query tasks preserve requested facts/input digests. Whole-task token estimates, elapsed/CPU/family-memory costs, cache scope and unverified coverage are in [the report](docs/verification/ghidra-dol-2026-10-24.md). No general performance gain is claimed. Earlier contributor macOS/commercial-image evidence was not rerun here. The final public-search correction passes 42 targeted checks and a real SDK matching-search task. The old schema fails with the captured symbol-bearing row. The real task records an initial Java-readiness cleanup failure and a successful fresh-session retry; both attempts, catalogs and calls are included in the report. Earlier 1,062-check combined validation keeps its stated source pin. ## Author readiness Human owner: @arielfikru - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:46:14 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7218
No description provided.