libkernel: implement sceKernelGetModuleList2 (Madden NFL 26, UFC 6) #2399

Closed
github-bot wants to merge 1 commit from gh-pr/2399/head into gh-pr/2399/base
Owner

@⁠oguzhanozfe on GitHub · 2026-11-18 23:42 UTC · original
oguzhanozfe:fix/kernel-get-module-list2 → main · +41 −0 · 3 files · 1 commits · closed without merging

Game and problem

Madden NFL 26 (PPSA26127, #1834): the log ends with nothing but repeated lines like this one:

Unresolved import stub called: ZzzC3ZGVAkc[libkernel_module_info_v1][libkernel_v1.1][Func]

EA SPORTS UFC 6 (PPSA23566, #2019) imports the same function. ZzzC3ZGVAkc is sceKernelGetModuleList2; the NID was checked against the name with the NID hash.

The stub returns 0 but writes neither the handle array nor the count, so the game goes on with an uninitialized module count.

Change

sceKernelGetModuleList2(int32_t* handles, uint64_t capacity, uint64_t* out_count) is registered in a new libkernel_module_info library and returns the handles of the loaded game modules: the eboot and its PRX. System libraries are HLE here, not modules.

  • The handles are each program's unique_id. They are the same ids that sceKernelLoadStartModule and sceKernelGetModuleInfoFromAddr already return.
  • A null array or count returns EFAULT. An array smaller than the module count returns ENOMEM. This matches shadPS4's sceKernelGetModuleList.
  • RuntimeLinker::GetProgramIds() collects the ids under the linker mutex.

Testing

Windows 11, Ryzen 9 5950X, RTX 3090, clang-cl (LLVM 23), Release.

  • kyty_emulator builds, and virtual_memory_allocation_tests still passes.
  • No unit test covers this. The function enumerates loaded ELF programs, and the test binaries load none.
  • I don't own Madden NFL 26 or UFC 6, so this is not tested in-game. Like #1186, this is a consistency fix. I'm not claiming it changes how far these games get, only that they now get a real module list instead of an untouched buffer. If either game then calls sceKernelGetModuleInfo2 with those handles, it will show as the next unresolved stub. Reports from #1834 / #2019 testers are welcome.

AI usage

AI (Claude Opus 5.5) was used to rank the most frequent unresolved stubs across open issues, to check the NID-to-name mapping, to implement the change, and to draft this description.

🤖 Generated with Claude Code

**@⁠oguzhanozfe** on GitHub · 2026-11-18 23:42 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2399) `oguzhanozfe:fix/kernel-get-module-list2` → `main` · +41 −0 · 3 files · 1 commits · closed without merging ## Game and problem **Madden NFL 26** (PPSA26127, #1834): the log ends with nothing but repeated lines like this one: ``` Unresolved import stub called: ZzzC3ZGVAkc[libkernel_module_info_v1][libkernel_v1.1][Func] ``` **EA SPORTS UFC 6** (PPSA23566, #2019) imports the same function. `ZzzC3ZGVAkc` is `sceKernelGetModuleList2`; the NID was checked against the name with the NID hash. The stub returns 0 but writes neither the handle array nor the count, so the game goes on with an uninitialized module count. ## Change `sceKernelGetModuleList2(int32_t* handles, uint64_t capacity, uint64_t* out_count)` is registered in a new `libkernel_module_info` library and returns the handles of the loaded game modules: the eboot and its PRX. System libraries are HLE here, not modules. - The handles are each program's `unique_id`. They are the same ids that `sceKernelLoadStartModule` and `sceKernelGetModuleInfoFromAddr` already return. - A null array or count returns `EFAULT`. An array smaller than the module count returns `ENOMEM`. This matches shadPS4's `sceKernelGetModuleList`. - `RuntimeLinker::GetProgramIds()` collects the ids under the linker mutex. ## Testing Windows 11, Ryzen 9 5950X, RTX 3090, clang-cl (LLVM 23), Release. - `kyty_emulator` builds, and `virtual_memory_allocation_tests` still passes. - No unit test covers this. The function enumerates loaded ELF programs, and the test binaries load none. - I don't own Madden NFL 26 or UFC 6, so this is not tested in-game. Like #1186, this is a consistency fix. I'm not claiming it changes how far these games get, only that they now get a real module list instead of an untouched buffer. If either game then calls `sceKernelGetModuleInfo2` with those handles, it will show as the next unresolved stub. Reports from #1834 / #2019 testers are welcome. ## AI usage AI (Claude Opus 5.5) was used to rank the most frequent unresolved stubs across open issues, to check the NID-to-name mapping, to implement the change, and to draft this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Madden NFL 26 (PPSA26127, #1834) ends its log with nothing but repeated
"Unresolved import stub called: ZzzC3ZGVAkc[libkernel_module_info_v1]",
and EA SPORTS UFC 6 (PPSA23566, #2019) calls it too. The stub returns 0
without writing the handle array or the count, so the game reads an
uninitialized module count.

sceKernelGetModuleList2(handles, capacity, out_count) now returns the
handles of the loaded game modules (eboot and its PRX, the same ids
sceKernelLoadStartModule and sceKernelGetModuleInfoFromAddr return):
EFAULT for a null array or count, ENOMEM when the array is too small,
as shadPS4 does for sceKernelGetModuleList.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:19:39 +00:00
github-bot closed this pull request 2026-11-26 10:19:39 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-18 23:46 UTC · original

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds RuntimeLinker::GetProgramIds(), which returns loaded programs’ unique IDs in load order. It adds and registers LibKernelModuleInfo, which exports KernelGetModuleList2. The API returns EFAULT for null output pointers, returns ENOMEM when the ID count exceeds capacity, and otherwise copies the IDs and sets the output count.

Suggested reviewers: nmzik

Change: Feature

Merge Risk: Minimal · up to 0df34

This adds a new kernel API that returns the IDs of loaded modules. It does not change existing behavior, so merge risk is minimal. It has not been tested in the target games.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: implementing sceKernelGetModuleList2 in libkernel. The changeset adds that function, registers it in a new libkernel_module_info library, and adds RuntimeLinker::GetProgram…
Description check Passed The description explains the problem (unresolved import stub in Madden NFL 26 and EA SPORTS UFC 6), the new function's signature and error behavior, the RuntimeLinker::GetProgramIds() helper, and the …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: implementing sceKernelGetModuleList2 in libkernel. The changeset adds that function, registers it in a new libkernel_module_info library, and adds RuntimeLinker::GetProgramIds() to support it. The parenthetical game names are extra context and do not hurt the match.

Full details: Description check

Explanation

The description explains the problem (unresolved import stub in Madden NFL 26 and EA SPORTS UFC 6), the new function's signature and error behavior, the RuntimeLinker::GetProgramIds() helper, and the testing done. It relates directly to the changeset.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a90be8dd73 and 0df3413874.

Files selected for processing: 3

  • src/libs/libKernel.cpp
  • src/loader/runtimeLinker.cpp
  • src/loader/runtimeLinker.h

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-11-18 23:46 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2399#issuecomment-6995030099) <!-- coderabbit-ai-generated:v1 --> <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/2399?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- recent_review_status_start --> No actionable comments were generated in the recent review. <!-- recent_review_status_end --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> <br> The change adds `RuntimeLinker::GetProgramIds()`, which returns loaded programs’ unique IDs in load order. It adds and registers `LibKernelModuleInfo`, which exports `KernelGetModuleList2`. The API returns `EFAULT` for null output pointers, returns `ENOMEM` when the ID count exceeds capacity, and otherwise copies the IDs and sets the output count. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <!-- change_assessment_commit:"0df34138747a02f02fdeb7461087c7785ea3e5e2" --> <!-- change_assessment_priority:{"version":1,"urgency":"p2","manual":false} --> **Change:** Feature <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · up to <code>0df34</code></summary> <dl> <dd> <br> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **⚪ Minimal** · up to `0df34` --> <!-- final_review_risk_coverage:{"sourceCommitId":"0df34138747a02f02fdeb7461087c7785ea3e5e2","coveredCommitId":"0df34138747a02f02fdeb7461087c7785ea3e5e2","kind":"reviewed"} --> This adds a new kernel API that returns the IDs of loaded modules. It does not change existing behavior, so merge risk is minimal. It has not been tested in the target games. <!-- final_review_risk_end --> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4</strong></summary> <dl> <dd> <br> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title names the change: implementing sceKernelGetModuleList2 in libkernel. The changeset adds that function, registers it in a new libkernel_module_info library, and adds RuntimeLinker::GetProgram… | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description explains the problem (unresolved import stub in Madden NFL 26 and EA SPORTS UFC 6), the new function's signature and error behavior, the RuntimeLinker::GetProgramIds() helper, and the … | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | <details> <summary><strong>Full details: Title check</strong></summary> <dl> <dd> <br> **Explanation** The title names the change: implementing sceKernelGetModuleList2 in libkernel. The changeset adds that function, registers it in a new libkernel_module_info library, and adds RuntimeLinker::GetProgramIds() to support it. The parenthetical game names are extra context and do not hurt the match. </dd> </dl> </details> <details> <summary><strong>Full details: Description check</strong></summary> <dl> <dd> <br> **Explanation** The description explains the problem (unresolved import stub in Madden NFL 26 and EA SPORTS UFC 6), the new function's signature and error behavior, the RuntimeLinker::GetProgramIds() helper, and the testing done. It relates directly to the changeset. </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=2399)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>Share</strong></summary> <dl> <dd> <br> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </dd> </dl> </details> <!-- tips_end --> <!-- recent_review_start --> <h6> <details> <summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Recent review info</strong></summary> <dl> <dd> <br> <!-- review_info_content --> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary> <dl> <dd> <br> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/a90be8dd7304640cf4176a975871d51443710292/.coderabbit.yaml>) - **Commit**: [a90be8d](<https://github.com/KytyPS5/KytyPS5/commit/a90be8dd7304640cf4176a975871d51443710292>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `4f2aab2f-3dde-4839-8150-371d7154a0c8` </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between a90be8dd7304640cf4176a975871d51443710292 and 0df34138747a02f02fdeb7461087c7785ea3e5e2. </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 3</strong></summary> <dl> <dd> <br> * `src/libs/libKernel.cpp` * `src/loader/runtimeLinker.cpp` * `src/loader/runtimeLinker.h` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review. </dd> </dl> </details> </h6> <!-- recent_review_end -->

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.