feat(libSceAppContent): expand /download0 and give the shrink exports their size argument #18116
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18116"
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 eliasbruno124-dev on 2026-11-10T13:36:48Z.
What
Call of Duty: Modern Warfare III (PPSA01649, 01.055.000) stops 11 s after its start with
sceAppContentDownload0Expand not implemented. The export was declared without parameters and threw, likesceAppContentDownload0Shrink,sceAppContentDownload1ShrinkandsceAppContentDownload2Shrink; their debt entry said that the signatures were unknown.Two sources now give the signature:
libSceAppContent.sprxin thefakelib/directory of that dump (SHA-256b3e8cbe8f324ca1b9e0e9698311c269d92cd139365a82e2af4aeacd9a7a3affd, firmware not established, read from disassembly).Download0Shrink,Download0Expand,Download1ShrinkandDownload1Expandhave one shape: returnNOT_INITIALIZED(0x80d90001) when the library is not initialized, otherwise storerdias an 8-byte value and forward it as the only input of a service request (commands0x2001fto0x20022), returning the service's result.Download2ShrinkandDownload2Expand(0x20023,0x20024) do the same and returnPARAMETERfor 0 before the request.0x1952318: it holds a size in GiB (0, 20, 30, 40 or 50), shifts it left by 10 and passes it inrdi; it callsDownload0Expandwhen the size it measures is smaller,Download0Shrink(0x195233a) when it is larger, requires 0, and after0x80d90008retries the expansion.sceAppContentDownload0Expandtherefore takes a size and, after the initialization check, raises the/download0quota to that many MiB, assceAppContentDownload1ExpandandsceAppContentDownload2Expandalready raise theirs;sceAppContentDownloadDataGetAvailableSpaceKbreports the larger of that and the title'sdownloadDataSize. A size of 0 throws, because the module sends it to the service and the answer is unknown. The three shrink exports get their size parameter and the checks the module makes, and still throw where the service starts: what shrinking does to stored data is not known.Open points are in the debt file: the unit is taken from one title's call site, nothing here is measured on a console, the model never answers
0x80d90008, and dlc_emu declares a mount point for these exports, which the call site (an integer no larger than 51200) contradicts. The module does not checkDownload1Expand's size for 0 either, while this library answersPARAMETERthere; that is recorded and left unchanged. The "pending exports" entry is removed, since its three exports now have signatures.Tested
Windows 11 Pro 10.0.26300, MSYS2 UCRT64 GCC 16.2.0-6, Release. Current head
974994eb4ais the reviewed78586d76darebased ontomain439f320158on 2026-11-12, after #17955 merged; the only conflict was indocs/dev/debt/libSceAppContent.md, where #17955's new entry and this branch's edited entry both stay, andgit range-diffshows no other change. Full build of that head, nothing else merged.guest_appcontentand the seven otherguest_appcontent_*tests pass in 3 of 3 runs on974994eb4a. The extendedGuestAppContent.cppcovers:NOT_INITIALIZEDfrom the five changed exports before initialization;/download0reporting 0 KB before an expansion;Download0Expand(0)throwing and leaving the quota at 0; an expansion to 2 MiB reporting 2047 KB beside a 9-byte file; a later smaller expansion changing nothing; the file surviving; the three shrink exports throwing after their checks andDownload2Shrink(0)returningPARAMETER. The new calls pass an argument, whichmain's parameterless declarations of three of these exports do not accept.python tools/check_conventions.py --base origin/mainandgit diff --checkpass.Title runs of PPSA01649 01.055.000 on the same machine (NVIDIA GeForce RTX 3060 Laptop GPU, driver 621.01), converted with
relinker --windows --to-intel --registry --module-dir ., no input. They were made on 2026-11-10 with the earlier head78586d76daonmain39bac5d055and were not repeated after the rebase:main39bac5d055with #18086: the run ends after 11 s withsceAppContentDownload0Expand not implemented./download0/xpak_cachefiles and ends after 16 s withsceHttp2SendRequestAsync not implemented, which #11630 implements.b17933dfd4) and #17570 (06457e01f1) merged: no stop within the 150 s limit; the window shows the intro video, 1,205 presents in 137 s.These runs show how far start-up gets. No frame rate is claimed, and the menu and the size the title measures after the expansion were not checked.
Not tested: Linux and macOS, a console, and any other title that imports these exports.
Overlap: of the 1,990 open pull request heads fetched on 2026-11-10, five changed a file this branch changes. #17955 and #16591 have merged since and are part of the base now. #16797 has been closed. #13589 merged cleanly with this branch in a trial merge (
git merge-tree) on 2026-11-10; #14212, which reformats every debt file, conflicts withmain. #18516 and #18598, opened on 2026-11-11, guard output pointers of other exports in the same file and conflict withmainthemselves. None of them implements these exports.tools/pr_overlap.py --branchdid not finish on this partial clone (dropped connections), so this comes from the file lists of the fetched heads and the overlap comment below.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)sceAppContentDownload0Expand; not playability)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-10T20:27:00Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
78586d76da:tools/check_conventions.pypassed;git diff --checkclean.guest_appcontent_testsbuilt cleanly.guest_appcontent_download_0,guest_appcontent_download_1,guest_appcontent_download_18014398509481983,guest_appcontent_download_18014398509481984,guest_appcontent_download_18446744073709551615,guest_appcontent,guest_appcontent_license,guest_appcontent_entitlements):Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-11T18:53:18Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
78586d76da:tools/check_conventions.pypassed;git diff --checkclean.guest_appcontent_testsbuilt cleanly.guest_appcontent_download_0,guest_appcontent_download_1,guest_appcontent_download_18014398509481983,guest_appcontent_download_18014398509481984,guest_appcontent_download_18446744073709551615,guest_appcontent,guest_appcontent_license,guest_appcontent_entitlements):core/libs/prx/libSceAppContent/Export.cpp,core/libs/prx/libSceAppContent/include/Api.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T23:08:11Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
2c2efdb76b:tools/check_conventions.pypassed;git diff --checkclean.guest_appcontent_testsbuilt cleanly.guest_appcontent_download_0,guest_appcontent_download_1,guest_appcontent_download_18014398509481983,guest_appcontent_download_18014398509481984,guest_appcontent_download_18446744073709551615,guest_appcontent,guest_appcontent_license,guest_appcontent_entitlements):core/libs/prx/libSceAppContent/Export.cpp,core/libs/prx/libSceAppContent/include/Api.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me