Skip to content

fix(libSceSystemService): answer sceSystemServiceParamGetString's errors and padding as measured on a PS5 - #8734

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
orezraey:fix/systemservice-param-string-measured-ps5
Oct 21, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
orezraey:fix/systemservice-param-string-measured-ps5

Conversation

@orezraey

@orezraey orezraey commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What

sceSystemServiceParamGetString threw for every parameter other than the system name (6) and for buffers of 1 to 64 bytes, and wrote only the 4 bytes of PS5. Five titles import it: PPSA26344 calls it with parameter 6 and a 65-byte buffer, and PPSA28319, PPSA99109, PPSA21297 and PPSA28002 import it.

In a payload process on a PS5 (firmware 13.60):

Call Payload process, firmware 13.60 main before this PR here now
parameter 6, buffer of 0 to 64 bytes 0x80A10003 (SYSTEM_SERVICE_ERROR_PARAMETER), nothing written 0x80A10003 for 0, throws for 1 to 64 0x80A10003, nothing written
parameter 6, buffer of 65, 66, 128 or 300 bytes 0; the name, then NUL bytes up to the buffer size, nothing past it 0; PS5 and its terminator, the rest untouched 0; PS5, then NUL bytes up to the buffer size
parameters 0 to 40 (6 excepted), 100 to 110, 1000 to 1010, −1 and INT_MAX, 65-byte buffer 0x80A10003, nothing written throws 0x80A10003, nothing written
null buffer, any size or parameter 0x80A10003 0x80A10003 for parameter 6 0x80A10003

No initialisation call was needed; sceSystemServiceInitialize is not exported.

The name stays the fixed PS5. The console returned its own user-set name, which is not logged here; the log masks it.

Parameters between those tried are assumed to fail the same way, and the debt entry says so.

Debt: the sceSystemServiceParamGetString entry in docs/dev/debt/libSceSystemService.md now records the measured errors and padding, and which parameters were tried.

How the console was measured

  • Setup:
    • The console runs firmware 13.60 and is jailbroken.
    • The probes are ELF payloads built with ps5-payload-dev/sdk v0.44 and clang 18.1.8 and started through elfldr, so they ran in a payload process, not in a title.
  • Provenance: libSceSystemService.sprx was loaded with dlopen, and sceSystemServiceParamGetString was taken from it with dlsym.
  • Method:
    • The buffer is filled with 0xAA, and the probe counts the bytes that changed, where the first NUL is, and whether anything past the given size changed.
    • sysparam2 also dumps the bytes after the name.
    • The console's name is printed masked (letters as x, digits as 9).
  • Files: the probe sources and the full logs are in this gist, with each probe's main.c renamed <probe>_main.c.
