feat(libkernel_sys): implement sceKernelGetModuleInfoInternal and sceKernelGetModuleListInternal #9294
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9294"
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 YossiYad on 2026-10-21T17:31:10Z.
What
sceKernelGetModuleInfoInternalandsceKernelGetModuleListInternalthrew. Both now answer for every loaded module, system modules included:sceKernelGetModuleInfoInternal(handle, info)fills the 0x1A8-byteSceKernelModuleInfoExof a module handle, the same structuresceKernelGetModuleInfoFromAddrfills for an address. It checks in shadPS4's order:EFAULTfor a null pointer,EINVALwhenst_sizeis not 0x1A8,ESRCHfor an unknown handle. sharpemu refuses the same three cases, with its own error codes and the handle checked before the size.sceKernelGetModuleListInternalreturns the same list assceKernelGetModuleList, as fpPS4 does. fpPS4 marks that as a guess; the debt entry says so.In libkernel,
FillModuleInfobecomes a template overSceKernelModuleInfoandSceKernelModuleInfoEx, so the by-handle lookup is shared withsceKernelGetModuleInfo. On Linux the extended form setsidto the handle, assceKernelGetModuleInfoFromAddrdoes; the Windows path already fills it.Not measured on a PS5.
Tested
Linux (Fedora 44, GCC, Ninja,
-DBUILD_TESTING=ON), based onmain99844c7eef:guest_kernel_sys_module_internal(core/libs/tests/GuestKernelSysModuleInternal.cpp): the internal list equalssceKernelGetModuleList, includingENOMEMandEFAULT; for every listed module the extended info has the handle asidand the name and segments ofsceKernelGetModuleInfo; for libkernel it is byte for byte whatsceKernelGetModuleInfoFromAddrreturns; sizes 0x160, 0x1A4, 0x1B0 and 0 giveEINVALand leave the buffer alone, null givesEFAULTand handle -1ESRCH. It aborts onmain. Each of these changes made it fail: not settingid, limiting the lookup to title modules, and an internal list that returns nothing.guest_module_infostill passes.ctest: 1799 of 1807 pass. The 8 failures fail the same way onmainon this machine and do not use these exports:application_heap_scripting,application_heap_lazy,agc_driver_guest_memory_lifetime,agc_driver_image_array_window_past_layer_limit,agc_driver_tessellationand the threenet_dontwait_blocking_*cases. Tests that need the GPU skipped themselves.tools/progress.py --compare: libraries +0.02%, 2 functions implemented, none lost.tools/check_conventions.py --base upstream/mainpasses.tools/pr_overlap.py: no open PR implements these two. #8658 (macOS host) editsFillModuleInfo.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)Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-22T12:58:45Z.
Rebased onto
main8b3a6ba88after #9279 (head26893b36b). The only conflict was the end ofExport.cpp, where #9279's pthread calls now sit, and the code is unchanged.guest_kernel_sys_module_internalpasses 3 of 3.