Format:PS2 EE executable (ELF)
| Extensions | SLUS_xxx.xx, SCES_xxx.xx, .elf |
|---|---|
| Endianness | little |
| On this wiki | Facts · Code · Notes · Topics |
The boot executable of a PlayStation 2 game (SLUS_xxx.xx and similar, named by BOOT2 in SYSTEM.CNF): a 32-bit little-endian ELF executable with e_machine 8 (MIPS) whose e_flags carry the R5900 CPU code 0x92, run by the Emotion Engine; decompilation tools key on exactly these header values.
Overview
The file that SYSTEM.CNF names with BOOT2 (Format:SYSTEM.CNF (PlayStation boot file)) is a normal ELF (Format:ELF (Executable and Linkable Format)) built for the Emotion Engine of the Platform:PlayStation 2. IOP drivers are a different ELF flavour, see Format:IRX (PlayStation 2 IOP module); Sony-specific type values are in Format:SCE ELF extensions (PlayStation consoles).
Header values that identify it
- e_type 2 (EXEC) and e_machine 8 (MIPS). Both splat and the ps2sdk ELF loader require these (Fact:PS2 EE executable (ELF)/behavior/splat accepts only PS2 EXEC ELFs, Fact:PS2 EE executable (ELF)/behavior/ps2sdk elf-loader2 header checks).
- e_flags CPU field (mask 0x00FF0000) equal to 0x00920000, the R5900 code in spimdisasm's table (Fact:PS2 EE executable (ELF)/enum/MIPS e flags CPU codes). splat refuses a MIPS EXEC ELF without it.
- PCSX2's ELF_HEADER struct carries the comment "e_flags ... = 0x20924001 noreorder, mips" (pcsx2/Elfheader.h line 22). Using spimdisasm's constants that value decomposes as ARCH_3 (0x20000000, -mips3 code) | CPU 5900 (0x00920000) | EABI64 (0x4000) | NOREORDER (0x1). The decomposition is my reading of the two sources; the 0x20924001 itself is only a comment, not a check.
- PCSX2's own loader class does not test the magic or e_machine at all, it only logs them (Fact:PS2 EE executable (ELF)/behavior/PCSX2 ElfObject checks); the game ELF is actually loaded by the emulated BIOS (Fact:PS2 EE executable (ELF)/behavior/PCSX2 fast boot patches EELOAD).
Sections
Sections splat looks at (and maps to its segment types) are listed in Fact:PS2 EE executable (ELF)/enum/splat ELF section mapping: .text, .data, .rodata, .bss, .sbss, .sdata, .gcc_except_table, .lit4, .lit8, .ctor, .vtables, plus VU code and data sections (.vutext, .vudata, .vubss). splat skips sections without the ALLOC flag, so debug sections such as .mdebug (a MIPS debug-info section; the name was not found in the files read here) are not part of the loadable image it extracts. Unverified: .mdebug is present in unstripped SDK-built ELFs and carries symbol and line tables; test with readelf -S on an unstripped build.
A section named .mwcats makes splat select the compiler MWCCPS2 (CodeWarrior) instead of EEGCC. Unverified: that section is emitted by the Metrowerks toolchain only.
Splitting for decompilation
See Tool:Splat#PS2 ELF input for how splat create_config turns this ELF into a ROM image, a YAML config and an initial symbol file.
Loader requirements of homebrew loaders
The ps2sdk elf-loader2 (AFL-2.0) accepts only ELFs that satisfy the checks in Fact:PS2 EE executable (ELF)/behavior/ps2sdk elf-loader2 header checks; real retail ELFs are loaded by the console's EELOAD, whose exact checks were not read.
Not covered
.iopmod and IRX details are on the IRX page.
Code & repositories
- https://github.com/ethteck/splat @
7548b9771e6f8418507b23434187fb07741af6d4· license: MIT
Binary splitter; PS2 pieces: src/splat/util/ps2/ps2elfinfo.py (ELF to segments), src/splat/platforms/ps2.py, src/splat/segtypes/ps2/ (ctor, lit4, lit8, vtables), src/splat/scripts/create_config.py (do_elf), docs/Quickstart-Elf.md.
Tested on: source read, not run · checked 2026-10-19; last activity 2026-10-10 - https://github.com/Decompollaborate/spimdisasm @
4b5d4c68eeb9f9eae14b3bb713971433ae2c3c43· license: MIT
MIPS disassembler library used by splat; spimdisasm/elf32/Elf32Constants.py names the e_flags CPU codes (5900 = 0x00920000) and section types.
Tested on: source read, not run · checked 2026-10-19; last activity 2026-08-06 - https://github.com/PCSX2/pcsx2 @
fc4d0cdf609e704abd9c41915e898adba5264b29· license: GPL-3.0-or-later (declared by the contributor for the files used; GitHub reports GPL-3.0 for the repository)
PS2 emulator (GPL-3.0): pcsx2/Elfheader.cpp/.h (ELF header handling), pcsx2/R5900.cpp (eeloadHook fast boot), pcsx2/CDVD/CDVD.cpp (SYSTEM.CNF and boot path).
Tested on: source read, not run · checked 2026-10-19; last activity 2026-10-19; Note: the latest release ships binaries; the wiki links only the source, never the binaries - https://github.com/ps2dev/ps2sdk @
329e2bb43287e16af16c4dde1c614e2662c24468· license: AFL-2.0 (declared by the contributor; GitHub's detector did not recognize LICENSE)
PS2SDK (AFL-2.0): ee/elf-loader2/src/elf.c validates an EE ELF before loading it (header and program header checks).
Tested on: source read, not run · checked 2026-10-19; last activity 2026-10-13