52 Commits
Author SHA1 Message Date
Dean 183b3ce70a Merge pull request #15251 from BunnyFl/fix/libscenpmanager-sandbox-info
feat(libSceNpManager): answer sceNpGetSandboxInfo as firmware 13.42 does in the production environment
2026-11-04 08:12:06 +13:00
Dean 3f0b20b863 Merge pull request #15201 from MarrasFederico/feat/np-set-game-presence-online-a
feat(libSceNpManager): answer sceNpSetGamePresenceOnlineA for a signed-out user
2026-11-03 21:12:13 +13:00
BunnyFlandClaude Opus 5.5 6f24690b78 feat(libSceNpManager): answer sceNpGetSandboxInfo as firmware 13.42 does in the production environment
Firmware 13.42's libSceNpManager.sprx returns 0x80550003 for a null
buffer, clears the 0x50-byte block, and in the production NP environment
("np" or "e1-np") writes RETAIL at 0x00 and LIVE at 0x28. AnyPS5 now
gives that answer instead of throwing, so PPSA28416 gets past its first
call. The branch chosen by an unidentified import and the module's
not-initialised result are listed in the debt entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 23:15:15 +01:00
Federico Marras 72ccb10bd9 feat(libSceNpManager): answer sceNpSetGamePresenceOnlineA for a signed-out user
sceNpSetGamePresenceOnlineA in PendingExports.cpp threw NotImplemented_nid_no_patch. In shadPS4 (2183807e59, np_manager.cpp L1092-L1119) it takes (reqId, userId, presence), rejects USER_SERVICE_USER_ID_INVALID and reqId 0 with SCE_NP_ERROR_INVALID_ARGUMENT, and returns SCE_NP_ERROR_REQUEST_NOT_FOUND for an unknown or deleted request. Validate those cases in that order and return SCE_NP_ERROR_SIGNED_OUT for a live request, matching sceNpSetGamePresenceOnline on main.
2026-11-02 21:13:50 +01:00
Noxy-HNR 1cf2766adf test(libSceNpManager): stop asserting calls remain unimplemented 2026-11-02 11:07:18 -06:00
Noxy-HNR 158b662f7e fix(libSceNpManager): keep in-game message preparation throwing and bound the ids 2026-11-02 16:29:04 +00:00
Noxy-HNR aef0e4aeef test(libSceNpManager): check that in-game message handles get distinct ids 2026-11-02 16:28:54 +00:00
Noxy-HNR 7fa4db97f5 feat(libSceNpManager): add the in-game message context and handle lifecycle
Implement sceNpInGameMessageInitialize, Terminate, CreateHandle, DeleteHandle, AbortHandle, PrepareA and SendDataA for a console with no signed-in user.
2026-11-02 16:28:45 +00:00
BunnyFlandClaude Opus 5.5 81e542cb2b feat(libSceNpManager): recognize the unregistered client error as firmware 13.42 does
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 00:33:33 +01:00
Adrià b462d3b58a Merge pull request #12429 from simnJS/feat/npmanager-wait-async
feat(libSceNpManager): answer sceNpWaitAsync as sceNpPollAsync does
2026-10-29 11:18:51 +01:00
Dean 82b85218f7 Merge pull request #11543 from milescoviello/test/npmanager-account-age-language-premium
test(libSceNpManager): cover the account age and language queries and the premium event callback
2026-10-29 07:21:56 +13:00
simnJS 9b9e87bd72 feat(libSceNpManager): answer sceNpWaitAsync as sceNpPollAsync does 2026-10-28 14:18:04 +01:00
Dean 3c36c5a6ba Merge pull request #11539 from milescoviello/test/npmanager-signed-out-state
test(libSceNpManager): cover the signed-out answers of the NP state, sign-up, reachability and premium queries
2026-10-27 19:06:12 +13:00
Dean 8001b11043 Merge pull request #11517 from milescoviello/test/npmanager-get-account-id-a
test(libSceNpManager): cover sceNpGetAccountIdA's signed-out answer
2026-10-27 19:02:37 +13:00
milescovielloandClaude Opus 5.5 063d3ca738 test(libSceNpManager): cover the signed-out answers of the NP state, sign-up, reachability and premium queries
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 18:15:04 +00:00
milescovielloandClaude Opus 5.5 24c2a68f4c test(libSceNpManager): cover the account age and language queries and the premium event callback
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 18:01:27 +00:00
milescovielloandClaude Opus 5.5 f77ba4ac0f test(libSceNpManager): cover sceNpGetAccountIdA's signed-out answer
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 17:49:37 +00:00
Yunus Shaikh 350d27a531 Merge branch 'feat/npmanager-idmapper-requests' into feat/npmanager-int-getters 2026-10-25 16:00:59 -07:00
Yunus Shaikh c65fa57993 Merge main into feat/npmanager-idmapper-requests 2026-10-25 15:59:53 -07:00
Adrià 49d1f9b07e Merge pull request #9726 from KernelPanicNT/fix/npmanager-state-callback-id-error
fix(libSceNpManager): return the module error for an out-of-range state callback id
2026-10-25 23:49:10 +01:00
Yunus Shaikh 3eceb81ad0 fix(libSceNpManager): follow the measured NpManagerInt getter checks
BunnyFl measured firmware 13.42 libSceNpManager.sprx for the eleven
NpManagerInt getters. They now take the measured arguments and refuse
as measured: user id -1 or a null required pointer gives
INVALID_ARGUMENT, the authorization calls also refuse their value and
mode ranges (0x80550004 for the mode), and the PSNO URI form refuses
its size (0x80550011) and a URI of 0x2000 bytes or more (0x80550005).
Past the checks they keep main's offline signed-out answer for any
request id, and the tests take their request ids from the NpManagerInt
request table.
2026-10-25 12:20:58 +00:00
Yunus Shaikh 4e9ad120a8 Merge branch 'fix/npmanager-idmapper-measured-v2' into fix/npmanager-int-getters-measured
# Conflicts:
#	core/libs/tests/GuestNpManager.cpp
2026-10-25 12:20:58 +00:00
Yunus Shaikh 9345b1fe88 fix(libSceNpManager): follow the measured IdMapper checks and NpManagerInt request table
BunnyFl measured firmware 13.42 libSceNpManager.sprx. The IdMapper
account-id lookups take seven arguments: a request id of 0 or less
gives 0x80553085, then user id -1, a null pointer or a value outside
1 to 1000 gives 0x80553083, and past the checks they answer signed out
as main's offline model does. IdMapper abort and delete refuse a
request id of 0 or less with 0x80553085, and IdMapper requests get a
counter of their own instead of the sceNpCreateRequest pool.

