Files
Gary Riches e225e02256 PS5 DevTools: crash reports and memory graphs for PS5 homebrew
A resident payload that attaches to homebrew titles as their debugger,
writes a crash report (registers, every thread's backtrace, stack,
modules, code at the fault, memory before the crash) and shows a TV
notification, then hands the signal back. It samples every title's
memory (direct/GPU, heap, other), CPU and threads, and serves a
dashboard on port 9113. The host tool symbolicates reports against the
matching build's ELF, including reports a player sends as JSON.

Tested on firmware 13.60 with Super Mario Sunshine and SwitchWaker.

Claude-Session: https://claude.ai/code/session_016xMYBaR9GfxtETyVf6er1P
2026-10-14 15:50:36 +01:00

28 lines
1.1 KiB
C

// Which processes have the audio and video-out libraries loaded (read-only).
#include "common.h"
int main(void)
{
g_log = fopen("/data/devtools-probe.log", "w");
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PROC, 0};
size_t size = 0;
sysctl(mib, 4, NULL, &size, NULL, 0);
size += 16384;
char *buf = malloc(size);
sysctl(mib, 4, buf, &size, NULL, 0);
static const char *const libs[] = {"libSceAudioOut.sprx", "libSceAudioOut2.sprx", "libSceVideoOut.sprx", "libSceAgc.sprx"};
for (char *p = buf; p < buf + size;) {
struct kinfo_proc *ki = (struct kinfo_proc *)p;
p += ki->ki_structsize;
app_info_t ai;
if (sceKernelGetAppInfo(ki->ki_pid, &ai)) memset(&ai, 0, sizeof ai);
char line[256] = "";
for (unsigned l = 0; l < 4; l++) {
uint32_t h;
if (kernel_dynlib_handle(ki->ki_pid, libs[l], &h) == 0) { strcat(line, " "); strcat(line, libs[l]); }
}
if (line[0]) say("pid %d appid %04x %s:%s", ki->ki_pid, ai.app_id, ki->ki_comm, line);
}
say("done");
return 0;
}