fix(libkernel): read compiled SDK version from process parameters #3643
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3643"
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 oguzhanozfe on 2026-10-11T14:40:27Z.
What
Implement ordinary
sceKernelGetCompiledSdkVersionusing the executable's Orbis process parameters. Null output returns EINVAL before metadata access. The unchanged bounded reader supplies the mapped prefix; the query validates minimum size and ORBI magic, then writes the low 32 bits of the actual SDK field. Missing/malformed metadata follows explicit emulator refusal and preserves output.Community shadPS4 evidence supports this ordinary subset; it is not a Sony specification. Implementation is original. Size/magic refusal is an emulator policy. Prospero behavior remains unchanged.
Tested
Windows, MinGW GCC 15.2.0, Release: fresh libs-only builds of libc, libkernel and NID patcher, plus two focused tests. Tests cover zero/high SDK bits, guaranteed unaligned pointers/canaries, null and refusal paths, u64 size width/exact magic, and the actual
.procparreader with malformed RVA. Static provider exports changed from 900 to 901; the ordinary NID binds the same function RVA as the named export. One tools-disabled public-source Claude audit reported no material query bug; scoped fixture additions passed affected checks. The PE fixture uses GNU named-section attributes in double-bracket syntax; that syntax-only correction was separately compiled and tested against unchanged candidate providers.Independent verification reran both focused executables and the static export checks successfully. A process-test PATH setup failure before test entry was preserved, then the exact registered CTest environment passed. Full default builds, Linux reader integration, other compiler/unwind configurations and game applicability are untested.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T14:40:49Z.
Progress report (
43e3a70→6eb81da)➖ System libraries: 87.87% (+0.0%, +1 implemented functions)
✅ 1 implemented
sceKernelGetCompiledSdkVersion_nid_postfixImported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T15:19:49Z.
Independent pre-review on Linux (full CI runs only happen on manual trigger, so recording one): CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON.tools/check_conventions.py --base origin/mainpasses.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:16:03Z.
Which title calls
sceKernelGetCompiledSdkVersion? With the title ID and the log line where it stops on main this can go in; otherwise I'll close it until one does. It throws unless the process parameters carry theORBImagic, so please check it against that title's block too.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T20:46:36Z.
Review: CHANGES_REQUESTED
Thanks for the PR. Not merging yet:
sceKernelGetCompiledSdkVersionand where it stops onmain. That is still unanswered. Please give the title ID (PPSAxxxxx) and the log line frommain, and say whether that title's process parameters carry theORBImagic, since the function throws otherwise.0x10SDK field offset and thesize >= 0x40/ORBIcheck come only from shadPS4 (PS4). Please say what supports them for PS5 process parameters (a title's block, or another source), and add that to the PR.compiled_sdk_version_processis Windows-only, so Linux CI only runs the test with a replaced reader. A Linux-reachable test of the real reader path would cover the Linux behaviour.Happy to re-review once the title evidence is in.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T07:41:32Z.
Review: CHANGES_REQUESTED
Thanks for the Linux reader test in
6eb81da; that covers the last point of the previous review. Two points are still open and block the merge:sceKernelGetCompiledSdkVersion, and what is the log line where it stops onmain? Does that title's process parameters block carry theORBImagic? The function throws otherwise.0x10SDK field offset and thesize >= 0x40/ORBIchecks are sourced only from shadPS4 (PS4). Please add what supports them for PS5 process parameters (a title's block or another source) to the PR body.Without a title that needs it, this will likely be closed as unneeded; happy to re-review once the evidence is in.
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T08:07:32Z.
Tested on Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release: this PR merged onto
mainc080fc2d5(no conflict).compiled_sdk_versionandcompiled_sdk_version_processbuild and pass with the PR (0.02 s and 0.03 s).CompiledSdkVersion.cppis a new file, so there is nomainversion to take it back to; the tests callsceKernelGetCompiledSdkVersion_nid_postfix, which the PR adds.Not tested: Linux, a console, a title run, the ELF fixture script (
CompiledSdkVersionElfFixture.py; I did not run Python fixtures here).AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-13T11:11:09Z.
Linux validation (Ubuntu 24.04, GCC 13.3, Release), this PR's commits on
mainat77b9f7270:compiled_sdk_versionandcompiled_sdk_version_processboth pass, the latter exercising the Linux process reader. A run againstmain's sources is not applicable here, since the tests buildCompiledSdkVersion.cpp, which this PR adds.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:39:45Z.
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.
Pull request closed