fix(libSceNpTrophy2): copy icon size outputs via GuestCopyOut #20612

Merged
PrivacyOnion merged 1 commit from upstream-pr/20612 into main 2026-11-15 13:01:54 +00:00
PrivacyOnion commented 2026-11-15 11:04:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T11:04:37Z.


What

  • Copy size outputs in sceNpTrophy2GetRewardIcon, sceNpTrophy2GetGameIcon, sceNpTrophy2GetGroupIcon, and sceNpTrophy2GetTrophyIcon via GuestCopyOut_nid_no_patch and throw APS5_INVALID_ARG_EX on invalid guest pointers instead of dereferencing size directly.
  • Add fault-handling assertions for those four exports in core/libs/tests/GuestNpTrophy2.cpp.

Tested

  • Windows 11:
    • python tools/guest_pointer_audit.py libSceNpTrophy2 -> 0 direct guest pointer accesses in 0 exported functions
    • g++.exe -std=gnu++20 -fsyntax-only on all 5 modified .cpp files -> exit code 0
    • python tools/check_conventions.py --base upstream/main --head fix/nptrophy2-guest-copy -> All conventions checks passed. (exit code 0)

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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:5322055182 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20612). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T11:04:37Z. --- ### What - Copy `size` outputs in `sceNpTrophy2GetRewardIcon`, `sceNpTrophy2GetGameIcon`, `sceNpTrophy2GetGroupIcon`, and `sceNpTrophy2GetTrophyIcon` via `GuestCopyOut_nid_no_patch` and throw `APS5_INVALID_ARG_EX` on invalid guest pointers instead of dereferencing `size` directly. - Add fault-handling assertions for those four exports in `core/libs/tests/GuestNpTrophy2.cpp`. ### Tested - Windows 11: - `python tools/guest_pointer_audit.py libSceNpTrophy2` -> `0 direct guest pointer accesses in 0 exported functions` - `g++.exe -std=gnu++20 -fsyntax-only` on all 5 modified `.cpp` files -> exit code 0 - `python tools/check_conventions.py --base upstream/main --head fix/nptrophy2-guest-copy` -> `All conventions checks passed.` (exit code 0) ### 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) and the licence notice of code adapted from upstream (see AGENTS.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-15 11:41:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T11:41:51Z.

Review: APPROVED


Reviewed — looks good

Nothing in the reviewed changes blocks merging; the four icon exports now copy size through the guest memory helper and reject invalid destinations.

What I ran

Reviewed head d0893df77c8d5c1db0afab4f62e1546730d65895. I read description.md, commits.md, manifest.json, diff.patch, and all five changed source files using repo_read.py. No commands or tests were run; the checks in the description are author-reported.

Results

Check Result Note
Source review passed All five changed files read
Programmatic checks not run Description reports Windows checks

Findings

Blocking

None.

Non-blocking

None.

Not verified

The author-reported syntax, convention, and guest pointer audit checks were not independently run. No runtime or console behavior was verified. No files were excluded from this review.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5910483858 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20612#pullrequestreview-5910483858). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T11:41:51Z. **Review:** APPROVED --- # Reviewed — looks good Nothing in the reviewed changes blocks merging; the four icon exports now copy size through the guest memory helper and reject invalid destinations. ## What I ran Reviewed head `d0893df77c8d5c1db0afab4f62e1546730d65895`. I read `description.md`, `commits.md`, `manifest.json`, `diff.patch`, and all five changed source files using `repo_read.py`. No commands or tests were run; the checks in the description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | All five changed files read | | Programmatic checks | not run | Description reports Windows checks | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The author-reported syntax, convention, and guest pointer audit checks were not independently run. No runtime or console behavior was verified. No files were excluded from this review. ## To get this to a good state Nothing is required.
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!20612
No description provided.