NpManagerInt requests sit in a 64-slot table of their own: the 65th
live request gives 0x80559D05, delete gives 0x80559D0A for an id the
table does not hold, and abort answers from the offline service.
2026-10-25 12:13:08 +00:00
Yunus Shaikh 3fbd8a1453 feat(libSceNpManager): report the NpManagerInt authorization calls as signed out
sceNpManagerIntAuthGetAuthorizationCode, AuthGetIdToken,
GetAuthorizationCode and GetAuthorizationCodeWithPsnoUri return
SCE_NP_ERROR_SIGNED_OUT. That is the answer libSceNpAuth's
authorization-code and ID-token calls give for a live request while NP
is signed out. Their signatures are unknown, so they read no argument.
2026-10-25 05:42:22 +00:00
Yunus Shaikh fe2f380636 feat(libSceNpManager): report the NpManagerInt user lookups as signed out
sceNpManagerIntGetUserIdByOnlineId and GetUserIdByNpId return
SCE_NP_ERROR_SIGNED_OUT, as sceNpGetUserIdByOnlineId does while NP is
signed out. An NpId carries the online ID, so the NpId form is the same
lookup. Neither reads an argument.
2026-10-25 05:41:50 +00:00
Yunus Shaikh c4363b0415 feat(libSceNpManager): report the NpManagerInt profile getters as signed out
sceNpManagerIntGetAccountAge, GetAccountCountryA, GetAccountLanguageA,
GetNpId and GetOnlineId return SCE_NP_ERROR_SIGNED_OUT, as their public
twins do while NP is signed out. Their signatures are unknown, so they
read no argument and write nothing.
2026-10-25 05:41:13 +00:00
Yunus Shaikh 5997af6c13 feat(libSceNpManager): report the IdMapper account-id lookups as signed out 2026-10-25 02:35:28 +00:00
Yunus Shaikh b1f6cc6a91 feat(libSceNpManager): implement the NpManagerInt request lifecycle 2026-10-25 02:34:28 +00:00
Yunus Shaikh 5d9f8168db feat(libSceNpManager): implement the IdMapper request lifecycle 2026-10-25 02:33:34 +00:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
sivasdeadknight 71932c0a56 fix(libSceNpManager): validate request ids for abort, delete and poll
sceNpAbortRequest and sceNpDeleteRequest return SCE_NP_ERROR_REQUEST_NOT_FOUND
for an id that was never created or was deleted; sceNpPollAsync does too and
additionally rejects a null result pointer with SCE_NP_ERROR_INVALID_ARGUMENT
before reading the id, without writing the caller's result. A live request
keeps its signed-out completion. This pins the validation half of shadPS4's
np_manager model that issue #9277 reports; the kind, completion state and
WaitAsync publication half stays open, documented in the debt entry, and the
sceNpWaitAsync export itself stays with PR #9282.

Tests: guest_np_manager tests the four absent/deleted probes (0, -1, 0x7fffffff,
a deleted id) for all three calls, output preservation, null-result precedence
and the live-id paths; guest_np_reachability unchanged. Both pass on Linux; the
new asserts failed on unpatched exports first.
2026-10-23 03:28:13 +02:00
KernelPanicNT 8029493488 fix(libSceNpManager): return the module error for an out-of-range state callback id
sceNpUnregisterStateCallbackA returns 0x80550015 for a callback id
outside 1..8, compared unsigned so 0, negative ids and INT_MIN are
included, as libSceNpManager.sprx does at RVA 0x15b10 in prosper's
reading. An empty slot still returns 0x80550009.
2026-10-22 18:24:56 +00:00
Rookie f0e63df885 feat(libSceNpManager): answer the user ID account queries for a signed-out user
sceNpCheckNpAvailabilityA, sceNpGetAccountLanguageA,
sceNpGetParentalControlInfoA and sceNpGetAccountDateOfBirthA return
SIGNED_OUT without writing, like sceNpGetAccountCountryA. The game
presence queries report OFFLINE. A null pointer or user id -1 is
INVALID_ARGUMENT, and the request forms refuse request id 0 and an
unknown request as sceNpSetGamePresenceOnline does. Signatures and
checks follow shadPS4 and Orbital; sceNpIsPlusMember keeps throwing.
2026-10-22 14:33:49 +01:00
Dean a16664584e Merge pull request #9225 from YossiYad/feat/npmanager-plus-content-restriction
feat(libSceNpManager): implement sceNpIsPlusMember and sceNpSetContentRestriction
2026-10-22 19:09:14 +13:00
Dean b27924d851 Merge pull request #9085 from YossiYad/feat/npmanager-check-callback-for-lib
feat(libSceNpManager): implement sceNpCheckCallbackForLib
2026-10-22 18:53:46 +13:00
boykopovar 6aa2dd97b7 fix(npmanager): restore availability output and online id input 2026-10-21 21:53:57 +03:00
Yossi Yadgar 28d2b827dd test(libSceNpManager): check the Plus membership query and the content restriction checks 2026-10-21 18:33:30 +03:00
Dean 74bdc3a3a7 Merge pull request #8110 from savvaniss/feat/np-account-signed-out
feat(libSceNpManager): answer the PS4 account and presence queries for a signed-out user
2026-10-22 01:54:31 +13:00
Yossi Yadgar 38e3a0e1f6 test(libSceNpManager): deliver the state callbacks through sceNpCheckCallbackForLib 2026-10-21 14:59:31 +03:00
Savvanis SpyrosandClaude Opus 5.5 79a5d6b65a fix(libSceNpManager): refuse an unknown request in sceNpSetGamePresenceOnline
After the argument checks, shadPS4 looks the request up and returns
REQUEST_NOT_FOUND for one that was never created or was deleted. The
library already tracks live requests for sceNpSetTimeout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 14:13:04 +03:00
Savvanis SpyrosandClaude Opus 5.5 44dfebb524 fix(libSceNpManager): take the request id and online id in sceNpSetGamePresenceOnline
shadPS4 declares sceNpSetGamePresenceOnline(req_id, online_id, presence)
and returns INVALID_ARGUMENT for request id 0 or a null online id. The
export took (user id, timeout), so a caller's arguments landed in the
wrong registers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 10:06:06 +03:00
orezraeyandClaude Opus 5.5 2a0f252396 feat(libSceNpManager): accept game presence callbacks while signed out
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 10:43:48 -03:00
Savvanis SpyrosandClaude Opus 5.5 6e4c01f91c feat(libSceNpManager): answer the PS4 account id and presence queries for a signed-out user
sceNpGetAccountId and sceNpSetGamePresenceOnline report NP as signed
out, and sceNpUnregisterPlusEventCallback returns 0 like the premium
form.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 03:19:49 +03:00
Adrià 1a2d485032 Merge pull request #7597 from voidlakhan/fix/np-null-pointer-checks
fix(npmanager): validate null output pointers
2026-10-20 01:15:52 +02:00
Savvanis SpyrosandClaude Opus 5.5 d42fb3130d feat(libSceNpManager): answer the PS4 account queries for a signed-out user
sceNpGetAccountCountry, sceNpGetAccountDateOfBirth, sceNpGetAccountLanguage
and sceNpGetParentalControlInfo take an online id that matches no user,
sceNpGetUserIdByOnlineId and sceNpCheckPlus report NP as signed out, and
sceNpNotifyPlusFeature is declared and throws.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 01:04:01 +03:00
Adrià b5ab10185b Merge pull request #6121 from fdfawef324/claude/mc-np-state-callbacks
feat(libSceNpManager): register NP state callbacks and report signed-out from sceNpCheckCallback
2026-10-18 18:57:53 +02:00
lakhantheboss 766f4ea872 fix(npmanager): validate null output pointers 2026-10-18 21:40:59 +05:30
notaxeltvandCursor af9d039d61 feat(libSceNpManager): export two unknown NIDs so PPSA34015 can load
Co-authored-by: Cursor <[email protected]>
2026-10-16 23:40:42 +02:00
alfalfa-starandClaude Opus 5.5 56d8b4f68d feat(npmanager): implement sceNpGetUserIdByAccountId
Account id 0 or a null output returns SCE_NP_ERROR_INVALID_ARGUMENT;
otherwise the always signed-out NP returns SCE_NP_ERROR_SIGNED_OUT, as
sceNpGetAccountIdA does. PPSA14632 imports it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 08:00:31 +02:00
fdfawef324andClaude Opus 5.5 9f96444c4a feat(libSceNpManager): register NP state callbacks and report signed-out from sceNpCheckCallback
sceNpRegisterStateCallback and sceNpRegisterStateCallbackA stored nothing,
the unregister calls always succeeded and sceNpCheckCallback did nothing,
so a title that waits for its NP state callback never learned the user's
state. #1277 reports that Minecraft Preview (PPSA19639) needs the callback
(stop 2).

