[PR #1948] feat(ghidra): add bounded PS-X EXE static analysis #4929

Open
opened 2026-10-31 00:56:59 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1948
Author: @Doriandarko
Created: 10/11/2026
Status: 🔄 Open

Base: main ← Head: codex/psx-r3000a


📝 Commits (9)

  • bbf8ffc feat(ghidra): add bounded PS-X EXE static analysis
  • ebde17a fix(ghidra): merge main and harden PS-X artifact admission
  • c99850a fix(ghidra): retain verifier errors during lineage completion
  • 4e39a1a fix(ghidra): seed PS-X frame state and reject short entries
  • 36cb5fb chore: merge captured main into PR #1948
  • 396428d chore: reconcile captured main with PR #1948
  • f022f06 fix(ghidra): preserve PS-X profile and format-specific readback
  • 2211098 Merge branch 'main' into codex/psx-r3000a
  • 9f628e8 Merge branch 'main' into codex/psx-r3000a

📊 Changes

28 files changed (+811 additions, -58 deletions)

View changed files

📝 bridge/ghidra/ReaGhidraBridge.java (+9 -3)
➕ bridge/ghidra/ReaGhidraPreparePsx.java (+66 -0)
📝 docs/ghidra-mips.md (+2 -0)
➕ docs/ghidra-psx.md (+53 -0)
📝 package.json (+2 -0)
➕ scripts/verify-real-ghidra-psx.mjs (+249 -0)
📝 src/application/BinaryTargetResolver.ts (+3 -0)
📝 src/artifacts/inventory/ArtifactGraphConstruction.ts (+2 -0)
📝 src/artifacts/inventory/ArtifactOccurrenceIdentity.test.ts (+9 -0)
📝 src/contracts/toolOutputSchemaPrimitives.ts (+1 -0)
📝 src/domain/analysisSnapshot.ts (+1 -0)
📝 src/domain/artifactGraph.ts (+2 -0)
📝 src/domain/artifactInspection.ts (+1 -1)
📝 src/domain/binaryTarget.ts (+22 -0)
📝 src/domain/binaryTargetTypes.ts (+10 -0)
📝 src/domain/evidence.ts (+1 -0)
➕ src/domain/psxExe.test.ts (+92 -0)
➕ src/domain/psxExe.ts (+97 -0)
📝 src/ghidra/GhidraAnalysisProfile.ts (+21 -0)
📝 src/ghidra/GhidraLauncher.ts (+89 -49)

...and 8 more files

📄 Description

Extracted PlayStation executables currently fail REA's executable detection. This adds a bounded psx-exe static-analysis path through the existing Ghidra CLI/MCP workflows, preserving original-file identity, header declarations, payload addresses, and offsets in Evidence and snapshots.

The loader imports the complete source file, verifies its PS-X header, maps the declared payload after the 2 KiB header, and seeds entry/GP/SP/BSS before analysis. Invalid extents, misaligned/out-of-range entries, RAM alias overlap, and conflicting processor overrides are rejected. The processor profile explicitly records generic little-endian MIPS decoding: it does not claim R3000A execution, GTE, BIOS, overlay, or load-delay emulation.

Validation:

  • Focused domain/provider/boundary suites: 156 passed, one platform-specific test skipped.
  • npm run check:fast, npm run docs:check, and npm run verify:package passed.
  • New source-owned npm run verify:ghidra:psx passed against real Ghidra 12.1.2 / JDK 26 on macOS arm64: CLI and MCP decoding, original byte offsets, Evidence digest, snapshot replay, unchanged source, and verified process cleanup.
  • No commercial game data or binaries are included. Other host/provider combinations and independent native load-image attestation remain unverified.

🔄 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/1948 **Author:** [@Doriandarko](https://github.com/Doriandarko) **Created:** 10/11/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/psx-r3000a` --- ### 📝 Commits (9) - [`bbf8ffc`](https://github.com/morluto/rea/commit/bbf8ffcab63fdf847ce68f383fc63eb81119625e) feat(ghidra): add bounded PS-X EXE static analysis - [`ebde17a`](https://github.com/morluto/rea/commit/ebde17aa1cb31da61abfb89c98fc86d3079cfc49) fix(ghidra): merge main and harden PS-X artifact admission - [`c99850a`](https://github.com/morluto/rea/commit/c99850a65c6371d2958de73c19fb5e500f4093c7) fix(ghidra): retain verifier errors during lineage completion - [`4e39a1a`](https://github.com/morluto/rea/commit/4e39a1a2230b09d68757e14ae88a45d54def5f6f) fix(ghidra): seed PS-X frame state and reject short entries - [`36cb5fb`](https://github.com/morluto/rea/commit/36cb5fb2484beb6dae176947ae0a5cfb286c2765) chore: merge captured main into PR #1948 - [`396428d`](https://github.com/morluto/rea/commit/396428d1eb50d3c8cd79495291fb4abe9841230a) chore: reconcile captured main with PR #1948 - [`f022f06`](https://github.com/morluto/rea/commit/f022f0684314d2b55b2e98854cc2c31f6237063f) fix(ghidra): preserve PS-X profile and format-specific readback - [`2211098`](https://github.com/morluto/rea/commit/22110986d8d5246c7c8a35b1118f9138222918b8) Merge branch 'main' into codex/psx-r3000a - [`9f628e8`](https://github.com/morluto/rea/commit/9f628e875ded3359c76dbf28ed67b0ce90c14d71) Merge branch 'main' into codex/psx-r3000a ### 📊 Changes **28 files changed** (+811 additions, -58 deletions) <details> <summary>View changed files</summary> 📝 `bridge/ghidra/ReaGhidraBridge.java` (+9 -3) ➕ `bridge/ghidra/ReaGhidraPreparePsx.java` (+66 -0) 📝 `docs/ghidra-mips.md` (+2 -0) ➕ `docs/ghidra-psx.md` (+53 -0) 📝 `package.json` (+2 -0) ➕ `scripts/verify-real-ghidra-psx.mjs` (+249 -0) 📝 `src/application/BinaryTargetResolver.ts` (+3 -0) 📝 `src/artifacts/inventory/ArtifactGraphConstruction.ts` (+2 -0) 📝 `src/artifacts/inventory/ArtifactOccurrenceIdentity.test.ts` (+9 -0) 📝 `src/contracts/toolOutputSchemaPrimitives.ts` (+1 -0) 📝 `src/domain/analysisSnapshot.ts` (+1 -0) 📝 `src/domain/artifactGraph.ts` (+2 -0) 📝 `src/domain/artifactInspection.ts` (+1 -1) 📝 `src/domain/binaryTarget.ts` (+22 -0) 📝 `src/domain/binaryTargetTypes.ts` (+10 -0) 📝 `src/domain/evidence.ts` (+1 -0) ➕ `src/domain/psxExe.test.ts` (+92 -0) ➕ `src/domain/psxExe.ts` (+97 -0) 📝 `src/ghidra/GhidraAnalysisProfile.ts` (+21 -0) 📝 `src/ghidra/GhidraLauncher.ts` (+89 -49) _...and 8 more files_ </details> ### 📄 Description Extracted PlayStation executables currently fail REA's executable detection. This adds a bounded `psx-exe` static-analysis path through the existing Ghidra CLI/MCP workflows, preserving original-file identity, header declarations, payload addresses, and offsets in Evidence and snapshots. The loader imports the complete source file, verifies its PS-X header, maps the declared payload after the 2 KiB header, and seeds entry/GP/SP/BSS before analysis. Invalid extents, misaligned/out-of-range entries, RAM alias overlap, and conflicting processor overrides are rejected. The processor profile explicitly records generic little-endian MIPS decoding: it does not claim R3000A execution, GTE, BIOS, overlay, or load-delay emulation. Validation: - Focused domain/provider/boundary suites: 156 passed, one platform-specific test skipped. - `npm run check:fast`, `npm run docs:check`, and `npm run verify:package` passed. - New source-owned `npm run verify:ghidra:psx` passed against real Ghidra 12.1.2 / JDK 26 on macOS arm64: CLI and MCP decoding, original byte offsets, Evidence digest, snapshot replay, unchanged source, and verified process cleanup. - No commercial game data or binaries are included. Other host/provider combinations and independent native load-image attestation remain unverified. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#4929
No description provided.