fix(libSceNpSessionSignaling): return the firmware lookup results #8320

Merged
hypermoist merged 5 commits from upstream-pr/8320 into main 2026-10-23 11:41:15 +00:00
hypermoist commented 2026-10-20 10:02:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hypermoist on 2026-10-20T10:02:56Z.


What

Implements five signaling lookups and fixes a sixth, using the decrypted libSceNpSessionSignaling.sprx as evidence.

Firmware pattern. Every export follows the same shape:

  1. it fetches the library object and returns 0x80553301 if the library isn't initialised;
  2. it checks its pointer arguments and returns 0x80553303 for a null one;
  3. it looks up the context and returns 0x80553308 if that fails;
  4. it calls one virtual method of the context. The 54-entry vtable is at 0xd0560.

What the inner methods return. Each inner method locks the context, walks its group list ([ctx + 0x140]) and returns 0x8055330A if the group isn't there. The methods without a group argument walk the connections and return 0x8055330C instead. Upstream never activates a session, so no group or connection exists, and every lookup ends with that code. main now tracks initialisation and contexts, so each export first returns 0x80553301 before initialisation and 0x80553308 for an unknown context, in the console's order.

Export Arguments (firmware registers) Result here
sceNpSessionSignalingGetGroupInfo (WtOs6cUbrx8, was a throwing stub) (ctx, group, info*), slot 0x130 0x80553303 for a null info, else 0x8055330A
sceNpSessionSignalingGetConnectionFromNetAddress2 (hbNcE4fnBDs, was a throwing stub) (ctx, group, addr, port, connId*), slot 0x160 null connId 0x80553303, else 0x8055330A
sceNpSessionSignalingGetConnectionFromNetAddress (RcGZnakPiOk, was a throwing stub) (ctx, addr, port, connId*), slot 0x150 null connId 0x80553303, else 0x8055330C
sceNpSessionSignalingGetConnectionFromPeerAddress (dJJ0UPrrsok, was a throwing stub) (ctx, peer*, connId*), slot 0x148 either null 0x80553303, else 0x8055330C
sceNpSessionSignalingGetGroupFromSessionId (UGcXquhVYrY, was a throwing stub) (ctx, sessionId*, group*), slot 0x170 either null 0x80553303, else 0x8055330A
sceNpSessionSignalingGetConnectionFromPeerAddress2 (DicBhsm2iR4, now implemented the same way on main, unchanged here) (ctx, group, peer*, connId*), slot 0x158 either null 0x80553303, else 0x8055330A

docs/dev/debt/libSceNpSessionSignaling.md: the three "signature unknown" entries for these exports are replaced by one entry. It says every lookup on a valid context ends at not-found, and that the signatures and the checks before that are the console's. GetConnectionFromNetAddress leaves the "names and NIDs only" entry. The GetGroupFromSessionId entry that #6039 adds to a new debt file ("signature unknown") becomes obsolete once this lands.

Tested

Linux (CachyOS, GCC, Release). guest_np_session_signaling_tests passes. It now covers each export's null-argument result and its not-found result, and checks that no failed lookup writes an output.

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: PPSA31327 #6722 and PPSA08587 #6591 import GetGroupInfo (and PPSA31327 GetConnectionFromNetAddress2); not run with either title
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code), reviewed by the contributor

🤖 Generated with Claude Code

