feat(libSceSysmodule): implement sceSysmoduleLoadModuleByNameInternal #17904
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17904"
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 akkadbakkad89 on 2026-11-09T21:32:02Z.
What
Implements
sceSysmoduleLoadModuleByNameInternalinlibSceSysmodulefrom firmware 4.03 disassembly. The export formats/<root>/<tier>/lib/<fname>.<ext>and triessceKernelLoadStartModuleForSysmoduleon each candidate in order, returning the first positive handle or the last error. The twelve candidates in firmware order are the sandbox word overpriv_ex,common_ex,priv,commonwith.sprx, thensystem_ex/priv_ex,system_ex/common_ex,system/priv,system/commonwith.sprx, then sandboxpriv/commonwith.prx, thensystempriv/commonwith.prx. A nullfnamereturnsSCE_KERNEL_ERROR_EINVAL; the load option pointer is hardcoded null andargs,argp,flagsandresforward to the loader.The host forwards each candidate to
sceKernelLoadStartModule, whoseSystemLibraryPathtranslation resolves/<sandbox>/common/lib/<name>.sprxand/system/common/lib/<name>.sprxtolibs/<name>.prx; the other candidates fail to open, matching the console's missing-path fallthrough. This also covers theDT_NEEDED-style by-name loads titles issue through this export, such aslibSceShaderTranscode_minimal.Firmware's
sceKernelLoadStartModuleForSysmoduleORs0x10000into the flags and bypasses thesceKernelLoadStartModuleflags-must-be-zero gate, so a nonzeroflagsis accepted on console but rejected here, where the host loader has no flag semantics. Recorded indocs/dev/debt/libSceSysmodule.md.Tested
Windows 11, MinGW GCC 15.2.0.
guest_sysmodulepasses: nullfnamereturnsSCE_KERNEL_ERROR_EINVAL,libSceFiberloads by name through the sandboxcommon/libpath and resolvessceFiberOptParamInitializeviasceKernelDlsym, a repeat load succeeds, an unknown name returns a negative error, andsceKernelStopUnloadModuleunloads the handle. Final Fantasy Resonance (PPSA31544) imports this export.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)