mirror of
https://github.com/Pharaoh2k/ps5debug-NG.git
synced 2026-10-22 11:53:13 -05:00
Makes the "initial" 8-13.x support from v1.2.5 actually functional. HW-validated on FW 8.xx, 9.xx, 10.xx and 12.xx (all watchpoint types, breakpoints, title id, content id, version etc.). FW-agnostic by design; 11/13.x are lower-risk but not tested. Memory write (poke) on FW >= 8.40: - mdbg write op (0x13) is kernel-gated with EPERM on FW >= 8.40, so pokes failed. Route writes through a DMAP page-table walk (kernel_copyin on the physical alias) on FW >= 8.40; mdbg stays the path on < 8.40 and as a fallback. - PROC_ALLOC pre-faults its pages so writes land on freshly-allocated demand-zero memory. Breakpoints / watchpoints on FW 9.x-13.x: - Extend the kernel-dbreg allowlist to 9.00-13.20; HW BP/WP were silently no-oping on 9.x+. - SW (INT3) breakpoints write the 0xCC via the DMAP path (mdbg rejected it on FW >= 8.40). - Clear DR6 after each debug exception: FW 11/12 stops re-delivering a HW BP/WP trap after a few hits when the sticky DR6 status is left set; plus re-arm the debug regs for data watchpoints. Game ID / Content ID / Version - firmware-agnostic: - Resolve title id and content id by pattern-scanning the proc struct instead of per-FW offsets (which shifted at 8.x and 12.x). - Foreground-app command resolves the title id robustly so the param.sfo game version reads correctly on 12.x. Console crash on client disconnect (SIGPIPE): - Closing the client mid-operation raised SIGPIPE in the server thread and killed the host SceShellCore. Suppress it: MSG_NOSIGNAL on sends + SO_NOSIGPIPE on the sockets. Load notification now shows the running firmware version, and the credits line was updated. Documentation: - Rewrote PROTOCOL.md against the v1.2.6 sources (commands, packet structs, status/bit-swap semantics, scan/xref wire formats, enums). - Corrected and expanded README: per-release firmware support table with verification status, and accuracy fixes throughout. Bump version 1.2.5 to 1.2.6.
40 lines
1.1 KiB
C
40 lines
1.1 KiB
C
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#include <ps5/kernel.h>
|
|
#include "proc_field_offsets.h"
|
|
|
|
int proc_get_field_offsets(struct proc_field_offsets *out)
|
|
{
|
|
static int cached = 0;
|
|
static struct proc_field_offsets c;
|
|
|
|
if (!cached) {
|
|
uint32_t fw = kernel_get_fw_version() & 0xffff0000u;
|
|
|
|
c.name = fw >= 0x12000000u ? 0x5E4u :
|
|
fw >= 0x10000000u ? 0x5DCu :
|
|
fw >= 0x7000000u ? 0x5D4u :
|
|
fw >= 0x6000000u ? 0x5C4u : 0x59Cu;
|
|
|
|
c.path = fw >= 0x12000000u ? 0x604u :
|
|
fw >= 0x10000000u ? 0x5FCu :
|
|
fw >= 0x7000000u ? 0x5F4u :
|
|
fw >= 0x6000000u ? 0x5E4u : 0x5BCu;
|
|
|
|
c.titleid = fw >= 0x8000000u ? 0x470u :
|
|
fw >= 0x7000000u ? 0x49Au :
|
|
fw >= 0x6000000u ? 0x498u : 0x470u;
|
|
|
|
c.contentid = fw >= 0x12000000u ? 0x504u :
|
|
fw >= 0x8000000u ? 0x4F4u :
|
|
fw >= 0x7000000u ? 0x4FCu :
|
|
fw >= 0x6000000u ? 0x4ECu : 0x4C4u;
|
|
|
|
c.known = 1;
|
|
cached = 1;
|
|
}
|
|
|
|
*out = c;
|
|
return 0;
|
|
}
|