sceNpRegisterStateCallbackA now keeps up to 8 callbacks and returns the
slot plus 1. A null callback returns INVALID_ARGUMENT, a callback that is
already registered CALLBACK_ALREADY_REGISTERED and a ninth one
CALLBACK_MAX (0x8055001D). sceNpUnregisterStateCallbackA returns
INVALID_ARGUMENT for an id outside 1..8 and CALLBACK_NOT_REGISTERED for an
empty slot. The legacy sceNpRegisterStateCallback keeps one callback with
the same errors. The rules follow shadPS4
src/core/libraries/np/np_manager.cpp @15abf68c9b52 (RegisterStateCallbackA
and UnregisterStateCallbackAById L857-L901, the legacy pair L981-L1005,
ORBIS_NP_STATE_CALLBACK_MAX L36) and np_error.h L38.

Each registration is marked pending. sceNpCheckCallback takes the pending
registrations under the lock and calls them after releasing it, on the
calling thread, with SIGNED_OUT for the initial user 0x10000000. For the A
form this follows KytyPS5 src/libs/network.cpp @9e41d8320a27
(NpRegisterStateCallbackA L4021-L4034 marks the registration pending,
NpCheckCallback L3959-L3974 delivers it once). KytyPS5 never calls the
legacy callback (NpRegisterStateCallback and NpUnregisterStateCallback,
L4009-L4019, do nothing). The legacy callback is called as
(user, SIGNED_OUT, nullptr, userdata), as in shadPS4, which passes an NpId
only for SIGNED_IN (L823, L938-L940).

shadPS4 queues SIGNED_OUT from the user service login event instead
(DispatchPendingNpStateCallbacks L903-L962), and the same event calls the
reachability callback once with UNAVAILABLE (L922-L931, L959-L961). The
reachability callback is still not called here. These differences and the
unmeasured console behaviour are recorded in
docs/dev/debt/libSceNpManager.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 18:12:19 -04:00