feat(libSceContentExport): local checks for GetProgress, ValidateContents and two exports #27221
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27221"
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 zaryabzip on 2026-11-25T14:22:41Z.
What
Four
libSceContentExportexports now run the local checks that come before the content-management service, following firmware 9.20. Onmainall four throw for any call:sceContentExportValidateContentsalways, and the other three after the session lookup. A title that pollssceContentExportGetProgresson an idle session now gets 0 (SDK 6.00 and up) or0x809D3002instead of an abort.Source. @noisyweather's reading of firmware 9.20's
libSceContentExport.sprxon #25863 (comment). It is disassembly only, not measured on a console. Addresses below are from that reading.ValidateContents(ids, count)0x809D3004, with no SDK exception;count > 0x100→0x809D3016; nullidswithcount != 0→0x809D3016;count == 0→ 0GetProgress(id)idabove 9 unsigned →0x809D3016; empty slot →0x809D30160x809D3002below SDK 6.00; ended: 100, or0x809D3002below SDK 6.00FromFileWithTitleIdListidabove 9; nullparam, source or thumbnail →0x809D3016; thumbnail length outside 1–0x400 →0x809D3016; non-null list with length outside 1–15000 →0x809D3016;param+0x101not all zero →0x809D3016; empty slot →0x809D30160x809D3012, and the session is ended; otherwise throwsFromDataWithThumbnailidabove 9; nullparamor either callback param →0x809D3016;param+0x101not all zero →0x809D3016; empty slot →0x809D3016; either callback length 0 or provider null →0x809D3016, state unchanged0x809D3012; at SDK 4.00 and up, thumbnail type null or not exactlyimage/jpeg→0x809D3019. Both end the session; otherwise throws"Init gate" is
0x809D3004while not initialized, skipped when the caller's SDK is below 4.00. This is the same gatesceContentExportFromDataalready has.Change (
Export.cpp):Start, or ended after one of the failures above. The reading's state 2 ("last export ended, success or failure") is whatGetProgressreports as 100. Its probe list has the same step (T5: atext/plainexport, thenGetProgress→ 100).video/mp4,image/jpeg,image/png,image/gif, andvideo/webmin a PS5 process.sceContentExportFromDatakeeps its own check, which this reading doesn't cover.param+0x101is thecommentfield ofContentExportParam.sceContentExportFromDatamarks its session as run.GetProgressthrows for such a session, because this reading doesn't cover FromData's state changes.Not done. Each of these needs the service or files, so these paths still throw:
sce_name and JSON checks;The data export's subtype check isn't needed: every accepted content type already passes it.
Debt. Following the fragment rule, this adds
docs/dev/debt/changes/feat-content-export-progress-checks.md. It drops theGetProgressandFromDataWithThumbnailsentences from the "Content export sessions" entry, and adds a Functional entry for the four exports. That entry covers what is still missing, thecommentmapping, and the0x809D3016/0x809D3019host-safety fallbacks for unreadable params and strings. The fragment folds cleanly withmain's pending fragments and in isolation.Test (
GuestContentExport.cpp, ctestguest_content_export). New rows:Init:GetProgressandValidateContentsgive0x809D3004. At SDK 3.00 the gate is skipped, soGetProgress, the title-id export and the data export give0x809D3016, whileValidateContentsstill gives0x809D3004.Init, beforeStart:GetProgress(0)→0x809D3016.ValidateContentsgives 0 for(NULL, 0),0x809D3016for(NULL, 1)and for 257 ids.GetProgress→ 0, and0x809D3002at SDK 5.00.0x809D3016.0x809D3016, after which the session still reports 0.image/pngthumbnail type →0x809D3019, thenGetProgress→ 100, and0x809D3002at SDK 5.00.image/jpegsthumbnail type →0x809D3019.text/plainand an unterminated content type →0x809D3012, thenGetProgress→ 100.0x809D3004or0x809D3016. Rows that would need the service are left out.Tested
2edb799778. Windows 11 Home 25H2 (26200.9974), i7-11800H, WinLibs GCC 15.2.0 r7 UCRT, CMake 4.3.1, Ninja 1.13.2, Release,BUILD_TESTING=ON, onmain098c73473f.guest_content_exportpasses. The build has no warnings.main'sExport.cppwith the branch's test. It aborts (0xc0000409) atGuestContentExport.cpp:207, the first new row, withsceContentExportGetProgress: not initialized.Export.cppandGuestContentExport.cppbuilt with Apple clang (C++20) against stub guest-copy and process-parameter functions. The head passes. Control:main'sExport.cppaborts at the first new row (GetProgressbeforeInit, which throws onmain).git merge-treefinds no conflict withmain(098c73473f) or with any open PR that merges withmain. That includes #26967, which also edits thisExport.cpp.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T14:49:09Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed code and focused test coverage support the added local checks.
What I ran
Reviewed head
2edb7997789d5aa3a34e2904b3b0a2cf47443e82usingrepo_read.pyto inspect the prepared description, commit summary, manifest, diff, and changed source and test files. I did not run commands or tests. The description reports a macOS arm64 stub build and says Windows was not run; those are author-reported results.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The PR description, commits, manifest, diff,
core/libs/prx/libSceContentExport/Export.cpp,core/libs/tests/GuestContentExport.cpp, and the new debt fragment were read. No files were excluded inmanifest.json. The external firmware disassembly source and physical-console behavior were not independently verified. No tests or builds were run in this review.To get this to a good state
Nothing is required.