feat(libSceSystemService): implement sceSystemServiceGetPlatformPrivacySetting #20896
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20896"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by simnJS on 2026-11-15T17:44:44Z.
What
Implements
sceSystemServiceGetPlatformPrivacySetting, which threw. Knowledge is Power: Decades (CUSA12435) calls it (discussion #9718, where the call-site evidence for this export was asked for). This PR brings the library's side of the contract instead:libSceSystemService.sprxof firmware 13.60, from my own console, exporthvoLYhc4cq0at0x2970(0xa0 bytes), read from disassembly and not measured on a console. The module isn't attached.What the module does, and what this PR does:
rdi, kept inrbx), and always returns 0 (xor %eax,%eaxon the only exit).sceKernelIsPs4Process; unless that returns 1 it returns without writing through the pointer.SceUserServiceCommonEventFlagwithsceKernelOpenEventFlag. If that fails it stores 0 (after aprintfof the error, which this PR does not reproduce).sceKernelPollEventFlag(flag, 1, 2, NULL)(bit 0, wait mode OR, no clear), closes the flag, and stores 1 when the poll returned 0, else 0. The store is 32 bits wide (mov %r12d,(%rbx)).The implementation calls the same four kernel exports, so it follows whatever AnyPS5's event flags do.
libSceSystemServicenow linkslibkernel_sysforsceKernelIsPs4Process, aslibSceAudio3ddoes.Not established: nothing in AnyPS5 creates
SceUserServiceCommonEventFlag(the console's system owns it), so a PS4 title always reads 0 here; the value the console reports and what 0 and 1 mean are unknown. The CUSA12435 call site was not read by me (I don't own the title), so which value the title needs is not shown. Both are in the debt fragment.Tested
Windows 11, MinGW-w64 GCC 15.2.0, on head
6aa2186b0c85d837746e24f5e599c2af39b4bc14, based onmainatb7aeb6f40619e03f03fed9a68d6be24176bec8c8.guest_system_service_platform_privacy_setting(ps4andps5cases, title ID fromapp0/sce_sys/param.json) has only been compiled with-fsyntax-only; I am relying on the Windows job of this PR to build and run it, and will fix it here if it fails.g++ -std=c++20 -fsyntax-only -Wall -Wextra -I core/libspasses forcore/libs/prx/libSceSystemService/PendingExports.cppandcore/libs/tests/GuestSystemServicePlatformPrivacySetting.cpp(only the existing unused-parameter warnings of the other stubs).sceKernelSetEventFlagandsceKernelClearEventFlag.python3 tools/debt_fold.py --checkpasses.python3 tools/check_conventions.py --base origin/mainwith this title and description:All conventions checks passed.pr_overlapcannot finish on my shallow clone (merge-basefails). A search of all pull requests forsceSystemServiceGetPlatformPrivacySettingreturns none.Not run on a console. Not run with CUSA12435.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)AI assistance: written with Claude Code, model Claude Mythos 5.2 (
claude-mythos-5-2), which read the disassembly, wrote the code and the test and ran the checks above on my machine.Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-16T02:08:57Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
6aa2186b0c:tools/check_conventions.pypassed;git diff --checkclean.guest_system_service_platform_privacy_setting_testsbuilt cleanly.guest_system_service_platform_privacy_setting_ps4,guest_system_service_platform_privacy_setting_ps5):core/libs/prx/libSceSystemService/PendingExports.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.GuestCopyOut_nid_no_patchanderrnopreservation incore/libs/prx/libSceSystemService/PendingExports.cpp.sceSystemServiceGetPlatformPrivacySettingincore/libs/prx/libSceSystemService/PendingExports.cpp:1799-1809for pointer safety and compliance with the maintainer's requested changes.core/libs/tests/GuestSystemServicePlatformPrivacySetting.cppfor coverage ofPS4/PS5 process paths, event flag bit patterns, and invalid output pointers.core/libs/prx/libSceSystemService/CMakeLists.txtfor proper linking oflibkernel_sysand test target setup across Linux and Windows.docs/dev/debt/changes/feat-system-service-platform-privacy-setting.mdfor technical debt fragment compliance.core/libs/prx/libSceSystemService/PendingExports.cpp:1807:sceSystemServiceGetPlatformPrivacySettingdereferences the guest pointer directly with*setting = value;instead of copying out withGuestCopyOut_nid_no_patchwhile preservingerrno, which crashes (SIGSEGV / access violation) when a PS4 process passes a null or unmapped pointer such asnullptrorreinterpret_cast<std::uint32_t*>(0x10)and leaves the maintainer's review request (oneandonlydean) unaddressed.core/libs/tests/GuestSystemServicePlatformPrivacySetting.cpp:34-57: The PS4 test path does not exercise an invalid output pointer (such asreinterpret_cast<std::uint32_t*>(0x10)) or verify thaterrnois preserved as requested by maintaineroneandonlydean.Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T05:11:12Z.
Review: APPROVED
Reviewed — looks good
The implementation follows the described disassembly behavior, and the changed files I read show no verified defect; compilation, runtime checks, and console behavior were not independently verified.
What I ran
Read prepared diff and repository context at head
6aa2186b0c85d837746e24f5e599c2af39b4bc14usingrepo_read.py. No build or tests were run.Results
Findings
Blocking
None.
Non-blocking
Not verified
No changed files were excluded:
files.jsonwas unavailable, and the manifest lists all four changed files as included. I readcore/libs/prx/libSceSystemService/CMakeLists.txt,core/libs/prx/libSceSystemService/PendingExports.cpp(including the changed function),core/libs/tests/GuestSystemServicePlatformPrivacySetting.cpp, anddocs/dev/debt/changes/feat-system-service-platform-privacy-setting.md. I did not run the reported syntax check, debt check, conventions check, CI build/tests, or console/title behavior.To get this to a good state
Nothing is required. Optional: validate the behavior on console and with CUSA12435 when available.
Pull request closed