Skip to content

feat(ghidra): admit bounded PSP ELF through installed Allegrex - #1599

Merged
morluto merged 12 commits into
morluto:mainfrom
jaelliot:feat/psp-allegrex-ghidra
Oct 11, 2026
Merged

morluto merged 12 commits into
morluto:mainfrom
jaelliot:feat/psp-allegrex-ghidra

Conversation

@jaelliot

@jaelliot jaelliot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Upstream integration update (2026-10-11): The PSP contribution was reconciled with upstream commit 0ecf3f2438ec96a6b543942869808018e8d84452 using merge commit 8607d4d64b4729cc0c5268e862adecabbda1dd8c, then focused language-override regression formatting commits. Current PR head: 7f011dc16c446f42e47a841bcf4146debc1588f1. The current upstream CI run 38111212306 passed all 31 jobs, including test shards, static checks, package and coverage checks. GitHub currently reports mergeable/clean; the maintainer merge decision is unchanged. The existing real-Ghidra PSP verification 38091449625 is an earlier exact-source checkpoint on 4bfcf81, not fresh real-provider validation of 7f011dc. The current head preserves the PSP profile and upstream language override/analysis-seed paths; another targeted real-provider run is appropriate before claiming that integration fully revalidated.

Scope

Follow-on to merged #1362, relating to #1330: analyze a bounded class of PSP ELF executables through REA's existing Ghidra CLI/MCP workflow using a caller-installed Allegrex extension. Ready for maintainer review; unmerged. Both the focused real-Ghidra verification and the ordinary upstream CI run have passed for the contribution head.

  • Contribution head: 4bfcf81d757473b6edea66779a7b732e041d5356.
  • Upstream revision incorporated and tested in the focused real-provider run: 926c2d6ba7975522d63a8dbb0d448f5b9d1514d4.
  • Integration preserves the previously verified PSP checkpoint 8e1d69b; no published history was rewritten.

Support boundary

Concern Initial scope
Host Linux x64
Target Little-endian ELF32 ET_EXEC, EM_MIPS, e_flags=0x10a23001
ABI record Version 0, ISA 2/revision 0; gprSize=1, cpr1Size=1, cpr2Size=0, fpAbi=2; no ISA extension/ASEs; flags1=1, flags2=0
Installation Compatible caller-installed ghidra-allegrex in the selected Ghidra distribution; verified pairing Ghidra 12.1.3 / extension v21.4 / JDK 21
Analysis Existing inventory, instruction/data, function, Evidence and snapshot operations

Missing or different declarations remain unsupported, not inferred. This is a separate PSP profile; it does not relax generic MIPS32r2/o32 admission. See the PSP guide at this checkpoint for prerequisites and limitations.

Implementation

Reuse target parsing, provider lifecycle and public contracts. Select PspElfLoader, Allegrex:LE:32:default, and compiler default; verify the observed language/compiler before serving results. Validate extension metadata and required files, bind installed content to the analysis profile, and recheck that identity before launch. Missing or incompatible prerequisites produce actionable errors without silent fallback.

Evidence retains target/profile identity and the extension's known VFPU limitations. No new provider, MCP catalog, processor implementation, runtime dependency, automatic installer, proprietary fixture or commercial engine is added. Allegrex semantics stay in the upstream Ghidra extension.

Verified integration checkpoint

Verification run 38091449625, job 114328551589, completed successfully. Its artifact records source and final source as 4bfcf81d757473b6edea66779a7b732e041d5356, with clean Git status. The orchestration commit 81890208c02f4e53394e897cdad4a4ca2616bc3a is not the tested application source.

Gate Actual result
Locked install and build PASS; Node 24.18.0 / npm 11.16.0
Existing check:ci PASS: all eight tasks and architecture guards; lint warnings remain
Actual focused Vitest 233 passed, 0 failed, 3 skipped; 15 suites passed
Documentation / discovery PASS; all 791 test files discovered exactly once
Missing extension through public CLI/MCP PASS; CLI exit 1 and actionable PSP_EXTENSION_UNAVAILABLE
Real PSP public CLI/MCP PASS: observed Allegrex language, known functions/calls, instruction/data facts and Evidence/snapshot binding
PSP A → B → A PASS, including rejecting the wrong target/snapshot pairing
Generic LE and BE MIPS PASS, including the upstream section-truncated carved-firmware cases; neither selects Allegrex
Source preservation and cleanup PASS; no owned descendants remain in the three verifier reports

Tool archives were checksum-verified: Ghidra 12.1.3, Allegrex v21.4, PSPDEV v20261001. Targets were compiled and statically analyzed, not executed. The compact artifact is psp-upstream-integration-926c2d6 (SHA-256 85a4eda8c1bc1ae472fd9d55fe272f635b506367b138afc7db4004ada797a5a8).

The focused suites include PSP/MIPS regressions and the cleanup/setup areas implicated in the previous integration failures. These are existing tests, not 233 newly added cases. Discovery is not execution of the full suite. No required check is waived by the focused run.

Ordinary upstream CI

Upstream CI run 38092014434, attempt 1, completed successfully on October 10 at 22:51:53 UTC, associated with contribution head 4bfcf81d757473b6edea66779a7b732e041d5356. All 19 jobs completed successfully, including all four test shards, coverage/timing aggregation, static checks, documentation generation, source-built conformance fixtures, reconstruction readiness, real Apple artifact CLI/MCP E2E, the Windows capability/package lane, and Linux/macOS x64/arm64 package baselines.

This ordinary PR-integration run is separate from the exact-source real-Ghidra verification above. Passing platform package checks does not extend the PSP profile's verified host scope beyond Linux x64. The PR was marked ready for review after these results were checked; no additional source commits or workflow changes were made for that transition.

Integration correction

A clean merge exposed a verifier defect in run 38090704268: newly added generic carved-firmware checks also ran in PSP mode and expected a generic MIPS language and generic-fixture symbols. The two-file correction scopes those checks to generic mode. All generic carved-firmware assertions remain exercised; PSP retains its ordinary CLI/MCP, known-fact, snapshot and A → B → A checks and explicitly reports carved-PSP coverage as not run. The correction changes no production code or test threshold.

Not established / review focus

This is selected static conformance, not execution equivalence or complete VFPU semantics. PRX relocation behavior, PBP/ISO/CSO inputs, live overlays, emulation, game-specific reconstruction, other host platforms and independently published PSP binaries remain unverified/out of scope. The strict producer declaration does not imply general compatibility with historical commercial PSP executables.

Installed extension code is trusted: its digest supplies interpretation/cache identity, not a signature or sandbox. Do not change the installation during a session. Please review the narrow admission boundary and installed-extension identity approach. No issue is automatically closed by this description.

Historical verification and failures
  • Independent PSPSDK ABI inspection disproved the initial assumption that the fixture had no ABI record. Production admission and the verifier were corrected together; profile revision v2 binds the actual record.
  • Public PSP verification at 8e1d69b remains a historical passing checkpoint, not proof for later merges.
  • Previous upstream integration run failed. Its actual synthetic merge combined 8e1d69b with c1217e7. The pinned upstream update reuses subsequent changes instead of adding unrelated repairs to this contribution. Downloaded test reports showed six failures in cleanup/setup areas; their targeted current suites passed after integration. This is not a claim that the older base CI was green.
  • The first attempt to apply the verifier correction stopped at an overly strict patch-location assertion before changing source. Correcting that fork-only preparation step produced the successful run above.
  • Fork-only orchestration remains outside this PR's source diff. Earlier failed attempts remain available in Actions history.

github-actions Bot and others added 8 commits October 10, 2026 16:24
Build on merged generic MIPS without weakening its policy. Bind caller-installed processor files into the analysis profile, check them again before launch, force and verify PSP language selection, retain limitations, and extend the public CLI/MCP verifier with source-owned PSP and target-switching checks. Local actual focused Vitest: 102 passed, one existing permission skip. Hosted static and real-provider results are pending.
@jaelliot
jaelliot marked this pull request as ready for review October 10, 2026 23:03
@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.

Copy link
Copy Markdown
Contributor Author

Ready for review at 4bfcf81d757473b6edea66779a7b732e041d5356.

Upstream CI 38092014434 passed all 19 jobs, including all four test shards and coverage aggregation. The separate real-Ghidra verification 38091449625 passed on this exact contribution source: public PSP CLI/MCP, missing-extension refusal, snapshot/A → B → A identity, and generic LE/BE MIPS including carved-firmware checks. Its focused tests were 233 passed, 0 failed, 3 skipped across 15 suites.

Please review the strict PSP ELF/ABI admission boundary and installed-extension identity binding. Generic MIPS admission stays separate, and Allegrex semantics remain owned by the caller-installed extension. This does not claim general commercial-game, PRX, carved-PSP, complete VFPU, or additional-host support.

The description now records the final CI result and keeps the earlier failures available. No source commits or workflow changes were added to move this PR out of draft.

@morluto

morluto commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Thank you @jaelliot for the PSP/Allegrex contribution! I appreciate the strict ELF/ABI admission, installed-extension identity checks, and real Ghidra verification, especially the clear limits on supported inputs and hosts. I reviewed it and pushed a fix to bound directory enumeration before allocation. Thanks for the careful implementation and thorough verification.

@morluto
morluto merged commit e4407db into morluto:main Oct 11, 2026
31 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 11, 2026
3 tasks done
@morluto morluto added enhancement New feature or request area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
@morluto morluto added area: setup Setup, packaging, upgrade, install, Doctor, and client registration provider: ghidra Analysis provider / engine: ghidra labels Nov 23, 2026
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: setup Setup, packaging, upgrade, install, Doctor, and client registration enhancement New feature or request provider: ghidra Analysis provider / engine: ghidra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants