Skip to content

Commit ec3ec35

Browse files
n-delicclaude
andauthored
PlayStation 3 from your own decrypted EBOOT.ELF, and your own PS3 SDK (#161)
* Xbox games start from their own default.xbe or disc image (beta) An XBE is read and made a Windows program at the same addresses, which the PC path imports as it is: Ghidra, the delinker, objdiff, the rebuild check and every PC feature work on Xbox games. Kernel imports are named from nxdk's CC0 list, the XDK's library sections are set aside, and the compiler comes from the XDK build in the library version table. A compiled demo (Visual C++ 7.1) passes the console conformance tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * The Xbox in the table, the docs and the site: every feature ran on its demo Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Xbox: the rebuild gives back the game's XBE, early XDKs build with Visual C++ 7.0, Bink is set aside The PE view keeps the XBE whole inside it and says where, so tools/rebuild.py writes default.xbe beside the program (byte for byte your copy on a real game). XDKs before 5233 shipped Visual C++ 7.0 builds: 4627's is the pack's 7.0, earlier ones get it as the nearest. RAD's Bink sections are licensed middleware, set aside like the XDK's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Xbox: your own XDK sets its library code aside and builds early games with its own compiler Setup takes the folder of your own Xbox Development Kit (checked and recorded, never downloaded or copied). With it, the XDK's functions the linker put into .text (the C runtime, XAPI) are found by its libraries' bytes and set aside: 432 of them in a real game, in seconds. XDKs before 5233 shipped Visual C++ 7.0 builds of their own (13.00.9254 in 3911, not the pack's 9466): a game of that XDK builds with it (MSVC/xdk, configure.py --xdk) where it's set up. XDK 5849's compiler is byte for byte the msvc pack's 7.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Kits: a connector for the compilers and SDKs users bring, the Xbox XDK the first A compiler that only ever came in a proprietary SDK, or an SDK a console's games need, can't be pinned and downloaded. kits/ is its connector, like consoles/ and agents/: a kit says what proves its folder, its build, its compilers and the SHA-256 of the builds decompdecomp knows. Setup records the user's folder (a local toolchain, nothing copied) and says whether the copy is a known build; a console takes a kit by naming it (Console.kits) and its compilers reach the build through configure.py --own. The XDK moves there from toolchains.toml; the Xbox takes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * Xbox: games built with Visual C++ 7.0 or an early XDK's compiler build without /arch:SSE Their compilers don't have it (7.1 added it), and warned on every file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * PC projects can build a unit in LTCG harness mode, with Visual C++'s linker run through wine Games built with /GL and /LTCG can't match one file at a time: the linker picks register conventions and inlines across files. A unit whose harness/<unit>.drv.cpp defines HarnessEntry now compiles with /GL, links with /LTCG into a DLL (tools/ltcg.py; link.exe and lib.exe go through wine, which wibo can't run them on) and tools/dll2coff.py cuts its functions into an object laid out like the delinked original, with an address-mapping check. Other units and ordinary PC projects build as before; LTCG is a kept setting when tools are brought up to date, and pc.create takes a plan hook for choices that depend on the analysed program. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * Xbox imports tell link-time code generation apart and judge harness units The import detects LTCG from call sites that load registers no standard convention uses (forks/convention.py), logs why, writes ltcg and its evidence in the manifest, uses the LTCG flags and writes a driver skeleton per game unit (forks/ltcg.py). The judge counts a function that fails the mapping or data check as not matched, repeat-compile detection sees the harness files, and Xbox builds are given wine. The demo builds with 'build.py ltcg' and tests/test_ltcg.py imports it and matches a register-convention function. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * The docs say what Xbox has now: your default.xbe rebuilt, your own XDK, three real games imported Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * A piece another function jumps into stays a function of its own, so the program still rebuilds merge_pieces counted only calls and addresses as references to a piece Ghidra cut off. A linker that shares one tail between functions (link-time code generation: an Xbox game of 23,000 functions had two) left the other function's jump naming a symbol the join took away, and the rebuild check could no longer place it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * Agents can work a game built with link-time code generation: convention evidence in briefs, standins_for and unresolved names by kind Stage 1 built LTCG units through a harness, but an agent had nothing to write one with. The brief of an LTCG project's function now shows its convention in the original (registers read before written, stack arguments, ret N, saves, a few call sites) and says whether the unit's compile goes through a driver yet, how to name a decorated function (`// FUNCTION: 0x<address>`) and where to start. The new standins_for tool (forks/standins.py) writes a starting harness for a unit: stand-ins for what it calls or reads elsewhere with their conventions, a HarnessEntry with each function's call sites, and the declarations. Names a harness link left unresolved reach compile_and_diff, the brief and a pushed-back release by kind (data, standard callee, register callee, inlined callee, library; forks/unresolved.py), and a function missing from the unit's object says what the build said about it. The Xbox guide now teaches harness mode instead of telling agents to release LTCG functions. tests/test_ltcg.py goes from claim to match through the tools an agent has, then checks the rebuild. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * The import can force link-time code generation on or off for an Xbox game Detection from the program is a guess a user may know better than: the import dialog now asks (auto, on, off) for consoles that declare import_options. The connector gets a small generic hook (Console.import_options, passed as keywords to create_project through import_game/create_scratch and the import route's `options` query), so nothing outside consoles/ compares console names. Paths picked by typing them stay on auto. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * The roadmap says link-time code generation works on Xbox games, and what's left of it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * LTCG briefs and standins_for say when a function is a member function, of which struct, with its fields and a declaration Under link-time code generation `this` can arrive in eax, esi, edi, ebx or ecx, which the ECX-only struct reader and the RTTI classes miss, so agents wrote member functions as free functions taking a pointer and guessed the fields. forks/methods.py (ported from the prototype) reads it from the registers a function uses as the base of fixed-offset accesses, notes "two objects alike" when two registers hit the same offsets, and groups functions by shared evidence (vtable stores, callers passing the same global object). standins_for declares member functions as such and writes the structs. Where RTTI already named the class, the brief only adds the register. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * An LTCG attempt whose function got another convention than the original's says which registers differ A helper or driver call adds a call site, and the linker can then pick another convention for the callee, so the bytes differ for a reason the C doesn't show. After an unmatched attempt the result compares the harness-made object's function (convention.analyse) with the original's and names the registers, stack arguments or ret that differ, with the hint to keep the original's number of call sites and check the driver's calls. The Xbox guide gets the member-function and call-site paragraphs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * The roadmap says all of the prototype's LTCG work is in Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * Your own Visual C++ and several copies of any kit: games build with the compiler build they were made with A game built with a Visual C++ build the downloadable packs don't have (a hotfix, 2012 to 2015, 2017 and newer) could not match, and a kit held one folder only, so a user with two XDKs or several Visual C++ versions had to pick. Setup now records any number of copies per kit (old single-folder manifests still read), lists each with its build and a Remove button, and adds a new "Visual C++ (your own copy)" kit for PC that recognises VC98, VC and VC/Tools/MSVC layouts. Each compiler carries its exact build, read from c2.dll's version resource, and a name unique per copy (xdk-3911, own-9.0.30729). The Xbox picks the XDK copy whose build is the game's; the PC picks the copy whose build the Rich header names (else the nearest of the same version), so games the packs can't build, 2017 and newer included, are in scope with a matching copy. The kits' compilers are listed as compilers of their console so a file can be switched to one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * Adding a kit explains several copies and matching by build Kits now hold any number of copies and consoles choose the copy whose build is the game's; contributors adding a kit need to know parts read one copy only and version names must be unique per copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * Your own Visual C++ is read by its cl.exe version, as its c2.dll says it c2.dll's file version is cl.exe's (Visual C++ 6.0 is 12.0.8168, 2008 is 15.0.30729, 2017 is 19.16.27023), not Visual Studio's: read as Visual Studio's, no copy matched a game's Rich header, and 2005 to 2010 ran through wine instead of wibo. Checked against the msvc packs' own compilers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * The docs say PC games of any Visual C++ build with your own copy of it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * The site's PC card says any Visual C++ builds from your own copy Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * Sony's PS3 PPU compiler can be rebuilt from its published GPL sources The period PS3 compiler (ppu-lv2-gcc, GCC 4.1.1) has no public binary, only the GPL source Sony published. packaging/ps3-gcc/ builds the 1.9.0 and 2.7.0 generations in a pinned Debian jessie container from a checksummed source archive and packs binaries, exact source and GPL texts into a .tar.xz. The toolchains.toml entries are drafted but commented out until the archives are published. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * Setup lists the kits users bring, and a filter chip for every platform it has Compilers & tools showed only the compilers and the consoles' packs: the XDK and your own Visual C++ never reached the page, so they couldn't be set up. Its filter chips were a fixed list too, without Xbox, PS1 or GBA; now they come from the platforms on the page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * A kit's copies fit their card in Setup: the build, whether it's known, and the folder's end, wrapped Each copy showed its whole folder path in the monospace installed mark, which doesn't wrap: the cards ran into each other. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * PowerPC64 functions are judged by what they refer to, not by patched fields A PowerPC64 program reaches functions through descriptors and globals through the TOC, and the linker picks the encodings, so patching relocation fields would fail correct code or pass wrong code. arch/ppc64.py reads what the game's own instructions refer to once (calls, TOC slot loads, absolute address pairs), and the judge works out what each relocation of a candidate refers to (a function entry, a global, what a TOC slot holds, a descriptor's code), requires it to be the same, takes over only the game's field bits, and compares the rest byte for byte. Sony's 32-bit pointers with 8-byte descriptors and the usual 24-byte ELFv1 ones share it; the linker's TOC restore after a call is accepted. The processor is registered for ELF objects, twins and the disassembler's AltiVec registers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * Start a PlayStation 3 project from a decrypted EBOOT.ELF The PS3 is a ROM-mode console with a splitter of its own, like the Game Boy Advance: no tool splits a linked PowerPC64 program. The reader takes the code from the lowest segment with a payload, the module descriptor at e_entry, the ABI and .comment's compiler stamp, and refuses an encrypted SELF with what to do (decompdecomp never decrypts a game). The splitter starts from the descriptor's functions and the program's own descriptors, then calls, prologues and leaf code after a return, and names the data the code refers to. The drop zone takes the ELF and explains a SELF. The free ps3dev GCC is pinned as the console's compiler; it makes the usual 64-bit program, not Sony's, so it builds the demo and homebrew only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * Demo Quest builds for the PlayStation 3, and the console is tested without a game projects/demo-ps3 builds the CC0 demo game plus a start file (a global reached through the TOC, a call through a function pointer) with the free PPU compiler, stripped like a decrypted EBOOT.ELF, and passes the console conformance test (import, matching and wrong C). tests/test_ps3.py covers the reader, the registry order, the splitter, the reference scan and the judge with a hand-made program and candidate objects, so it needs neither a compiler nor a game, and checks the demo splits the same without its section names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * The PS3 compiler pack holds only the GPL parts of Sony's toolchain source Sony's own files in the archive (its readmes, its build scripts, the vector intrinsics headers it added to GCC's tree) say "SCE CONFIDENTIAL ... All Rights Reserved": they aren't GPL. They are left out of the pack and the source in it, found by that notice; GCC's configuration lists the headers, so each becomes a stub that stops a file including it (the user's own SDK has them). SOURCE.txt says which. Rebuilt and checked: it still compiles to a PS3 object, and no file of the pack but that note carries the notice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * A ROM project can compile with a compiler from your own SDK copy A compiler that only came in an SDK was usable in PROJECT mode only. A ROM project's compiler id may now name a kit compiler: it runs from the user's copy through its runner, with the copy mounted read-only in the same sandbox and limits as the pinned compilers, and nothing is copied. The PlayStation 3 SDK is the first kit to give one (GCC and SNC, one compiler per SDK generation). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * A PlayStation 3 game starts on the SDK copy that built it The import reads the SDK stamp Sony's GCC leaves in .comment (SDK270) and picks the user's SDK copy whose compiler carries the same stamp; without one it keeps the free compiler and says which SDK to set up. The guide tells agents how the compiler choice works and why the free one cannot match retail code exactly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * A PlayStation 3 program's imports and kernel calls get their names, and a program that kept its symbols keeps them A PS3 game calls the system through import stubs the loader links by library name and NID, and the kernel through `sc`. Both were unnamed func_ rows. The import reads the program's import tables (.sys_proc_prx_param, the .lib.stub records), recognises each stub by the slot it loads and each kernel call by the number it puts in r11, names them `<library>_<function>` and `sys_...` from PSL1GHT's lists (MIT; NID = SHA-1 of the canonical name plus a fixed 16-byte suffix, little-endian, checked against known NIDs; nids.py regenerates the data and its licence from a pinned commit), and sets the import stubs aside. Done at import and in Check again, once per project. A program that kept its symbol table now names its functions and data (a function's symbol points at its .opd descriptor, not its code). The permuter used decomp-permuter's base weights for the PS3 compilers; they are GCC's. Reimport forgets that imports were named so the new split is named again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * The docs, the roadmap's table and the site have the PlayStation 3 Its column is what the feature run on its demo found; each gap has its item. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * A decrypted retail PS3 program imports whole: its stubs, sections, SDK and title are read as retail ones are Checked on a decrypted retail game (22,482 functions, SDK 2.5.0), which showed what the homemade demo couldn't: - its import stubs build the slot's address with li and oris and save the TOC first: stub_slot follows any such sequence, and every stub starts a function, called or not (an uncalled one ran on for 842 KB into the data after it); the scan reaches a range's last stub; - decryption leaves its section names and .comment zeros: sections are kept by number with their flags, so code is the executable sections; the SDK comes from the process parameters (0x00250001 is 2.5.0), and is the compiler guess; - its title, title ID and region come from the disc's PARAM.SFO beside the ELF. All 194 imports are named now. With Sony's GCC rebuilt from its GPL source (2.7.0) as an SDK copy, two of its functions matched through the judge, a third 99.6%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * The roadmap says a retail PS3 game imported whole, and what it hasn't shown yet Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * No game is named in the Xbox code and tests: a title ID example and a test's story say what kind of game Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * A PS3 game built with -mminimal-toc builds with it, and search_flags tries it on any PS3 game A decrypted retail game reached its globals through each file's own table of addresses in r30 (std r30,-16(r1); lwz r30,N(r2): GCC's -mminimal-toc), which the import now reads off the code (elf.minimal_toc) and gives the project's flags (Console.game_flags, a GCC only: SNC has no such flag); search_flags tries the flag on every PS3 game (Console.flag_extras). With it, a getter of that game matched through both tables with SDK 2.5.0's GCC, built from Sony's GPL source like 1.9.0 and 2.7.0 (packaging/ps3-gcc/ now pins 2.5.0 too). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * The roadmap says how a retail PS3 game reaches its globals, and that it matches Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * ROADMAP: the PS3 compiler recipe has 2.5.0 too Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * A PS3 SDK copy says its build on any computer, whichever host's compiler it has build() read only the compiler that runs here, so on macOS and Windows a copy with only the Linux host's compiler said no build (CI). The stamp is the same in either: it's read from whichever the copy has. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * The fork-setup test's stand-in for PC's tool_args takes the kits it's now given CI failed on every system: tool_args takes the console's kits since kits came in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH * A kit file rewritten within one tick of the clock is read again, not taken from the cache file_version cached by path and mtime; Windows' coarse clock gave a stand-in rewritten at once the same mtime, and CI on Windows read the old version. The size is in the key too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kw52ayMLQzgUMTVxfzDfXH --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 959be0d commit ec3ec35

39 files changed

Lines changed: 4410 additions & 56 deletions

‎CONTRIBUTING.md‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ works on which platform: every — in it is a gap to fill.
7171
### Every console gets every feature
7272

7373
decompdecomp is one pipeline for every console: whatever helps agents on one console should work on all of them,
74-
in ROM mode (N64, PS1, PS2, PSP, GBA) and project mode (GameCube, Wii, PC, Xbox, DS, public decomps) alike. When you add a feature:
74+
in ROM mode (N64, PS1, PS2, PS3, PSP, GBA) and project mode (GameCube, Wii, PC, Xbox, DS, public decomps) alike. When you add a feature:
7575

7676
1. Build the shared part where every console uses it: `app/` and `network.py` for the engine, `rom/` and `forks/`
7777
for each mode, `arch/` for what depends on the processor.
@@ -91,6 +91,7 @@ through one file: the connector, `consoles/__init__.py`.
9191
| `consoles/n64/` | Nintendo 64 | ROM | `rom.py` the ROM file and its header · `code.py` code the game loads later, compressed code · `guides/` |
9292
| `consoles/ps1/` | PlayStation | ROM | `exe.py` the game's program (PS-X EXE) and the disc's BOOT line; its discs and overlays through the PS2's readers · `guides/` |
9393
| `consoles/ps2/` | PlayStation 2 | ROM | `elf.py` the game's program · `disc.py`, `chd.py` disc images · `overlays.py` code in the disc's other files · `syscalls.py` kernel calls · `symtab.py`, `mdebug.py`, `stabs.py`, `cheader.py`, `debuginfo.py` the game's own debug symbols · `guides/` |
94+
| `consoles/ps3/` | PlayStation 3 | ROM | `elf.py` the decrypted program, its descriptor and `.opd` · `split.py` the program's function list, calls and prologues · `imports.py`, `nids.py` imports and kernel calls named · `symbols.py` its own symbols · `guides/` (the processor: `arch/ppc64.py`) |
9495
| `consoles/gba/` | Game Boy Advance | ROM | `header.py` the cartridge header · `split.py` luvdis and the candidate finder, its editing and joining · `candidates.py`, `luvdis_run.py` · `export.py`, `export_build.py` · `guides/` |
9596
| `consoles/gc_wii/` | GameCube, Wii | PROJECT | `scratch.py` a dtk-template project for the game · `guides/` |
9697
| `consoles/pc/` | Windows PC | PROJECT | `scratch.py` Ghidra finds the functions, decompdecomp cuts them out of the .exe · `project_template/` · `guides/` |
@@ -280,6 +281,14 @@ records the folder, and reads it there. Nothing of it is copied, downloaded or p
280281
PC's `own_copy`: the Rich header's version and build number against each copy's `build`, else the nearest build
281282
of the same version, and it says so), and only when its packs don't have that build. A project template other
282283
than PC's takes `--own` the same way.
284+
**ROM mode runs a kit's compiler too.** A ROM project's compiler id may name an `OwnCompiler` (its `version`,
285+
`ps3sdk-270`): `Console.kit_compilers` lists it with the console's own, `kits.own_compiler(id)` finds it, and
286+
`project.compiler_config` runs its exe from the user's copy (through wibo off Windows when `runner` says, its
287+
folder `root` and headers mounted read-only in the sandbox, nothing copied) with `args` and the console's flags,
288+
in the same sandbox and limits as a pinned compiler; `toolchains.get/known/installed` answer for it while the copy
289+
is set up. GCC-style arguments (`-c -I -o`) only so far; `runner = "wine"` is refused in ROM mode. Fill `root`
290+
(the folder the compiler reads beside `bin/`), `args` and `flags` when you add one, and let the console's
291+
`default_compiler` pick the copy by build, as the PS3's does by the `.comment` stamp.
283292
5. **Pass the tests**: `uv run pytest tests/test_kits.py -q`. It checks the facts, that it's a local toolchain
284293
nothing downloads, that a console takes it, and that no code outside `kits/` and that console names it. Test
285294
it with a homemade folder (empty stand-ins, never a file of the real kit).

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ game's code is its rights holder's: keep it to yourself.
231231
| Nintendo 64 | Recommended |
232232
| PlayStation (PS1) | Beta |
233233
| PlayStation 2 | Beta |
234+
| PlayStation 3 | Beta (from your decrypted EBOOT.ELF; the free ps3dev GCC, or your own SDK's compiler) |
234235
| PSP | Beta |
235236
| GameCube, Wii | Beta |
236237
| Windows PC games | Beta |

‎ROADMAP.md‎

Lines changed: 57 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,41 @@ Each feature and the platforms it covers today. A — is a gap: pick one up (the
1515
start). Keep this table true when a feature ships or reaches another platform. Each column's code is its console's
1616
folder, `src/decompnet/consoles/<id>/`; a new console adds a column (CONTRIBUTING.md, "Consoles").
1717

18-
| Feature | N64 | PS1 | PS2 | PSP | GBA | GameCube · Wii | Windows PC | Xbox | DS | Public decomps |
19-
| :-- | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: |
20-
| Status | recommended | beta | beta | beta | beta | beta | beta | beta | beta | the project's own |
21-
| Start from your own copy | ✓ | ✓ | ✓ | ✓ unencrypted or decrypted program and modules (ISO, CSO, CHD) | ✓ ROM | ✓ | ✓ | ✓ default.xbe, .xiso or Redump .iso | ✓ | fork by address |
22-
| Judge | link · compare | link · compare | link · compare | link · compare | link · compare | objdiff | objdiff | objdiff | objdiff | objdiff |
23-
| Machine drafts (m2c, Ghidra for x86) | ✓ | ✓ | ✓ | ✓ | ✓ (m2c `gba-gcc-c`) | ✓ | ✓ Ghidra | ✓ Ghidra | — | by architecture |
24-
| Autopilot: free matches from drafts | ✓ | ✓ | ✓ | ✓ | ✓ (demo: 34 matches) | ✓ | ✓ exact drafts of tiny shapes; Ghidra's made compilable | ✓ as PC | — | — |
25-
| Drafts follow the header, made in the background; `redraft` | ✓ | ✓ | ✓ | ✓ | ✓ (m2c and `redraft`) | — | ✓ Ghidra's | ✓ Ghidra's | — | — |
26-
| C++ methods drafted as `Class::method` | ✓ | ✓ | ✓ | ✓ | — | — | ✓ (RTTI, and classes from the vtables constructors store) | ✓ (RTTI, vtables) | — | — |
27-
| Twins: free matches from identical code | ✓ | ✓ | ✓ | ✓ | ✓ (ran; no pairs in demo) | ✓ | ✓ | ✓ | ✓ | ✓ |
28-
| Permuter on near misses | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ |
29-
| Hand-written assembly set aside | ✓ | ✓ | ✓ | ✓ | ✓ (`_call_via` helpers, `svc`/`swi` stubs) | ✓ | Visual C++'s exception-handling stubs | Visual C++'s exception-handling stubs | BIOS call stubs, pieces of functions | MIPS, PowerPC, ARM's BIOS stubs and pieces of functions |
30-
| Pieces of functions joined to their function | — | — | — | — | — | — | ✓ (`scratch.merge_pieces`) | ✓ (`scratch.merge_pieces`) | ✓ (`recover.merge_pieces`) | — |
31-
| Agents' verdict "no C makes this" (3 agents of 2 models: set aside, red in the map) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
32-
| Check again (and before helpers start, once after each update) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
33-
| Kernel stubs set aside and named | — | set aside (BIOS calls) | ✓ | set aside, named by library and NID | set aside (BIOS calls) | — | ✓ import thunks | ✓ import thunks, named from the kernel export list | — | — |
34-
| Function-end reports (`report_boundary`) | ✓ | ✓ | ✓ | ✓ | ✓ (2-byte boundaries) | — | ✓ (agents agree, the rebuild checks) | ✓ | — | — |
35-
| Compiler ranges and suggestions | ✓ | ✓ | ✓ | ✓ | — | from scratch: per source file (`try_compiler`, Settings); else the project's build | per source file (`try_compiler`, Settings) | per source file (`try_compiler`, Settings): Visual C++ 7.0 / 7.1, your XDK's own | per source file (`try_compiler`, Settings) | the project's build |
36-
| Flag search (`search_flags`) | ✓ | ✓ | ✓ | ✓ | — | the project's build | per source file (/Oy-, /O1, /Ob1) | per source file | the project's build | the project's build |
37-
| Compiler map and the judge's survey | ✓ | ✓ | ✓ | ✓ | — | — | ✓ per source file, Rich header | the XDK build's compiler (no Rich header: one per game) | — | — |
38-
| Range checks: a range applies after its neighbours confirm it | ✓ | ✓ | ✓ | ✓ | — | — | ✓ over source files | ✓ | — | — |
39-
| C++ classes from the code (`get_class`) | ✓ | ✓ | ✓ | ✓ | — | — | ✓ (named by RTTI where the program has it) | ✓ (RTTI where the program has it) | — | — |
40-
| Struct layouts from loads and stores (`guess_struct`) | ✓ | ✓ | ✓ | ✓ | — | — | ✓ | ✓ | — | — |
41-
| The game's own debug symbols: names, types, prototypes | — | — | ✓ symbol table, STABS, DWARF 1; the compiler of each object file | ✓ symbol table, DWARF 1 | — | — | ✓ PDB (Visual C++ 6.0's PDB 2.0, MSF 7.00), linker map, COFF symbols | — (an XBE has none) | — | — |
42-
| Twins across your games | ✓ | ✓ | ✓ | ✓ | — | — | ✓ (between PC projects) | ✓ (as PC's; not run on two Xbox games yet) | — | — |
43-
| Shared knowledge (two models agree) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
44-
| Tidy each source file once it's polished (shared types in one header, names, dead declarations) | — | — | — | — | — | ✓ | ✓ | ✓ | ✓ | ✓ |
45-
| Polish matched code (still matching) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
46-
| Real names for the game's symbols (`rename_symbol`) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | dtk and ds-decomp projects |
47-
| Save and restore (`progress/`, Open a saved project) | ✓ | ✓ | ✓ | ✓ | ✓ | the project's git; best attempts saved | the project's git; best attempts saved | the project's git; best attempts saved; the PE view made again from your XBE or disc | the project's git; best attempts saved | the project's git; best attempts saved |
48-
| Saved README preserves notes, with completion bar and function map | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
49-
| Reimport: a new split, matched work kept (Settings) | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ (Ghidra again, the newest rules) | ✓ | — | — |
50-
| Rebuildable export | ✓ | ✓ | ✓ | ✓ | ✓ | the project | the project (`ninja rebuild`) | the project (`ninja rebuild` writes your default.xbe back, byte for byte) | the project | the project |
51-
| Progress bars for foreground jobs | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
52-
| Rooms: decompile together | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
18+
| Feature | N64 | PS1 | PS2 | PS3 | PSP | GBA | GameCube · Wii | Windows PC | Xbox | DS | Public decomps |
19+
| :-- | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: |
20+
| Status | recommended | beta | beta | beta | beta | beta | beta | beta | beta | beta | the project's own |
21+
| Start from your own copy | ✓ | ✓ | ✓ | ✓ decrypted EBOOT.ELF | ✓ unencrypted or decrypted program and modules (ISO, CSO, CHD) | ✓ ROM | ✓ | ✓ | ✓ default.xbe, .xiso or Redump .iso | ✓ | fork by address |
22+
| Judge | link · compare | link · compare | link · compare | link · compare | link · compare | link · compare | objdiff | objdiff | objdiff | objdiff | objdiff |
23+
| Machine drafts (m2c, Ghidra for x86) | ✓ | ✓ | ✓ | — | ✓ | ✓ (m2c `gba-gcc-c`) | ✓ | ✓ Ghidra | ✓ Ghidra | — | by architecture |
24+
| Autopilot: free matches from drafts | ✓ | ✓ | ✓ | twins only | ✓ | ✓ (demo: 34 matches) | ✓ | ✓ exact drafts of tiny shapes; Ghidra's made compilable | ✓ as PC | — | — |
25+
| Drafts follow the header, made in the background; `redraft` | ✓ | ✓ | ✓ | — | ✓ | ✓ (m2c and `redraft`) | — | ✓ Ghidra's | ✓ Ghidra's | — | — |
26+
| C++ methods drafted as `Class::method` | ✓ | ✓ | ✓ | — | ✓ | — | — | ✓ (RTTI, and classes from the vtables constructors store) | ✓ (RTTI, vtables) | — | — |
27+
| Twins: free matches from identical code | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ (ran; no pairs in demo) | ✓ | ✓ | ✓ | ✓ | ✓ |
28+
| Permuter on near misses | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ | ✓ | ✓ |
29+
| Hand-written assembly set aside | ✓ | ✓ | ✓ | ✓ (`sc` stubs) | ✓ | ✓ (`_call_via` helpers, `svc`/`swi` stubs) | ✓ | Visual C++'s exception-handling stubs | Visual C++'s exception-handling stubs | BIOS call stubs, pieces of functions | MIPS, PowerPC, ARM's BIOS stubs and pieces of functions |
30+
| Pieces of functions joined to their function | — | — | — | — | — | — | — | ✓ (`scratch.merge_pieces`) | ✓ (`scratch.merge_pieces`) | ✓ (`recover.merge_pieces`) | — |
31+
| Agents' verdict "no C makes this" (3 agents of 2 models: set aside, red in the map) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
32+
| Check again (and before helpers start, once after each update) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
33+
| Kernel stubs set aside and named | — | set aside (BIOS calls) | ✓ | ✓ import stubs (NIDs) and `sc` calls | set aside, named by library and NID | set aside (BIOS calls) | — | ✓ import thunks | ✓ import thunks, named from the kernel export list | — | — |
34+
| Function-end reports (`report_boundary`) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ (2-byte boundaries) | — | ✓ (agents agree, the rebuild checks) | ✓ | — | — |
35+
| Compiler ranges and suggestions | ✓ | ✓ | ✓ | ✓ (ps3dev GCC, your SDK's) | ✓ | — | from scratch: per source file (`try_compiler`, Settings); else the project's build | per source file (`try_compiler`, Settings) | per source file (`try_compiler`, Settings): Visual C++ 7.0 / 7.1, your XDK's own | per source file (`try_compiler`, Settings) | the project's build |
36+
| Flag search (`search_flags`) | ✓ | ✓ | ✓ | ✓ | ✓ | — | the project's build | per source file (/Oy-, /O1, /Ob1) | per source file | the project's build | the project's build |
37+
| Compiler map and the judge's survey | ✓ | ✓ | ✓ | — | ✓ | — | — | ✓ per source file, Rich header | the XDK build's compiler (no Rich header: one per game) | — | — |
38+
| Range checks: a range applies after its neighbours confirm it | ✓ | ✓ | ✓ | — | ✓ | — | — | ✓ over source files | ✓ | — | — |
39+
| C++ classes from the code (`get_class`) | ✓ | ✓ | ✓ | — | ✓ | — | — | ✓ (named by RTTI where the program has it) | ✓ (RTTI where the program has it) | — | — |
40+
| Struct layouts from loads and stores (`guess_struct`) | ✓ | ✓ | ✓ | — | ✓ | — | — | ✓ | ✓ | — | — |
41+
| The game's own debug symbols: names, types, prototypes | — | — | ✓ symbol table, STABS, DWARF 1; the compiler of each object file | names (types and prototypes: —) | ✓ symbol table, DWARF 1 | — | — | ✓ PDB (Visual C++ 6.0's PDB 2.0, MSF 7.00), linker map, COFF symbols | — (an XBE has none) | — | — |
42+
| Twins across your games | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | ✓ (between PC projects) | ✓ (as PC's; not run on two Xbox games yet) | — | — |
43+
| Shared knowledge (two models agree) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
44+
| Tidy each source file once it's polished (shared types in one header, names, dead declarations) | — | — | — | — | — | — | ✓ | ✓ | ✓ | ✓ | ✓ |
45+
| Polish matched code (still matching) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
46+
| Real names for the game's symbols (`rename_symbol`) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | dtk and ds-decomp projects |
47+
| Save and restore (`progress/`, Open a saved project) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | the project's git; best attempts saved | the project's git; best attempts saved | the project's git; best attempts saved; the PE view made again from your XBE or disc | the project's git; best attempts saved | the project's git; best attempts saved |
48+
| Saved README preserves notes, with completion bar and function map | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
49+
| Reimport: a new split, matched work kept (Settings) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — | ✓ (Ghidra again, the newest rules) | ✓ | — | — |
50+
| Rebuildable export | ✓ | ✓ | ✓ | — | ✓ | ✓ | the project | the project (`ninja rebuild`) | the project (`ninja rebuild` writes your default.xbe back, byte for byte) | the project | the project |
51+
| Progress bars for foreground jobs | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
52+
| Rooms: decompile together | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
5353

5454
Where to start on a gap:
5555
- **PowerPC (GameCube, Wii) and x86 (PC)**: class recovery and the compiler map work on a project's objects in fork
@@ -512,6 +512,28 @@ Where to start on a gap:
512512

513513
## Next
514514

515+
### PlayStation 3 from your own copy
516+
517+
ROM mode, as the PS2 and PSP: you give decompdecomp the game's program decrypted (EBOOT.ELF: a SELF is refused, it
518+
never decrypts anything), it splits it (the module descriptor's functions first, then calls and prologues), and the
519+
judge links each candidate at its address and compares what each instruction refers to (`arch/ppc64.py`: TOC slots,
520+
function descriptors, the call-site TOC restore). Its imports are named from their NIDs and its kernel calls from
521+
their numbers (PSL1GHT's lists, MIT), and their stubs set aside. It builds with the free ps3dev GCC (the demo) or your
522+
own SDK's compiler (the `ps3sdk` kit: the game's `.comment` stamp picks the copy). Every feature of the table ran on
523+
its demo (`projects/demo-ps3`), and a decrypted retail game (22,482 functions, SDK 2.5.0) imported whole: its module
524+
descriptor (Sony's 8-byte pairs), its import stubs (all 194 named), its nameless sections and its SDK read as they
525+
are, and its functions matched through the judge with Sony's GCC rebuilt from its GPL source (SDK 2.5.0, the
526+
game's own), a getter of a global among them: that game reached its globals through GCC's minimal TOC (r30), which
527+
the import reads off the code and builds with (`-mminimal-toc`), and its linker didn't narrow any TOC load. What's left:
528+
529+
- **The period compiler without an SDK.** `packaging/ps3-gcc/` rebuilds Sony's `ppu-lv2-gcc` (SDK 1.9.0, 2.5.0, 2.7.0) from
530+
the GPL parts of its published source; its `toolchains.toml` entries wait for it to be published.
531+
- **Drafts.** m2c has no PPC64 target: a ROM-mode Ghidra draft (as PC's) would give PS3 drafts, autopilot's draft
532+
phase and `redraft`.
533+
- **The processor's readers.** `arch/ppc64.py` has no field accesses (`guess_struct`), class reader (`get_class`),
534+
piece rule or compiler map yet; the unstripped program's DWARF types and prototypes aren't read either.
535+
- **Later:** the rebuildable export, PRX modules, SPU programs.
536+
515537
### Xbox: what's next
516538

517539
The original Xbox is a beta PROJECT-mode console: decompdecomp reads your default.xbe (or an .xiso / Redump .iso),

‎docs/GUIDE.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ the game.
189189
| **Nintendo 64** | ★ **Recommended** | ✓ ROM | KMC GCC 2.7.2 · IDO 5.3 / 7.1 | ✓ export | ✓ |
190190
| **PlayStation** | Beta | ✓ disc (BIN, ISO, CHD) or PS-X EXE | GCC 2.5.7 · 2.6.0 · 2.6.3 · 2.7.2 (and CDK) · 2.8.0 · 2.8.1 · EGCS 2.91.66 · 2.95.2 (PSY-Q), with maspsx | ✓ export | ✓ |
191191
| **PlayStation 2** | Beta | ✓ disc or ELF | EE-GCC 2.9 · 2.95.2/2.95.3 (SN) · 2.96 · 3.2 · CodeWarrior 2.3.3 / 3.0.1 | ✓ export | ✓ |
192+
| **PS3** | Beta | ✓ program (decrypted EBOOT.ELF; a SELF is refused) | ps3dev GCC (free) · your own SDK's ppu-lv2-gcc and SNC | — | |
192193
| **PSP** | Beta | ✓ UMD image (ISO, CSO, CHD) with its other modules, or ELF/PRX, unencrypted or decrypted | CodeWarrior for PSP 3.0.1 · PSP SDK GCC 3.3.3 · SN pspsnc | ✓ export | ✓ |
193194
| **GameCube · Wii** | Beta | ✓ disc (ISO, RVZ, WBFS…) or DOL | CodeWarrior GC 1.0 – Wii 1.7 | ✓ dtk-template | ✓ |
194195
| **Windows PC** | Beta | ✓ program (32-bit x86 .exe) | Visual C++ 6.0 · 7.0 · 7.1 · 2005 · 2008 · 2010 · 2017 (wine); any other, from your own copy (Setup) | — | ✓ |

0 commit comments

Comments
 (0)