Console output (excerpt, lines copied unchanged)
sysparam: meta fw=0x13600007 pid=129 sdk=v0.44 compiler=Clang 18.1.8 built=Oct 20 2026 19:08:39 log=/data/anyps5-probes/sysparam.log
sysparam: resolve sym=sceSystemServiceParamGetString handle_of=libSceSystemService.sprx exported=yes
sysparam: case id=6 size=0 ret=0x80a10003 changed=0 last_changed=0 written_beyond_size=0 nul_at=-1 text_masked=""
sysparam: case id=6 size=1 ret=0x80a10003 changed=0 last_changed=0 written_beyond_size=0 nul_at=-1 text_masked=""
sysparam: case id=6 size=64 ret=0x80a10003 changed=0 last_changed=0 written_beyond_size=0 nul_at=-1 text_masked=""
sysparam: case id=6 size=65 ret=0x00000000 changed=65 last_changed=65 written_beyond_size=0 nul_at=7 text_masked="xx9-999"
sysparam: case id=6 null_buffer size=65 ret=0x80a10003
sysparam: case id=1000 null_buffer size=65 ret=0x80a10003
sysparam: case id=0 size=65 ret=0x80a10003 changed=0 last_changed=0 written_beyond_size=0 nul_at=-1 text=""
sysparam: case id=1 size=65 ret=0x80a10003 changed=0 last_changed=0 written_beyond_size=0 nul_at=-1 text=""
sysparam: case id=7 size=65 ret=0x80a10003 changed=0 last_changed=0 written_beyond_size=0 nul_at=-1 text=""
sysparam: case id=40 size=65 ret=0x80a10003 changed=0 last_changed=0 written_beyond_size=0 nul_at=-1 text=""
sysparam: case id=100 size=65 ret=0x80a10003 changed=0 last_changed=0 written_beyond_size=0 nul_at=-1 text=""
sysparam: case id=1000 size=65 ret=0x80a10003 changed=0 last_changed=0 written_beyond_size=0 nul_at=-1 text=""
sysparam: case id=-1 size=65 ret=0x80a10003 changed=0 last_changed=0 written_beyond_size=0 nul_at=-1 text=""
sysparam: case id=2147483647 size=65 ret=0x80a10003 changed=0 last_changed=0 written_beyond_size=0 nul_at=-1 text=""
sysparam2: case id=6 size=65 ret=0x00000000 name_length=7 after_name_zero=58 after_name_other=0 changed_beyond_size=0
sysparam2: case id=6 size=66 ret=0x00000000 name_length=7 after_name_zero=59 after_name_other=0 changed_beyond_size=0
sysparam2: case id=6 size=128 ret=0x00000000 name_length=7 after_name_zero=121 after_name_other=0 changed_beyond_size=0
sysparam2: case id=6 size=65 bytes_after_name hex=000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Tested

Build: Windows 11 x86-64, WinLibs MinGW-w64 GCC 15.2.0 (posix-seh, ucrt, r7), -DBUILD_TESTING=ON, on main e25333e.

Tests: guest_system_service passes. It now checks:

  • every buffer size from 0 to 64;
  • the parameters −1, 0, 1, 5, 7, 40, 100, 1000 and INT_MAX, plus the language parameter;
  • that a failed call leaves a 130-byte buffer untouched;
  • that a 68-byte call writes PS5, NUL bytes up to byte 68, and nothing past it.

Old code, new test: with Export.cpp reverted to main, guest_system_service aborts with sceSystemServiceParamGetString: buffer shorter than 65 bytes not implemented.

Not run here: Linux and macOS.

Console: behaviour measured on a PS5 (firmware 13.60), as described above.

Overlaps: tools/pr_overlap.py lists #7965 and #8651, which change the neighbouring lines of docs/dev/debt/libSceSystemService.md (sceSystemServiceParamGetInt and another entry). Neither changes sceSystemServiceParamGetString.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none known (PPSA26344 already runs with its 65-byte buffer; the other importers were not run)
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

…ors and padding as measured on a PS5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Progress report (e25333e → 4b8f05e)

📈 System libraries: 63.98% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceSystemService sceSystemServiceParamGetString

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the current diff and the attached probe results. The implementation matches the measured behavior: only parameter 6 succeeds, undersized buffers and invalid parameters are rejected without writes, and successful calls NUL-pad exactly the caller-provided extent. Regression tests cover the 0–64 boundary, untouched failure buffers, and no writes beyond the supplied size. The author reports the focused Windows test passing, and conventions/intake/eligibility/labels checks are green; hosted platform build/test jobs are skipped, with no Linux/macOS run reported. The console evidence comes from a payload process on firmware 13.60, not a title process. Approval is based on that evidence and the focused diff. AI-assisted review.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 7965 docs/dev/debt/libSceSystemService.md L17-18
PR 8651 docs/dev/debt/libSceSystemService.md L16-17

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 6044 core/libs/tests/GuestSystemService.cpp
PR 7201 core/libs/prx/libSceSystemService/Export.cpp
PR 8354 core/libs/prx/libSceSystemService/Export.cpp
docs/dev/debt/libSceSystemService.md

@oneandonlydean
oneandonlydean merged commit 2d5b705 into boykopovar:main Oct 21, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants