feat(libSceHubAppUtil): reproduce the firmware not-available returns #19542

Merged
edubox merged 2 commits from upstream-pr/19542 into main 2026-11-26 01:37:30 +00:00
edubox commented 2026-11-13 14:17:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by edubox on 2026-11-13T14:17:37Z.


What

The three exports of libSceHubAppUtil now do what the firmware module does instead of returning success. In the 13.40 module (libSceHubAppUtil.sprx) each body is 23 bytes long and identical apart from the string it prints:

lea    rdi,[rip+0x4122]
call   puts
mov    eax,0x818d0001
ret

The puts is the module's own libc import (YQ0navp+YIc, puts), and none of the three bodies reads an argument, so the notice and the return value are the same for every input. This is generic behaviour read from the module, not a case matched from a title: the parameterless declarations stay import-resolution placeholders and the change makes no ABI claim.

The notices, taken byte for byte from the module (they have no trailing newline; puts adds it):

Export Notice
sceHubAppUtilDeeplinkToLiveDetailView [PPRBUG-22821] sceHubAppUtilDeeplinkToLiveDetailView() is not available.
sceHubAppUtilDeeplinkToPSSubscriptions [PPRBUG-22821] sceHubAppUtilDeeplinkToPSSubscriptions() is not available.
sceHubAppUtilGetInstallationStatus [PPRBUG-22821] sceHubAppUtilGetInstallationStatus() is not available.

libc is linked into every .prx, so the notice needs no build change. docs/dev/debt/libSceHubAppUtil.md now records where the behaviour comes from: disassembly of 13.40, not a console measurement, with the prototypes still unverified and 0x818D0001 undocumented. The functions are not listed under Silent stubs because they report what the firmware reports.

main has since added its own implementations of the same three exports (dbce57421d, returning 0 and keeping installer/deeplink state that no code reads). They contradict the module, so this PR replaces them and updates guest_hub_app_util to the firmware returns instead of keeping a second test beside it.

The test now also asserts the notices: each one is its own ctest entry (guest_hub_app_util, guest_hub_app_util_ps_subscriptions, guest_hub_app_util_installation_status) that runs the binary for that export and matches the exact string with PASS_REGULAR_EXPRESSION. A missing or reworded notice fails the run, which is what the previous manual comparison could not do.

Tested

Linux x86-64 (CachyOS), GCC 16.2.1, Release, BUILD_TESTING=ON, rebased onto main dfe428e798:

  • ctest -R guest_hub_app_util: 3/3 pass, one per export.
  • Control: the binary prints the three notices verbatim, and nm resolves puts_nid_postfix from libc.
  • check_conventions.py --base origin/main passes.

