Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Platform:PlayStation 4

From ReverseEngineering.wiki
Platform
CPU x86-64, AMD Jaguar
Endianness little
On this wiki Facts · Code · Notes · Topics

Sony's 2013 console: an x86-64 (AMD Jaguar) CPU running the FreeBSD-based Orbis OS; executables are SELF files wrapping little-endian ELF64 files tagged with Sony e_type values 0xFE00, 0xFE10 and 0xFE18, with a PT_SCE_DYNLIBDATA segment carrying the dynamic linking data.

Overview

This page covers only the plain, publicly documented container structure as an open emulator (shadPS4, GPL-2.0-or-later) reads it from an already decrypted file. How retail files are protected is out of scope.

Executable recognition

  • Wrapper: a SELF starts with the 32-bit value 0x1D3D154F (bytes 4F 15 3D 1D). The header fields shadPS4 expects are version 0, mode 1, endian 1 (little), attributes 0x12, category 1, program type 1; then header size, meta size, file size, a segment count and 0x22 in an unknown field (src/core/loader/elf.h lines 14-32, elf.cpp 247-266). It is followed by segment headers (flags, file offset, encrypted size, decrypted size) and the ELF.
  • ELF: ELF64, little endian, OS/ABI 9 (FreeBSD), e_machine x86-64, e_type 0xFE10 (ET_SCE_DYNEXEC, the main executable with ASLR), 0xFE18 (ET_SCE_DYNAMIC, a shared library, .sprx), or 0xFE00 (ET_SCE_EXEC); 0xFE0C is a stub library type. See Format:SCE ELF extensions (PlayStation consoles).
  • SELF program types in shadPS4's program_type_es: 1 fake, 4 NPDRM exec, 5 NPDRM dynlib, 8 system exec, 9 system dynlib, 0xC host kernel, 0xE secure module, 0xF secure kernel.

Program headers

Besides PT_LOAD, PT_DYNAMIC, PT_TLS and the GNU types (PT_GNU_EH_FRAME 0x6474E550, PT_GNU_STACK 0x6474E551, PT_GNU_RELRO 0x6474E552) the loader knows PT_SCE_RELA 0x60000000, PT_SCE_DYNLIBDATA 0x61000000, PT_SCE_PROCPARAM 0x61000001, PT_SCE_MODULE_PARAM 0x61000002, PT_SCE_RELRO 0x61000010, PT_SCE_COMMENT 0x6FFFFF00 and PT_SCE_LIBVERSION 0x6FFFFF01 (elf.h 275-284).

The PT_SCE_DYNLIBDATA segment holds the data the dynamic section points into: shadPS4 copies it into a buffer and resolves DT_SCE_* d_ptr values as offsets into it (src/core/module.cpp 235-243 and 370-413). PT_SCE_PROCPARAM gives the process parameter block (SDK version, memory parameters) read by the linker (module.cpp 253-255, linker.cpp 118-141).

Dynamic tags

Sony tags 0x61000007 DT_SCE_FINGERPRINT, 0x61000009 ORIGINAL_FILENAME, 0x6100000D MODULE_INFO, 0x6100000F NEEDED_MODULE, 0x61000011 MODULE_ATTR, 0x61000013 EXPORT_LIB, 0x61000015 IMPORT_LIB, 0x61000019 IMPORT_LIB_ATTR, 0x61000025 HASH, 0x61000027 PLTGOT, 0x61000029 JMPREL, 0x6100002F RELA, 0x61000035 STRTAB, 0x61000039 SYMTAB and others (elf.h 362-383). Module and library entries are single 64-bit values: low 32 bits name offset in the string table, then version and a 16-bit id (see the fact on module and library values). Imported symbols are therefore resolved by encoded name and library ids rather than plain ELF names; STT type 11 (STT_SCE) marks module_start/module_stop symbols.

Unverified: the encoded symbol name format (base64-like text with library and module ids) is not documented here; read EncodeId and the symbol resolver in shadPS4 src/core/module.cpp.

Other pages

Similar NID-style linking on other Sony consoles: Technique:SCE NID imports and exports.

Code & repositories

See the linked repository below.

  • https://github.com/shadps4-emu/shadPS4 @ 0ebea15c24253b60f514fc37a348dabc8d0bcb90 · license: GPL-2.0
    PS4 emulator (GPL-2.0-or-later): src/core/loader/elf.h and elf.cpp show the SELF header and the ELF types, program headers and DT_SCE tags of PS4 executables; src/core/module.cpp loads PT_SCE_DYNLIBDATA and the module/library tables.
    Tested on: source read, not run: source read, not run: elf.h, elf.cpp, module.h, module.cpp read from raw files · checked 2026-10-18; last activity 2026-10-18; Note: the latest release ships binaries; the wiki links only the source, never the binaries