From 6dc456733530625cb77273b7195fd7d5f52dca77 Mon Sep 17 00:00:00 2001 From: Capibara <51676393+giovanniadamo@users.noreply.github.com> Date: Wed, 14 Oct 2026 19:43:12 -0300 Subject: [PATCH 1/3] feat(libSceRegMgr): add sceRegMgrNonSysGetInt stub AstroBot's import log (issue #4720) names sceRegMgrNonSysGetInt as the only libSceRegMgr export it needs; no other RegMgr export appears in its 1909 unique imports. The signature and NID are sourced from a community dump of PS5 3.20 firmware, cross-checked against the open-source ChonkyStation4 emulator, not from Sony documentation, so the export throws per the project's unknown-behavior convention instead of guessing a return value. Co-Authored-By: Claude Sonnet 5 --- core/libs/prx/libSceRegMgr/CMakeLists.txt | 15 +++++++++++++ core/libs/prx/libSceRegMgr/Export.cpp | 14 ++++++++++++ core/libs/tests/GuestRegMgr.cpp | 27 +++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 core/libs/prx/libSceRegMgr/CMakeLists.txt create mode 100644 core/libs/prx/libSceRegMgr/Export.cpp create mode 100644 core/libs/tests/GuestRegMgr.cpp diff --git a/core/libs/prx/libSceRegMgr/CMakeLists.txt b/core/libs/prx/libSceRegMgr/CMakeLists.txt new file mode 100644 index 0000000000..e10c382e33 --- /dev/null +++ b/core/libs/prx/libSceRegMgr/CMakeLists.txt @@ -0,0 +1,15 @@ +add_library(libSceRegMgr SHARED EXCLUDE_FROM_ALL Export.cpp) +target_include_directories(libSceRegMgr PRIVATE ${LIBS_INCLUDE_DIR}) +configure_windows_unwind(libSceRegMgr) + +if(BUILD_TESTING) + add_test_executable(guest_regmgr_tests ${LIBS_INCLUDE_DIR}/tests/GuestRegMgr.cpp) + target_include_directories(guest_regmgr_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_regmgr_tests PRIVATE libSceRegMgr libc) + configure_windows_unwind(guest_regmgr_tests) + add_test(NAME guest_regmgr COMMAND guest_regmgr_tests) + if(WIN32) + set_tests_properties(guest_regmgr PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libSceRegMgr/Export.cpp b/core/libs/prx/libSceRegMgr/Export.cpp new file mode 100644 index 0000000000..d71daed4b0 --- /dev/null +++ b/core/libs/prx/libSceRegMgr/Export.cpp @@ -0,0 +1,14 @@ +#include +#include "prx/libc/include/General.hpp" + +extern "C" { + +std::int32_t APS5_VABI sceRegMgrNonSysGetInt(std::int64_t key, std::int32_t unk, std::int32_t* data) { + (void)key; + (void)unk; + (void)data; + NotImplemented_nid_no_patch(__func__); + return 0; +} + +} diff --git a/core/libs/tests/GuestRegMgr.cpp b/core/libs/tests/GuestRegMgr.cpp new file mode 100644 index 0000000000..dfdf074535 --- /dev/null +++ b/core/libs/tests/GuestRegMgr.cpp @@ -0,0 +1,27 @@ +#include "prx/libc/include/general/VabiMacros.hpp" +#include +#include +#include +#include + +extern "C" { +std::int32_t APS5_VABI sceRegMgrNonSysGetInt(std::int64_t key, std::int32_t unk, std::int32_t* data); +} + +static void Require(bool value) { if (!value) std::abort(); } + +template +static bool ReportsNotImplemented(const char* name, TCall call) { + try { + call(); + } catch (const std::runtime_error& error) { + return std::string(error.what()) == std::string(name) + " not implemented"; + } + return false; +} + +int main() { + std::int32_t value = 0; + Require(ReportsNotImplemented("sceRegMgrNonSysGetInt", [&] { sceRegMgrNonSysGetInt(0, 0, &value); })); + Require(ReportsNotImplemented("sceRegMgrNonSysGetInt", [&] { sceRegMgrNonSysGetInt(-1, 1, nullptr); })); +} From efd5596008001aed86122c663702e5423ee1d46d Mon Sep 17 00:00:00 2001 From: Capibara <51676393+giovanniadamo@users.noreply.github.com> Date: Wed, 14 Oct 2026 19:45:30 -0300 Subject: [PATCH 2/3] docs(libSceRegMgr): record signature provenance in technical debt Co-Authored-By: Claude Sonnet 5 --- docs/dev/debt/libSceRegMgr.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/dev/debt/libSceRegMgr.md diff --git a/docs/dev/debt/libSceRegMgr.md b/docs/dev/debt/libSceRegMgr.md new file mode 100644 index 0000000000..6091477928 --- /dev/null +++ b/docs/dev/debt/libSceRegMgr.md @@ -0,0 +1,5 @@ +# libSceRegMgr technical debt + +### Unknown function info + +- [sceRegMgrNonSysGetInt](../../../core/libs/prx/libSceRegMgr/Export.cpp) - signature (`int64_t key, int32_t unk, int32_t* data`) and NID come from a community dump of PS5 3.20 firmware, cross-checked against the open-source ChonkyStation4 PS4 emulator, not from Sony documentation; behaviour is unverified on hardware and the export always throws From 66b0a6082e2ee77169e6b27c73d238c45cb30e32 Mon Sep 17 00:00:00 2001 From: Capibara <51676393+giovanniadamo@users.noreply.github.com> Date: Thu, 15 Oct 2026 12:43:59 -0300 Subject: [PATCH 3/3] docs(libSceRegMgr): match house style for the unknown-function debt entry The entry described the NID as sourced from the community firmware dump alongside the signature, but nid_patcher derives the NID from the export name itself; only the signature is unverified. Rewrite the entry to match the house style used by libSceHttp2.md and libSceContentDelete.md: NID inline, the importing title named, and a pinned link to the one external source instead of an unlinked claim. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Vb2m1o8ZDHARkX6FTP9xuJ --- docs/dev/debt/libSceRegMgr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/debt/libSceRegMgr.md b/docs/dev/debt/libSceRegMgr.md index 6091477928..467ad2850e 100644 --- a/docs/dev/debt/libSceRegMgr.md +++ b/docs/dev/debt/libSceRegMgr.md @@ -2,4 +2,4 @@ ### Unknown function info -- [sceRegMgrNonSysGetInt](../../../core/libs/prx/libSceRegMgr/Export.cpp) - signature (`int64_t key, int32_t unk, int32_t* data`) and NID come from a community dump of PS5 3.20 firmware, cross-checked against the open-source ChonkyStation4 PS4 emulator, not from Sony documentation; behaviour is unverified on hardware and the export always throws +- [sceRegMgrNonSysGetInt](../../../core/libs/prx/libSceRegMgr/Export.cpp) (libSceRegMgr, NID `dKeshzt29G4`) - imported by Astro Bot (PPSA21564), which fails to load without libSceRegMgr.prx (issue 4720); the `(int64_t key, int32_t unk, int32_t* data)` signature follows [ChonkyStation4](https://github.com/liuk7071/ChonkyStation4/blob/c101a23ecbc15e56c6e30d5dd24d3ed8880a957a/ChonkyStation4/OS/Libraries/SceRegMgr/SceRegMgr.cpp#L38-L47), not measured on a console, so every call throws