https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4934160738 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8320). Originally posted by [hypermoist](https://github.com/hypermoist) on 2026-10-20T10:02:56Z. --- ### What Implements five signaling lookups and fixes a sixth, using the decrypted `libSceNpSessionSignaling.sprx` as evidence. **Firmware pattern.** Every export follows the same shape: 1. it fetches the library object and returns `0x80553301` if the library isn't initialised; 2. it checks its pointer arguments and returns `0x80553303` for a null one; 3. it looks up the context and returns `0x80553308` if that fails; 4. it calls one virtual method of the context. The 54-entry vtable is at `0xd0560`. **What the inner methods return.** Each inner method locks the context, walks its group list (`[ctx + 0x140]`) and returns `0x8055330A` if the group isn't there. The methods without a group argument walk the connections and return `0x8055330C` instead. Upstream never activates a session, so no group or connection exists, and every lookup ends with that code. `main` now tracks initialisation and contexts, so each export first returns `0x80553301` before initialisation and `0x80553308` for an unknown context, in the console's order. | Export | Arguments (firmware registers) | Result here | |---|---|---| | `sceNpSessionSignalingGetGroupInfo` (`WtOs6cUbrx8`, was a throwing stub) | `(ctx, group, info*)`, slot `0x130` | `0x80553303` for a null info, else `0x8055330A` | | `sceNpSessionSignalingGetConnectionFromNetAddress2` (`hbNcE4fnBDs`, was a throwing stub) | `(ctx, group, addr, port, connId*)`, slot `0x160` | null `connId` `0x80553303`, else `0x8055330A` | | `sceNpSessionSignalingGetConnectionFromNetAddress` (`RcGZnakPiOk`, was a throwing stub) | `(ctx, addr, port, connId*)`, slot `0x150` | null `connId` `0x80553303`, else `0x8055330C` | | `sceNpSessionSignalingGetConnectionFromPeerAddress` (`dJJ0UPrrsok`, was a throwing stub) | `(ctx, peer*, connId*)`, slot `0x148` | either null `0x80553303`, else `0x8055330C` | | `sceNpSessionSignalingGetGroupFromSessionId` (`UGcXquhVYrY`, was a throwing stub) | `(ctx, sessionId*, group*)`, slot `0x170` | either null `0x80553303`, else `0x8055330A` | | `sceNpSessionSignalingGetConnectionFromPeerAddress2` (`DicBhsm2iR4`, now implemented the same way on `main`, unchanged here) | `(ctx, group, peer*, connId*)`, slot `0x158` | either null `0x80553303`, else `0x8055330A` | `docs/dev/debt/libSceNpSessionSignaling.md`: the three "signature unknown" entries for these exports are replaced by one entry. It says every lookup on a valid context ends at not-found, and that the signatures and the checks before that are the console's. `GetConnectionFromNetAddress` leaves the "names and NIDs only" entry. The `GetGroupFromSessionId` entry that #6039 adds to a new debt file ("signature unknown") becomes obsolete once this lands. ### Tested Linux (CachyOS, GCC, Release). `guest_np_session_signaling_tests` passes. It now covers each export's null-argument result and its not-found result, and checks that no failed lookup writes an output. ### 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: PPSA31327 #6722 and PPSA08587 #6591 import `GetGroupInfo` (and PPSA31327 `GetConnectionFromNetAddress2`); not run with either title - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code), reviewed by the contributor 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
github-actions[bot] commented 2026-10-20 10:03:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T10:03:40Z.


Progress report (6ef5a1c → 400d333)

📈 System libraries: 42.38% (+0.05%, +5 implemented functions)

✅ 5 implemented
Library Name
libSceNpSessionSignaling sceNpSessionSignalingGetConnectionFromNetAddress
libSceNpSessionSignaling sceNpSessionSignalingGetConnectionFromNetAddress2
libSceNpSessionSignaling sceNpSessionSignalingGetConnectionFromPeerAddress
libSceNpSessionSignaling sceNpSessionSignalingGetGroupFromSessionId
libSceNpSessionSignaling sceNpSessionSignalingGetGroupInfo
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6288445593 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8320#issuecomment-6288445593). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-20T10:03:40Z. --- <!-- progress-report --> ### Progress report (6ef5a1c → 400d333) 📈 **System libraries**: 42.38% (+0.05%, +5 implemented functions) <details> <summary>✅ 5 implemented</summary> | Library | Name | | - | - | | libSceNpSessionSignaling | `sceNpSessionSignalingGetConnectionFromNetAddress` | | libSceNpSessionSignaling | `sceNpSessionSignalingGetConnectionFromNetAddress2` | | libSceNpSessionSignaling | `sceNpSessionSignalingGetConnectionFromPeerAddress` | | libSceNpSessionSignaling | `sceNpSessionSignalingGetGroupFromSessionId` | | libSceNpSessionSignaling | `sceNpSessionSignalingGetGroupInfo` | </details>
oneandonlydean commented 2026-10-20 10:06:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T10:06:11Z.


Thanks, the argument checks and not-found codes are clear, and the test checks that a failed lookup writes nothing.

One thing to update with it: docs/dev/debt/libSceNpSessionSignaling.md still describes these exports as they were before. sceNpSessionSignalingGetConnectionFromPeerAddress is listed as added without an implementation, sceNpSessionSignalingGetGroupInfo and sceNpSessionSignalingGetConnectionFromNetAddress2 as declared without parameters with unknown signatures, and sceNpSessionSignalingGetConnectionFromNetAddress and sceNpSessionSignalingGetGroupFromSessionId in the list after them. Could you remove or update those entries in this PR? Since the firmware's "not initialised" (0x80553301) and unknown-context (0x80553308) checks are not reproduced here, a short note saying so would keep the file accurate.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6288487799 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8320#issuecomment-6288487799). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T10:06:11Z. --- Thanks, the argument checks and not-found codes are clear, and the test checks that a failed lookup writes nothing. One thing to update with it: `docs/dev/debt/libSceNpSessionSignaling.md` still describes these exports as they were before. `sceNpSessionSignalingGetConnectionFromPeerAddress` is listed as added without an implementation, `sceNpSessionSignalingGetGroupInfo` and `sceNpSessionSignalingGetConnectionFromNetAddress2` as declared without parameters with unknown signatures, and `sceNpSessionSignalingGetConnectionFromNetAddress` and `sceNpSessionSignalingGetGroupFromSessionId` in the list after them. Could you remove or update those entries in this PR? Since the firmware's "not initialised" (`0x80553301`) and unknown-context (`0x80553308`) checks are not reproduced here, a short note saying so would keep the file accurate.
hypermoist commented 2026-10-20 10:08:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hypermoist on 2026-10-20T10:08:13Z.


Thanks, updated in the latest push:

  • In docs/dev/debt/libSceNpSessionSignaling.md, the entries that described these exports as unimplemented or with unknown signatures are gone: the GetConnectionFromPeerAddress entry, the PPSA31327 GetGroupInfo/GetConnectionFromNetAddress2 entry, and GetConnectionFromNetAddress in the 3.20 inventory list.
  • A new Functional entry covers all six lookups. It records that the console's uninitialised-library (0x80553301) and unknown-context (0x80553308) checks are not reproduced, because neither is tracked here, so those cases also get the not-found result.

I merged main into the branch to pick up the debt file, so there was no force-push.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6288522389 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8320#issuecomment-6288522389). Originally posted by [hypermoist](https://github.com/hypermoist) on 2026-10-20T10:08:13Z. --- Thanks, updated in the latest push: - In `docs/dev/debt/libSceNpSessionSignaling.md`, the entries that described these exports as unimplemented or with unknown signatures are gone: the `GetConnectionFromPeerAddress` entry, the PPSA31327 `GetGroupInfo`/`GetConnectionFromNetAddress2` entry, and `GetConnectionFromNetAddress` in the 3.20 inventory list. - A new Functional entry covers all six lookups. It records that the console's uninitialised-library (`0x80553301`) and unknown-context (`0x80553308`) checks are not reproduced, because neither is tracked here, so those cases also get the not-found result. I merged `main` into the branch to pick up the debt file, so there was no force-push.
xXPBSXx commented 2026-10-21 05:44:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T05:44:49Z.


Windows data point for 6cd31eeaa merged onto main 1fd67185b (clean, git merge-tree rc 0): Windows 10.0.19045, MinGW-w64 GCC 15.2.0, Release. ctest -N -R '^guest_np_session_signaling$' lists exactly that one test; ctest --no-tests=error -R '^guest_np_session_signaling$' was run three times per tree.

  • With the PR: passes 3 of 3 (0.07-1.3 s).
  • Same tree with core/libs/prx/libSceNpSessionSignaling/Export.cpp restored to main (the new test cases kept): fails 3 of 3, exit code 0xc0000409 (the test process aborts).
    Not tested: other platforms, a title run.
    AI-assisted (Claude Code).
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309012971 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8320#issuecomment-6309012971). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-21T05:44:49Z. --- Windows data point for `6cd31eeaa` merged onto `main` `1fd67185b` (clean, `git merge-tree` rc 0): Windows 10.0.19045, MinGW-w64 GCC 15.2.0, Release. `ctest -N -R '^guest_np_session_signaling$'` lists exactly that one test; `ctest --no-tests=error -R '^guest_np_session_signaling$'` was run three times per tree. - With the PR: passes 3 of 3 (0.07-1.3 s). - Same tree with `core/libs/prx/libSceNpSessionSignaling/Export.cpp` restored to `main` (the new test cases kept): fails 3 of 3, exit code `0xc0000409` (the test process aborts). Not tested: other platforms, a title run. AI-assisted (Claude Code).
BunnyFl commented 2026-10-22 08:42:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-10-22T08:42:53Z.


Checked the six exports against firmware 13.42: the same order of checks (not initialised, null outputs, unknown context), the same arguments checked for null, and the same vtable slots. I didn't trace the inner methods' not-found codes.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336581213 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8320#issuecomment-6336581213). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-10-22T08:42:53Z. --- Checked the six exports against firmware 13.42: the same order of checks (not initialised, null outputs, unknown context), the same arguments checked for null, and the same vtable slots. I didn't trace the inner methods' not-found codes. AI-assisted: yes (Claude Code)
hypermoist commented 2026-10-22 09:10:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hypermoist on 2026-10-22T09:10:17Z.


@BunnyFl thanks for checking against 13.42. Your order (not initialised, null outputs, unknown context) matches what I read from 12.00 and what the six lookups now do. @xXPBSXx thanks for the Windows run and its control.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6337085857 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8320#issuecomment-6337085857). Originally posted by [hypermoist](https://github.com/hypermoist) on 2026-10-22T09:10:17Z. --- @BunnyFl thanks for checking against 13.42. Your order (not initialised, null outputs, unknown context) matches what I read from 12.00 and what the six lookups now do. @xXPBSXx thanks for the Windows run and its control.
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!8320
No description provided.