Format:PS-X EXE
Appearance
| Platforms | Platform:PlayStation |
|---|---|
| Magic | 50 53 2D 58 20 45 58 45 ("PS-X EXE") at 0x0 |
| Extensions | .EXE, or XXXX_NNN.NN named after the disc serial |
| Endianness | little |
| On this wiki | Facts · Code · Notes · Topics |
Executable format of the Platform:PlayStation: an 0x800-byte header starting with the ASCII text "PS-X EXE", giving the entry point, initial GP, load address and size, an optional zero-fill (BSS) region and the initial stack, followed by a raw image that is copied to the load address without relocation.
Overview
Used for the boot executable named in SYSTEM.CNF (for licensed games, a name like SLUS_000.67), for PSX.EXE, and for any program a game starts with the BIOS Exec functions. Game overlays are usually not in this format: they are headerless images (see Platform:PlayStation#Code organisation in commercial games).
Structures
All fields are 32-bit little endian.
| Offset | Size | Type | Name | Notes |
|---|---|---|---|---|
| 0x000 | 8 | char[8] |
id | PS-X EXE
|
| 0x008 | 8 | zero | ||
| 0x010 | 4 | u32 |
pc0 | entry point |
| 0x014 | 4 | u32 |
gp0 | initial $gp (often 0)
|
| 0x018 | 4 | u32 |
t_addr | load address of the image, usually 0x80010000
|
| 0x01C | 4 | u32 |
t_size | image size in bytes, a multiple of 0x800, header excluded |
| 0x020 | 4 | u32 |
d_addr | data section address (usually 0) |
| 0x024 | 4 | u32 |
d_size | data section size (usually 0) |
| 0x028 | 4 | u32 |
b_addr | start of a region the BIOS fills with zeros (BSS) |
| 0x02C | 4 | u32 |
b_size | size of that region; 0 = none |
| 0x030 | 4 | u32 |
s_addr | initial stack base ($sp/$fp); 0 = keep the caller's stack
|
| 0x034 | 4 | u32 |
s_size | added to s_addr |
| 0x038 | 0x14 | zero in the file; the BIOS saves the caller's registers here while executing | ||
| 0x04C | char[] |
marker | region text such as Sony Computer Entertainment Inc. for North America area (also Japan / Europe); not checked by the BIOS
| |
| 0x800 | t_size | image | copied to t_addr |
The field names follow the Psy-Q EXEC structure naming (pc0, gp0, t_addr...).
Recovery recipes
- Load into a disassembler: MIPS R3000 little endian, base address =
t_addr, skip the first 0x800 file bytes. Entry point =pc0. - RAM address of a file offset:
t_addr + (offset - 0x800). - BSS: create an uninitialised block at
b_addr/b_sizeif given. Many games leave it 0 and clear their BSS themselves in the startup code, so the BSS of the boot EXE (where engine globals often live) is not described by the header; see Software:Castlevania: Symphony of the Night, whose globals up to about0x80099000live in the BSS of its boot EXE. - Find the boot file: read
SYSTEM.CNFin the disc root (linesBOOT = cdrom:\SLUS_000.67;1,TCB = 4,EVENT = 10,STACK = 801FFF00, hex values, CR LF line ends); the file name is the game code with the dash turned into an underscore and the last two digits moved into the extension. Without SYSTEM.CNF the BIOS runsPSX.EXE. See Format:ISO 9660 for reading the root directory. - BIOS handling of the header: the BSS fill is a word-by-word clear, so b_addr and b_size must be multiples of 4; when s_addr is 0 the caller's stack is kept; the BIOS passes r4 = 1 and r5 = 0 and stores the caller's ra, sp, fp, gp and r16 in the reserved bytes 0x38-0x4B. (psx-spx, same section as above.)
- Other containers: Psy-Q .CPE debug executables (chunked: 00 end, 01 load data, 03 set 32-bit register used for the entry point, 08 select unit) and the rare "PS-X EXR" relocatable files of Delphine's Fade to Black are not PS-X EXE; the psx-spx document lists both.
Code & repositories
- https://github.com/Lameguy64/PSn00bSDK @
5d9aa2d3dfc7d6e51c2eb942ab4cdbae5571a40a· license: MPL-2.0 (declared by the contributor; GitHub's detector did not recognize LICENSE.md)
Open-source PlayStation SDK (MPL-2.0 core): libpsxcd ISO structures in libpsn00b/psxcd/isofs.h, EXEC struct in psxapi.h, elf2x tool that writes PS-X EXE headers.
Tested on: source read, not run: read only · checked 2026-10-18; last activity 2025-01-28; Note: the latest release ships binaries; the wiki links only the source, never the binaries - https://github.com/grumpycoders/pcsx-redux @
e58d0892c8e824bd7d5da847290f6811331215e5· license: GPL-2.0-or-later (declared by the contributor for the files used; GitHub reports GPL-2.0 for the repository)
PlayStation emulator and tooling (GPL-2.0 overall; the files read, src/supportpsx/binloader.cc, carry the MIT license): the loaders for PS-X EXE, CPE and PSF files.
Tested on: source read, not run: source read, not run: binloader.cc read from a raw file · checked 2026-10-18; last activity 2026-10-18 - https://github.com/psx-spx/psx-spx.github.io @
6d7d1bc106a7e0b616b0330fe58401ab1ba57f0f· license: none
psx-spx: the PlayStation hardware and file format documentation (docs/kernelbios.md for BIOS A/B/C tables and Exec, docs/cdromfileformats.md for PS-X EXE, SYSTEM.CNF and CPE, docs/controllersandmemorycards.md for the memory card format). No license file was found in the repository root; only facts are cited, no text copied.
Tested on: source read, not run: documentation read, nothing run · checked 2026-10-19; last activity 2026-10-19; no license: not reusable
Pitfalls
- No relocation info and no import table: library calls are direct
jalinstructions to statically linked Library:Psy-Q SDK code; BIOS calls go through theA0/B0/C0vectors (jrto0xA0,0xB0or0xC0with the function number in$t1). s_addr/s_sizeare often ignored for the boot EXE: the stack fromSYSTEM.CNF(STACK, default0x801FFF00) is used instead.- Region detection by byte: PCSX-Redux (
src/supportpsx/binloader.cc139-153) reads the byte at file offset 0x71, which is the first letter afterSony Computer Entertainment Inc. for(the text starts at 0x4C), and treatsAandJas NTSC andEas PAL. DuckStation'sGetPSExeDiscRegioncompares the marker with the full strings "Sony Computer Entertainment Inc. for North America area", "... for Japan area" and "... for Europe area", so the byte at 0x71 isNfor North America, which the PCSX-Redux byte test (A,J,E) does not match; see Fact:PS-X EXE/identification/Region marker text. Unverified: whether real North America discs carry exactly that text (read from source code only, no disc checked). - A Format:CPE (Psy-Q executable) and a PSF1 music rip (Format:PSF1 and minipsf (PlayStation Sound Format), zlib-compressed PS-X EXE inside) are loaded by the same emulator code but have different headers.
Evidence & references
- psx-spx, section "CDROM File Playstation EXE and SYSTEM.CNF".
- splat configurations of PlayStation decompilations describe the boot EXE as a 0x800-byte
headersegment followed by code at0x80010000(e.g.config/splat.us.main.yamlin the sotn-decomp repository). - PSn00bSDK (MPL-2.0), libpsn00b/include/psxapi.h:
struct EXEClists the header words from 0x10 as pc0, gp0, t_addr, t_size, d_addr, d_size, b_addr, b_size, s_addr, s_size, then sp, fp, rp, ret, base (the BIOS scratch area 0x38-0x4B). tools/util/elf2x.c writes the header as 8 bytes "PS-X EXE", 8 zero bytes, this EXEC, 64 bytes of licence text and padding to 0x800, then the image. - A debug-executable variant, the Psy-Q CPE file, and a PS-X EXR relocatable variant exist; see psx-spx "CDROM File PsyQ .CPE Files" and "Relocatable EXE".
- Related disc and media formats: Format:ISO 9660, Format:CD-ROM XA, Format:CUE and BIN, Format:TIM (PlayStation texture), Format:VAG, Format:VAB, Format:SEQ and SEP, Format:STR (PlayStation video), Format:SPU-ADPCM (PlayStation).