Nothing was measured on a console, and no title in the dumps I have imports these exports.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5297054241 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19542). Originally posted by [edubox](https://github.com/edubox) on 2026-11-13T14:17:37Z. --- ### What The three exports of `libSceHubAppUtil` now do what the firmware module does instead of returning success. In the 13.40 module (`libSceHubAppUtil.sprx`) each body is 23 bytes long and identical apart from the string it prints: ```asm lea rdi,[rip+0x4122] call puts mov eax,0x818d0001 ret ``` The `puts` is the module's own `libc` import (`YQ0navp+YIc`, `puts`), and none of the three bodies reads an argument, so the notice and the return value are the same for every input. This is generic behaviour read from the module, not a case matched from a title: the parameterless declarations stay import-resolution placeholders and the change makes no ABI claim. The notices, taken byte for byte from the module (they have no trailing newline; `puts` adds it): | Export | Notice | | --- | --- | | `sceHubAppUtilDeeplinkToLiveDetailView` | `[PPRBUG-22821] sceHubAppUtilDeeplinkToLiveDetailView() is not available.` | | `sceHubAppUtilDeeplinkToPSSubscriptions` | `[PPRBUG-22821] sceHubAppUtilDeeplinkToPSSubscriptions() is not available.` | | `sceHubAppUtilGetInstallationStatus` | `[PPRBUG-22821] sceHubAppUtilGetInstallationStatus() is not available.` | `libc` is linked into every `.prx`, so the notice needs no build change. `docs/dev/debt/libSceHubAppUtil.md` now records where the behaviour comes from: disassembly of 13.40, not a console measurement, with the prototypes still unverified and `0x818D0001` undocumented. The functions are not listed under Silent stubs because they report what the firmware reports. `main` has since added its own implementations of the same three exports (`dbce57421d`, returning 0 and keeping installer/deeplink state that no code reads). They contradict the module, so this PR replaces them and updates `guest_hub_app_util` to the firmware returns instead of keeping a second test beside it. The test now also asserts the notices: each one is its own ctest entry (`guest_hub_app_util`, `guest_hub_app_util_ps_subscriptions`, `guest_hub_app_util_installation_status`) that runs the binary for that export and matches the exact string with `PASS_REGULAR_EXPRESSION`. A missing or reworded notice fails the run, which is what the previous manual comparison could not do. ### Tested Linux x86-64 (CachyOS), GCC 16.2.1, Release, `BUILD_TESTING=ON`, rebased onto `main` `dfe428e798`: - `ctest -R guest_hub_app_util`: 3/3 pass, one per export. - Control: the binary prints the three notices verbatim, and `nm` resolves `puts_nid_postfix` from `libc`. - `check_conventions.py --base origin/main` passes. Nothing was measured on a console, and no title in the dumps I have imports these exports. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-21 04:07:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T04:07:13Z.

Review: COMMENTED


Reviewed — comments

Changes are not required before merge; the implementation is consistent with the described disassembly, with one optional test improvement.

What I ran

Read the prepared diff and changed files at head 3dd37452d9dac34ca317bb7a98dd65c2b8849642, plus the libc puts implementation, API declarations, and neighboring test/CMake setup through repo_read.py. No commands or tests were run; the test result in the PR description is author-reported.

Results

Check Result Note
Source review passed All changed lines read
Test execution not run Linux test result is author-reported

Findings

Blocking

None.

Non-blocking

  • core/libs/tests/GuestHubAppUtilNotAvailable.cpp:21 checks the three return values but does not assert the emitted notices. Since matching the firmware strings is part of this change, a captured-output assertion would make that behavior regression-tested. The reported manual comparison is not a test assertion.

Not verified

No build, test, or console run was performed. The firmware disassembly and notice bytes were not independently checked. The test binary’s output assertions are not present in the changed test. All four changed files were read; none were excluded according to manifest.json.

To get this to a good state

Nothing is required. Optionally add an assertion for the three emitted notices to the test.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6002726542 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19542#pullrequestreview-6002726542). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T04:07:13Z. **Review:** COMMENTED --- # Reviewed — comments Changes are not required before merge; the implementation is consistent with the described disassembly, with one optional test improvement. ## What I ran Read the prepared diff and changed files at head `3dd37452d9dac34ca317bb7a98dd65c2b8849642`, plus the libc `puts` implementation, API declarations, and neighboring test/CMake setup through `repo_read.py`. No commands or tests were run; the test result in the PR description is author-reported. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | All changed lines read | | Test execution | not run | Linux test result is author-reported | ## Findings ### Blocking None. ### Non-blocking - `core/libs/tests/GuestHubAppUtilNotAvailable.cpp:21` checks the three return values but does not assert the emitted notices. Since matching the firmware strings is part of this change, a captured-output assertion would make that behavior regression-tested. The reported manual comparison is not a test assertion. ## Not verified No build, test, or console run was performed. The firmware disassembly and notice bytes were not independently checked. The test binary’s output assertions are not present in the changed test. All four changed files were read; none were excluded according to `manifest.json`. ## To get this to a good state Nothing is required. Optionally add an assertion for the three emitted notices to the test.
MarcZX10 commented 2026-11-25 16:14:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T16:14:46Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head 3cf68123673f53f946ab595b573cdc84fb47dea7. I read the prepared description, commit list, manifest, diff, all four changed files, and the puts_nid_postfix implementation. No test or build commands were run. The base was not merged for this review.

Results

Check Result Note
Change review passed All four changed files read
Tests not run No commands run
Console behavior not run No physical-console check

Findings

Blocking

None.

Non-blocking

  • The test harness treats any unknown argument as a successful run with no assertions (core/libs/tests/GuestHubAppUtil.cpp:18-21). Consider rejecting argc > 2 and unknown selectors explicitly; a typo in a CTest command could otherwise pass without exercising an export.

Not verified

The author reports Linux x86-64 test and convention-check results; they were not run during this review. Console behavior and the claimed 13.40 module disassembly were not independently verified. Files read: core/libs/CMakeLists.txt, core/libs/prx/libSceHubAppUtil/Export.cpp, core/libs/tests/GuestHubAppUtil.cpp, and docs/dev/debt/libSceHubAppUtil.md. No changed files were excluded in manifest.json.

To get this to a good state

Nothing is required. Optionally make invalid test selectors fail, as noted above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6060994902 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19542#pullrequestreview-6060994902). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T16:14:46Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the points below are optional. ## What I ran Reviewed head `3cf68123673f53f946ab595b573cdc84fb47dea7`. I read the prepared description, commit list, manifest, diff, all four changed files, and the `puts_nid_postfix` implementation. No test or build commands were run. The base was not merged for this review. ## Results | Check | Result | Note | | --- | --- | --- | | Change review | passed | All four changed files read | | Tests | not run | No commands run | | Console behavior | not run | No physical-console check | ## Findings ### Blocking None. ### Non-blocking - The test harness treats any unknown argument as a successful run with no assertions (`core/libs/tests/GuestHubAppUtil.cpp:18-21`). Consider rejecting `argc > 2` and unknown selectors explicitly; a typo in a CTest command could otherwise pass without exercising an export. ## Not verified The author reports Linux x86-64 test and convention-check results; they were not run during this review. Console behavior and the claimed 13.40 module disassembly were not independently verified. Files read: `core/libs/CMakeLists.txt`, `core/libs/prx/libSceHubAppUtil/Export.cpp`, `core/libs/tests/GuestHubAppUtil.cpp`, and `docs/dev/debt/libSceHubAppUtil.md`. No changed files were excluded in `manifest.json`. ## To get this to a good state Nothing is required. Optionally make invalid test selectors fail, as noted above.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!19542
No description provided.