feat(libkernel): implement sceKernelGetModuleInfoFromAddr on Windows #1188
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1188"
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 MathiasDevelopes on 2026-10-07T16:48:07Z.
What
sceKernelGetModuleInfoFromAddrwas not implemented on Windows: it calledNotImplemented_nid_no_patch, so any title whoselibc.prxasks which module an address belongs to aborted at startup.On Windows the module is now the PE image that holds the address (
VirtualQuery,MEM_IMAGE):.guest.prx, as on LinuxsceKernelLoadStartModulehandle from the dynamic loader, otherwise a stable id from the same range (ModuleIdForImage_nid_no_patch, as on Linux).elfNsections (the ELF load pages); for any other image, its first 4 sections with memory access. Protection comes from the section characteristics.ehmeta, with its size computed from the header encodings and table; for a host image, the.ehframsection thatconfigure_windows_unwindproduces, without an eh_frame_hdrinit_proc_addrandfini_proc_addrstay 0;ref_countis 1. Addresses outside any image returnSCE_KERNEL_ERROR_ESRCHThe eh_frame_hdr/eh_frame decoding (pointer encodings, record walk) is shared between the Linux and Windows paths instead of being duplicated. The Linux path behaves the same, and its eh_frame_ptr decoding now accepts every standard encoding instead of only
0x1b,0x03and0x00.guest_module_infonow runs on Windows too. The fixture and test binary go throughconfigure_windows_unwind, and only the eh_frame_hdr check stays Linux-only. The TechnicalDebt entry describes the Windows behaviour instead of saying "Not implemented on Windows".Tested
guest_module_infoandguest_dynamic_loaderpasstools/check_conventions.py --base mainpassesChecklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs).mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-10-07T16:48:13Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T17:15:13Z.
Progress report (
bc1fbe8→9abc931)📈 System libraries: 85.25% (+0.03%, +1 implemented functions)
✅ 1 implemented
sceKernelGetModuleInfoFromAddrImported from boykopovar/AnyPS5. Originally posted by MathiasDevelopes on 2026-10-08T05:51:37Z.
Rebased onto main. Since #1188 was opened,
sceKernelGetModuleInfoForUnwindinModule.cppgot its own Windows.ehmeta/ eh_frame_hdr parsing, so this PR now does the same work separately inModuleInfo.cpp. The two also handle bad tables a little differently (NotImplemented there, throw or full support here).Should this be a follow up PR or should i do the work here? @adriadam10 @oneandonlydean
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T06:37:15Z.
Here, please. Move the
.ehmeta/ eh_frame_hdr parsing into one helper that bothsceKernelGetModuleInfoForUnwindandsceKernelGetModuleInfoFromAddrcall, so bad tables are handled one way.Imported from boykopovar/AnyPS5. Originally posted by MathiasDevelopes on 2026-10-08T07:01:20Z.
@oneandonlydean Done in
9abc931a. BothsceKernelGetModuleInfoForUnwindandsceKernelGetModuleInfoFromAddrnow parse.ehmeta, the eh_frame_hdr and eh_frame through one shared header,Module/EhFrame.hpp.Both calls now throw on the same bad tables: a version other than 1, an indirect or non-absptr/pcrel encoding, a 64-bit record length, or anything outside the image.
What changes per call:
Tested:
guest_module_infopasses on Linux, the Windows path compiles with MinGW, and theGuestUnwindModuleInfocases pass against the shared parser. The full Windows tests haven't been run locally, so Windows CI will be the check for those.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T10:04:26Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libkernel/Module/src/ModuleInfo.cppL11, L167-169Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T21:22:43Z.
Checked on Linux (merged onto current main): build and full ctest green (522/522,
guest_module_infoandguest_dynamic_loaderincluded). Windows CI on this head runsguest_module_infogreen. The sharedEhFrame.hppaddresses Dean's request, TechnicalDebt matches the new behaviour, no conflicts. Merging.