feat(libSceNpEntitlementAccess): name each add-on a title asks for that the entitlements file does not list #12793

Merged
Tehshortbus merged 7 commits from upstream-pr/12793 into main 2026-11-03 08:10:10 +00:00
Tehshortbus commented 2026-10-29 09:39:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Tehshortbus on 2026-10-29T09:39:45Z.


What

sceNpEntitlementAccessGetAddcontEntitlementInfo reports an add-on as installed only when its label is in anyps5-entitlements.ini (or the file ANYPS5_ENTITLEMENTS names). Every other label returns SCE_NP_ENTITLEMENT_ACCESS_ERROR_NOT_FOUND, and nothing in the log says which label the title asked for.

Some titles wait for an add-on they look for instead of going on without it. On plain main, Ghost of Yōtei (PPSA26344) 02.002.000 asks 24 times for GHOSTYOTEIDUPLEX and then stays on its loading spinner, streaming only the spinner's bitmaps. Several people in #675 hit this spinner and had to guess the labels. The ones posted there (GHOST2APP0000000, GHOST2BASE000000) are not queried by this version.

  • sceNpEntitlementAccessGetAddcontEntitlementInfo: the first query for each label the file does not list prints one line, then returns NOT_FOUND as before:
    [entitlements] the title asked for the add-on GHOSTYOTEIDUPLEX, which anyps5-entitlements.ini does not list, so it is reported as not installed
    • The line names the file as anyps5-entitlements.ini, or by the path ANYPS5_ENTITLEMENTS gives when it is set, so the default line holds no home directory.
    • The label is read up to its 16 characters. Bytes outside printable ASCII, and the backslash, are written as \xNN, so a label from the title cannot forge or hide log lines.
    • A label already reported prints nothing again. After 64 reported labels, one more line says further ones are reported without a line, which bounds both the log and the set of reported labels.
  • docs/user/USAGE.md: a new Add-ons section documents anyps5-entitlements.ini (location, format, ANYPS5_ENTITLEMENTS), the new line with a neutral example label, its escaping and limit, and the PPSA26344 02.002.000 case by title ID. The file was documented only in the developer environment table.

Tested

CachyOS Linux (kernel 7.3.0-4-cachyos), GCC 16.2.1, Release.

  • guest_entitlements captures stderr around three groups of queries. guest_entitlements and guest_entitlements_missing pass.
    • An unlisted label twice and a listed one once: the unlisted label is named in exactly one line, with the file name, and the listed label prints nothing.
    • Labels holding a newline, an escape sequence and a backslash: each is printed as \x0a, \x1b and \x5c on its own line, and no raw escape byte reaches the log.
    • 70 more distinct labels and a repeat: 61 more named lines up to the limit of 64, then one line for the rest, and nothing for the repeat.
  • Negative controls: guest_entitlements aborts without the new line in Export.cpp, without the escaping, and without the limit.
  • Ghost of Yōtei (PPSA26344 02.002.000, main + this PR):
    • With anyps5-entitlements.ini listing only GHOST2APP0000000 and GHOST2BASE000000, the log has exactly one [entitlements] line for the 24 queries: the title asked for the add-on GHOSTYOTEIDUPLEX, which anyps5-entitlements.ini does not list, so it is reported as not installed (head b98d3e1f8b, without ANYPS5_ENTITLEMENTS).
    • With GHOSTYOTEIDUPLEX added to the file (a run on main), the title leaves the spinner: in the first 3 minutes it streams 1,282 reads (the main game pack, character, animation, environment, effects and sound packs, cutscene movies), where before it read only the spinner's bitmaps. That a listed label prints nothing is what guest_entitlements checks.
  • python3 tools/check_conventions.py --base origin/main and git diff --check pass.

