feat(libs): Deathloop loading support (Ampr, NetCtlApDialog + stubs) #407
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/407"
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 Pouare514 on 2026-10-02T20:33:25Z.
What
Deathloop (PPSA01670, v01.405) resolves all 931 imports, loads every module and reaches the ELF entry point. New module libSceNetCtlApDialog (network-connection dialog; no studied game imports from it yet); missing-export stubs (all throwing) for Ampr (36, including 0hlfW1O4Aa4 which Deathloop imports from libSceAmpr, IMPORT_LIB index 48), libkernel (17), Http, Json2, Net, AppContent, NpEntitlementAccess, NpManager, WebBrowserDialog and libc (3). NetCtlAp (IMPORT_LIB-only) and VrrPeg need nothing (zero imports).
Tested
Checklist
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-02T21:17:10Z.
Progress report (
ae3d5f9→998016e)📉 System libraries: 83.35% (-1.34%, +49 declared functions)
🆕 49 declared as stubs
_Cnd_init_with_name_nid_postfix_Cnd_signal_nid_postfix_Lock_shared_ptr_spin_lock_nid_postfix_Thrd_id_nid_postfix_Thrd_join_nid_postfix_Thrd_sleep_nid_postfix_Unlock_shared_ptr_spin_lock_nid_postfix_ZNKSt8time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE3getES3_S3_RSt8ios_baseRNSt5_IosbIiE8_IostateEP2tmPKcSE__nid_postfix_ZNSt4_Pad7_LaunchEPP7pthread_nid_postfix_ZNSt4_Pad8_ReleaseEv_nid_postfix_ZNSt4_PadC2Ev_nid_postfix_ZNSt4_PadD2Ev_nid_postfix_ZNSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE_nid_postfix_ZNSt8ios_base7_AddstdEPS__nid_postfix_ZNSt8time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE_nid_postfix_ZNSt8time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE7_GetcatEPPKNSt6locale5facetEPKS5__nid_postfix_ZSt16_Throw_Cpp_errori_nid_postfix_ZTVN10__cxxabiv119__pointer_type_infoE_nid_postfix_ZTVN10__cxxabiv120__function_type_infoE_nid_postfix_ZTVSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE_nid_postfix__cxa_call_unexpected_nid_postfixwcstombs_s_nid_postfixsceHttpAbortWaitRequest_ZN3sce4Json14InitParameter2C2Ev_ZN3sce4Json18InitParameterRtti216setAllocatorRttiEPNS0_14AllocParamRttiEPvsceNetCtlApDialogClosesceNetCtlApDialogGetResultsceNetCtlApDialogInitializesceNetCtlApDialogOpensceNetCtlApDialogTerminatesceNetCtlApDialogUpdateStatusswscanf_s_nid_postfixsceKernelUnknown03sceKernelUnknown04sceKernelUnknown05sceKernelUnknown06sceKernelUnknown07sceKernelUnknown08sceKernelUnknown09sceKernelUnknown10sceKernelUnknown11sceKernelUnknown12sceKernelUnknown13sceKernelUnknown14sceKernelUnknown15sceKernelUnknown16sceKernelUnknown17sceKernelUnknown18sceKernelUnknown19Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T05:44:32Z.
Thanks for the Deathloop work. Before review this needs a few changes: no comments in code (libc/Export.cpp), generic names instead of title names (libcDeathUnknown00 to 02), and the Party module looks like the game's own sys_module (the description says it is bundled as sys_module/Party.prx and nothing imports it), so I don't think it should be reimplemented here. The PR says the unknown NIDs are in TechnicalDebt, but the diff doesn't touch it. Splitting by library would also make it reviewable. Note 0hlfW1O4Aa4 is also claimed by #338 for libc.
Imported from boykopovar/AnyPS5. Originally posted by Pouare514 on 2026-10-04T14:27:51Z.
Done: comments removed from libc/Export.cpp, the three unknowns renamed to generic libcUnknown_ names, Party module removed (game sys_module, zero imports), rebased on current main, full build + 179/179 ctest green. Two notes: 0hlfW1O4Aa4 stays in Ampr — Deathloop imports it from libSceAmpr (IMPORT_LIB index 48, verified from the ELF dynamic section), and I removed the same NID from #338's libc. On TechnicalDebt: the merged #358 had its bulk unknown-NID lines stripped upstream, so I did not add a new bulk list; all stubs throw with per-library mapping in the description. Happy to split by library on request.
Imported from boykopovar/AnyPS5. Originally posted by Pouare514 on 2026-10-04T16:07:27Z.
Follow-up note: I checked all 36 Ampr unknowns against the public PS5 NID database (zecoxao/sce_symbols aerolib.csv, verified by recomputing 8/8 NIDs locally). They are almost all C/C++ runtime re-exports (localeconv, strtok_s, wcscpy_s, ctime_s, mbstowcs, asctime_s, Thrd, Cnd, num_get/time_get facets, __udivti3, etc.). Same for most NpCppWebApi unknowns (dtors/getters with full mangled names). I'll do a rename + forwarder follow-up PR once this one lands, to avoid conflicts.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T21:07:53Z.
Thanks for the changes and for the NID database check. Since the names are known now, I'd rather they go in under those names here than land as Unknown and get renamed in a follow-up. Of the 184 raw NIDs in this PR, 106 give their NID back exactly when I recompute it from the name (for example P41kTWUS3EI = scePthreadGetschedparam, oIRFTjoILbg = scePthreadSetschedparam, tQNolUV1q5A = swscanf_s). Doing the rename here also clears two clashes:
sceNetUnknown01/02, aresceNetHtonllandsceNetNtohll, which #302 implements. With both merged,nid_patcherwould fail with a duplicate export, as #405 does now on Windows.sceHttpUnknown02andsceNetUnknown01are also used by #338 for different NIDs, so the two PRs conflict in those files.The CONTRIBUTING rule for the NIDs that stay unknown still asks for TechnicalDebt entries; @boykopovar, is it fine to skip them for bulk loader stubs like these, as #358 did? Splitting by library would still make it much easier to review.
Imported from boykopovar/AnyPS5. Originally posted by Pouare514 on 2026-10-04T23:31:12Z.
Reworked per review, using hash-verified renames (every new name recomputes to its NID; my DB now pins a commit and always verifies): 151 stubs now carry their real names as plain exports without APS5_EXPORT (two that collide with host CRT declarations use the _nid_postfix form). Dropped: the 12 Ampr NIDs that #545 implements (they'll come back there with real bodies), sceNetHtonll/sceNetNtohll (merged #302 owns them), and the two Vrr NIDs from WebBrowserDialog (#518 owns them). The 17 NIDs with no database hit stay Unknown with TechnicalDebt lines. Clean libs build (nid_patcher resolves every rename, no duplicates) and 183/183 ctest green. On splitting: this is now 11 small per-file groups of mechanical renames; happy to split into per-library PRs if you'd still prefer that.
Imported from boykopovar/AnyPS5. Originally posted by Pouare514 on 2026-10-05T00:49:43Z.
Rebased onto current main (this should also restart CI, which never ran for the previous push). Two adjustments from the rebase: my sceHttpGetLastErrno/sceHttpCreateRequest2 throwing stubs are gone in favour of #555's real implementations that landed on main (same NIDs), keeping only ParseStatusLine/AbortWaitRequest from that group; and the Net file is back to main since merged #302 owns those NIDs now. libs builds clean and full ctest (221) passes locally.
Imported from boykopovar/AnyPS5. Originally posted by Pouare514 on 2026-10-05T01:07:59Z.
Linux failure root-caused and fixed: the renamed C++ runtime names (_ZTV*, methods, _Lock/_Unlock_shared_ptr_spin_lock, __cxa_call_unexpected, _Thrd/_Cnd/_Pad and friends) were exported plain, so on Linux they interposed the real libstdc++ symbols for every process linking libSceAmpr — only guest_ampr_markers and guest_crt link it, which matches the two failures exactly. They are now exported in _nid_postfix form (same NIDs, no host-visible collision), like the earlier wcstombs_s/swscanf_s cases. Verified locally with a clean libs build.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T01:18:06Z.
Thanks for the renames. I checked them all: every new name recomputes to one of the NIDs the previous head exported, nothing new was added, and the only NIDs dropped are the ones you listed (the 12 Ampr functions,
sceNetHtonll/Ntohll, the two Vrr functions, and #555's two Http functions). None of the remaining ones is exported on main. The 17 kernel NIDs aren't in the database here either, and they have their TechnicalDebt lines.The Linux CI job fails on this head, though, and I think the renames cause it:
guest_ampr_markers(from #579) aborts withstd::bad_alloc. On Linux each prx is an ELF shared object, so a plain export whose name is also a libstdc++ symbol interposes the host runtime's own definition. Eight of the new libSceAmpr names are:_ZTVN10__cxxabiv119__pointer_type_infoE,_ZTVN10__cxxabiv120__function_type_infoE,_ZTVSt12bad_weak_ptr,_ZTVSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE(vtables)_ZNSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE,_ZNSt8time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE(facet ids)_ZNSt12bad_weak_ptrD1Ev,__cxa_call_unexpectedI see the same here: main plus this PR alone makes
guest_ampr_markersabort every time, andLD_DEBUG=bindingsshows the host libstdc++ binding those eight names to the libSceAmpr stubs. Once the host's__pointer_type_infovtable resolves to a stub, a thrown exception can no longer be matched. A ten-line host program that throws and catches, linked against a .so that defines just these eight names, terminates with the samestd::bad_alloc, and without the .so it works. Windows isn't affected because PE exports don't interpose. I checked every new name in the other libraries against libstdc++, glibc, libm and libgcc_s, and only these eight collide. GCC also warns thatint __cxa_call_unexpected()doesn't match its built-in declaration. That one is on my suggestion to use the real names, sorry. The_nid_postfixform you already use forwcstombs_sandswscanf_savoids it. Also, six of the eight are data (vtables and facet ids) rather than functions, so a stub there can't throw if a title reads them. A TechnicalDebt line saying they are placeholders would cover that.One overlap:
Eu95jmqn5RwandIXW-z8pggfg(the twosce::Jsoninitializer functions in libSceJson2) are also added by #369, so whichever lands second has to drop them.With the eight names changed and CI green, it's ready to merge from my side. #545 carries this commit, so it will pick up the fix on its next rebase.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T02:47:00Z.
Sorry, my last comment crossed with your push: fd3b24e already does what I asked. All eight names I listed are now in the
_nid_postfixform, along with fifteen more C++ runtime names (_Thrd_*,_Cnd_*,_ZNSt4_Pad*, the shared_ptr spin locks and so on). The patcher strips the suffix before it computes the NID, so the NIDs haven't changed. I also checked every plain name this PR adds against what libstdc++, glibc, libm and libgcc_s export, and none of them collide now. The Linux CI job is green on this head too.#338 is on main now, and it adds ten "unknown signature" lines at the end of "Unknown function info" in docs/dev/TechnicalDebt.md, where your 17 kernel lines go. So this needs a one-line rebase: keep main's lines and add yours after them. Nothing else conflicts.
The #369 overlap is still there (
sce::Json::Initializer::initializeandInitParameter2::setFileBufferSize), so whichever of the two lands second has to drop them. After the rebase, it's ready to merge from my side.Imported from boykopovar/AnyPS5. Originally posted by Pouare514 on 2026-10-05T13:23:29Z.
Rebased onto origin/main (
53dc19cf). The only conflict was docs/dev/TechnicalDebt.md: kept main's lines (including #338's unknown-signature lines at the end of Unknown function info) and placed our 17 kernel unknown-NID lines after them. No .cpp logic changed in conflict resolution (rebase-only). Checked #369 (feat/libSceJson2): it is still OPEN, so I kept the two overlapping libSceJson2 functions (sce::Json::Initializer::initialize and InitParameter2::setFileBufferSize) in this branch — whichever of the two PRs lands second should drop them. Verified: diff vs main touches only the intended files (+899, no deletions), git diff --check is clean, no conflict markers remain, and the 17 kernel TD lines sit directly after main's lines. Force-pushed with --force-with-lease.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T05:34:03Z.
Thanks for the rebase.
docs/dev/TechnicalDebt.mdonly adds your 17 kernel lines now, none of those NIDs is defined on main, and the code commits are unchanged apart from context.It conflicts again at the end of "Unknown function info": main has since added the
_sceUlobjmgrRegisterObject,sceShareGetCurrentStatus,sceAgcDcbSet*PredicationEnableGetSizeandResource registrationlines there. Keep those and add yours after them.On the #369 overlap: #369 has been rebased too and implements
sce::Json::Initializer::initializeandInitParameter2::setFileBufferSize, while this branch has them as throwing stubs. The two branches conflict inlibSceJson2/Export.cpp, and keeping both sides there would define both functions twice. Since #369 has the real versions, could you drop these two stubs from this branch in the same rebase?Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T09:27:55Z.
Heads-up: #676 has merged and removed the host
libSceNpCppWebApireplacement, since titles ship their ownlibSceNpCppWebApi.prxand it takes precedence. When you rebase, please drop this branch'slibSceNpCppWebApichanges; the rest is unaffected, and the TechnicalDebt and #369 points above still apply.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T14:01:58Z.
Review: CHANGES_REQUESTED
This conflicts with
mainin six files again, and some of the conflicts mean dropping code, not just resolving context:core/libs/prx/libSceNpCppWebApi/Export.cpp(+565): #676 removed this module frommain(titles ship their ownlibSceNpCppWebApi.prx), as @oneandonlydean noted. Please drop the file from the branch.core/libs/prx/libSceJson2/Export.cpp: #369 has merged and definessce::Json::Initializer::initializeandInitParameter2::setFileBufferSize. Drop those two and keep only the NIDsmaindoesn't export.core/libs/prx/libSceHttp/Export.cpp:sceHttpParseStatusLineis now implemented onmain(libSceHttp/src/Parse.cpp), so the stub has to go.libSceNpEntitlementAccess,libSceNpManager: content conflicts with later merges. After the rebase, check that none of your stubs share a NID with somethingmainnow implements.docs/dev/TechnicalDebt.md: the 17 kernel lines are at the end of "Unknown function info" again, which is where everyone appends, so this keeps conflicting. Put them somewhere in the middle of the section.Once it's rebased with CI green, we'll review it again.
Imported from boykopovar/AnyPS5. Originally posted by Pouare514 on 2026-10-09T18:46:50Z.
Rebased onto current main (forced update 993ccfad...998016e7):
(a) TechnicalDebt.md: kept main's new lines (_sceUlobjmgrRegisterObject, sceShareGetCurrentStatus, sceAgcDcbSet Predication lines, Resource registration) and placed our 17 kernel unknown-NID lines after them.
(b) #369 overlap: #369 is merged with the real versions, and this branch no longer contains sce::Json::Initializer::initialize or InitParameter2::setFileBufferSize (verified on main lines 479/800/804) — no duplicates. The two Json functions this branch still adds (InitParameter2C2Ev, setAllocatorRtti) are not on main.
(c) #676: dropped the whole libSceNpCppWebApi replacement (565 lines gone); diff vs main no longer touches that file.
(d) Overlap bot: #1143 is merged but this branch never had bad_weak_ptr, so nothing to drop. #1128 is still open (formatting chore); the Json initialize overlap is gone with (b), sceHttpParseStatusLine is only added here (not on main). No Depends on added — this PR builds on nothing else.
Old-vs-new diff check: Ampr 119, AppContent 5, Http 9, Json2 9, NetCtlApDialog 38, NpEntitlement 4, NpManager 4, libc 15, kernel 102 (incl. 24 _nid_postfix lines, interposition fix intact), TD 17 — everything else identical to the reviewed head, git diff --check clean.
Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T19:43:51Z.
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
998016e7, merged ontomain8b393b6ein one build with 31 other PRs that had no Windows run.guest_offline_imports, broken by #2359 (reported there).No title was run.
🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:14:23Z.
Conventions is red only because the "Depends on: none" box is unticked; please tick it. The title and What still mention Party and the NpCppWebApi stubs, which the branch no longer adds, so please update those too.
Imported from boykopovar/AnyPS5. Originally posted by Pouare514 on 2026-10-09T22:56:51Z.
Done: title no longer mentions Party, What no longer mentions the NpCppWebApi stubs, Depends on: none ticked. Thanks also to popcoder565 for the Windows run (520/521 with the unrelated guest_offline_imports failure from #2359).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T09:29:38Z.
Review: APPROVED
Checked the diff against main: every export is a throwing stub, no duplicates with main, no NID alias repeating its own name, TechnicalDebt lines sit in "Unknown function info". The merged tree builds (including the new libSceNetCtlApDialog module) and the libs ctest scope passes; Windows run by @popcoder565 covers MinGW. Merging.