How echostretch/kstuff works
This repository provides PS5 kernel debugging and patching components, a kernel payload with syscall/trap handling, a user-mode payload loader, and a firmware-porting tool. The principal workflow is to use the porting tool against a PS5 target to gather/debug firmware information and prepare payload artifacts; the kernel payload then handles traps and routes supported syscalls to features such as SELF/FPKG handling and syscall fixes. The graph also includes the GDB/debugging layer and the Capstone x86 interface. Connections are limited to those shown in excerpts or the SOURCE INDEX; several implementation details are unsampled.
Main entry points: main.c Kernel Payload · main.py Porting Tool · r0gdb.h R0GDB Core · dbg.h GDB API
Components 21
Firmware Porting
- Porting Tool
ps5-kstuff/porting_tool/main.py - GDB RPC
ps5-kstuff/porting_tool/gdb_rpc.py - Trace Utilities
ps5-kstuff/porting_tool/traces.py - SELF Builder
ps5-kstuff/porting_tool/make_fself.py
Kernel Debugging
- R0GDB Core
prosper0gdb/r0gdb.h - R0GDB Entrypoint
prosper0gdb/main.c - GDB Stub
gdb_stub/main.c - GDB API
gdb_stub/dbg.h - Trap State
gdb_stub/trap_state.h - Firmware Offsets
prosper0gdb/offsets.h
PS5 Payload
- Payload Loader
ps5-kstuff-ldr/main.c - Kernel Payload
ps5-kstuff/main.c - uELF Trap Handler
ps5-kstuff/uelf/main.c - Parasite Handling
ps5-kstuff/uelf/parasites.h - uELF Structures
ps5-kstuff/uelf/structs.h - Parasite Descriptors
ps5-kstuff/uelf/parasite_desc.h
System Interfaces
- PS5 Syscall Map
lib/syscalls-ps5.py - Capstone x86 API
freebsd-headers/capstone/x86.h - Capstone Platform API
freebsd-headers/capstone/platform.h
Other components
- Engineer
- PS5 Target
Connections 18
- Engineer → Porting Tool: runs
ps5-kstuff/porting_tool/main.py - Porting Tool → GDB RPC: uses RPC
ps5-kstuff/porting_tool/main.py - Porting Tool → Trace Utilities: uses traces
ps5-kstuff/porting_tool/main.py - Porting Tool → SELF Builder: uses builder
ps5-kstuff/porting_tool/main.py - Porting Tool → PS5 Target: connects to
- Payload Loader → Kernel Payload: loads payload
- Kernel Payload → R0GDB Core: initializes
ps5-kstuff/main.c - Kernel Payload → Firmware Offsets: uses offsets
ps5-kstuff/main.c - Kernel Payload → GDB API: uses API
ps5-kstuff/main.c - Kernel Payload → uELF Structures: includes types
ps5-kstuff/main.c - Kernel Payload → Parasite Descriptors: uses descriptors
ps5-kstuff/main.c - uELF Trap Handler → Parasite Handling: includes handler
ps5-kstuff/uelf/main.c - uELF Trap Handler → Parasite Descriptors: includes types
- R0GDB Entrypoint → GDB API: uses API
prosper0gdb/main.c - R0GDB Entrypoint → R0GDB Core: initializes
prosper0gdb/main.c - GDB Stub → GDB API: uses API
gdb_stub/main.c - R0GDB Core → Trap State: uses state
prosper0gdb/r0gdb.h - Capstone x86 API → Capstone Platform API: includes
freebsd-headers/capstone/x86.h