Overlap:

  • tools/pr_overlap.py lists #11909 and #11941, which also add test code at the end of main() in core/libs/tests/GuestEntitlements.cpp. The tests are independent; whichever merges later rebases those lines.
  • Of the pull requests it could not compare, #8646 changes the consumable entitlement requests in Export.cpp, not the add-on lookup, and the other nine share only docs/user/USAGE.md without touching entitlements.

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 (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5065688589 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12793). Originally posted by [Tehshortbus](https://github.com/Tehshortbus) on 2026-10-29T09:39:45Z. --- ### What `sceNpEntitlementAccessGetAddcontEntitlementInfo` reports an add-on as installed only when its label is in `anyps5-entitlements.ini` (or the file `ANYPS5_ENTITLEMENTS` names). Every other label returns `SCE_NP_ENTITLEMENT_ACCESS_ERROR_NOT_FOUND`, and nothing in the log says which label the title asked for. Some titles wait for an add-on they look for instead of going on without it. On plain `main`, Ghost of Yōtei (PPSA26344) 02.002.000 asks 24 times for `GHOSTYOTEIDUPLEX` and then stays on its loading spinner, streaming only the spinner's bitmaps. Several people in #675 hit this spinner and had to guess the labels. The ones posted there (`GHOST2APP0000000`, `GHOST2BASE000000`) are not queried by this version. - **`sceNpEntitlementAccessGetAddcontEntitlementInfo`:** the first query for each label the file does not list prints one line, then returns `NOT_FOUND` as before: `[entitlements] the title asked for the add-on GHOSTYOTEIDUPLEX, which anyps5-entitlements.ini does not list, so it is reported as not installed` - The line names the file as `anyps5-entitlements.ini`, or by the path `ANYPS5_ENTITLEMENTS` gives when it is set, so the default line holds no home directory. - The label is read up to its 16 characters. Bytes outside printable ASCII, and the backslash, are written as `\xNN`, so a label from the title cannot forge or hide log lines. - A label already reported prints nothing again. After 64 reported labels, one more line says further ones are reported without a line, which bounds both the log and the set of reported labels. - **`docs/user/USAGE.md`:** a new **Add-ons** section documents `anyps5-entitlements.ini` (location, format, `ANYPS5_ENTITLEMENTS`), the new line with a neutral example label, its escaping and limit, and the PPSA26344 02.002.000 case by title ID. The file was documented only in the developer environment table. ### Tested CachyOS Linux (kernel 7.3.0-4-cachyos), GCC 16.2.1, Release. - `guest_entitlements` captures stderr around three groups of queries. `guest_entitlements` and `guest_entitlements_missing` pass. - An unlisted label twice and a listed one once: the unlisted label is named in exactly one line, with the file name, and the listed label prints nothing. - Labels holding a newline, an escape sequence and a backslash: each is printed as `\x0a`, `\x1b` and `\x5c` on its own line, and no raw escape byte reaches the log. - 70 more distinct labels and a repeat: 61 more named lines up to the limit of 64, then one line for the rest, and nothing for the repeat. - **Negative controls:** `guest_entitlements` aborts without the new line in `Export.cpp`, without the escaping, and without the limit. - **Ghost of Yōtei** (PPSA26344 02.002.000, `main` + this PR): - With `anyps5-entitlements.ini` listing only `GHOST2APP0000000` and `GHOST2BASE000000`, the log has exactly one `[entitlements]` line for the 24 queries: `the title asked for the add-on GHOSTYOTEIDUPLEX, which anyps5-entitlements.ini does not list, so it is reported as not installed` (head `b98d3e1f8b`, without `ANYPS5_ENTITLEMENTS`). - With `GHOSTYOTEIDUPLEX` added to the file (a run on `main`), the title leaves the spinner: in the first 3 minutes it streams 1,282 reads (the main game pack, character, animation, environment, effects and sound packs, cutscene movies), where before it read only the spinner's bitmaps. That a listed label prints nothing is what `guest_entitlements` checks. - `python3 tools/check_conventions.py --base origin/main` and `git diff --check` pass. **Overlap:** - `tools/pr_overlap.py` lists #11909 and #11941, which also add test code at the end of `main()` in `core/libs/tests/GuestEntitlements.cpp`. The tests are independent; whichever merges later rebases those lines. - Of the pull requests it could not compare, #8646 changes the consumable entitlement requests in `Export.cpp`, not the add-on lookup, and the other nine share only `docs/user/USAGE.md` without touching entitlements. ### 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 (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!12793
No description provided.