Files
AnyPS5/docs/dev/debt/libSceNpCppWebApi.md

25 KiB

libSceNpCppWebApi technical debt

Functional

  • Matches factory output release - releasing the last reference of an occupied output with a null deleter still throws through the shared IntrusivePtr release path. The bundled modules instead use the stored LibContext allocator and model destructor in that case; the host allocator remains in use, and that fallback is unimplemented.

Silent stubs

  • sce::Np::CppWebApi title-imported parameter bookkeeping (libSceNpCppWebApi) - the SessionManager::V1 GameSessionsApi ParameterTo* constructors, destructors, initialize and terminate, the RequestGameSession*/Patch*RequestBody/RequestMatch*/Added*/Removed*/RequestPlayer*/RequestTeam*/RequestMember*/RequestResults* setters, and the Common IntrusivePtr/Vector/Transaction constructors, destructors and bookkeeping calls over the new families succeed without keeping state or contacting the network. The values are never read because a request is never started. Behaviour beyond the signatures has no source.

  • sce::Np::CppWebApi::Common (libSceNpCppWebApi) - the finish overrides of DownStreamTransaction<...> (2 instantiations) and Vector<IntrusivePtr<Leaderboards::V1::User>>::pushBack return success without doing work; a failed request never produces a transaction to finish. Transaction<...>::setOnFinishedCallback and TransactionBase<...>::setResponseInformationOption (5 instantiations each, the UserProfile::V1, ProfanityFilter::V2 and CommunicationRestrictionStatus::V3 responses) return success without storing the callback or the option: start fails, so neither is ever used. The constructors and destructors of the same five Transaction<...> instantiations succeed without keeping state

  • sce::Np::CppWebApi::Leaderboards::V1 (libSceNpCppWebApi) - request-body bookkeeping succeeds without storing state: GetRankingRequestBody::set{StartSerialRank,Group,Limit,Users,Offset}, RecordScoreRequestBody::set{Comment,SmallData,NeedsTmpRank,ComparedDateTime,PcId} and User::{setAccountId,setPcId}. BoardsApi::ParameterToGetBoardDefinition, RecordApi::ParameterToRecordLargeData, RecordApi::ParameterToRecordScore, ViewApi::ParameterToGetLargeDataByObjectId and ViewApi::ParameterToGetRanking keep only whether they are initialized, as the SessionManager::V1 parameters do: initialize and terminate return the codes of the module bundled with PPSA21564, 0x80553512 for an empty RecordScoreRequestBody included. They store none of the arguments, and setxPsnAtomicOperation and setgetRankingRequestBody store nothing either

  • sce::Np::CppWebApi::SessionManager::V1 (libSceNpCppWebApi) - RequestPlayerSession::set{MaxSpectators,InvitableUserType,JoinableUserType,ExclusiveLeaderPrivileges} and RequestPlayerSessionPlayer::setPushContexts succeed without storing state. The PlayerSessionsApi parameters ParameterToCreatePlayerSessions, ParameterToGetPlayerSessionInvitations, ParameterToJoinPlayerSessionAsPlayer and ParameterToLeavePlayerSession keep only whether they are initialized, as the TitleCloudStorage ones do: initialize, terminate and setinvitationInvalidFilter return the codes of the module bundled with PPSA21564, plus 0x80553512 when the request body of ParameterToCreatePlayerSessions or ParameterToJoinPlayerSessionAsPlayer is empty. They store none of the strings or bodies, and setfields stores nothing either: only a request would read them

  • sce::Np::CppWebApi::TitleCloudStorage::V1 and InGameCatalog::V5 (libSceNpCppWebApi) - DataApi::ParameterToDownloadData, DataApi::ParameterToGetMultiDataStatusesByUser and ContainerApi::ParameterToGetContainer keep only whether they are initialized. initialize, terminate and the string setters return the codes of the module bundled with PPSA21564: 0x80553503 for a null LibContext or string, 0x80553502 for a LibContext that Common::initialize did not set or a parameter not yet initialized, 0x8055350f for a second initialize and 0x80553510 for terminate without one; an empty SetDataInfo body returns 0x80553512. ParameterToUploadData, ParameterToSetDataInfo, ParameterToDeleteMultiDataByUser and ParameterWithBinaryRequestBodyToUploadData add state-less setters and keep only the initialized flag. None store values; only a request would read them. DataStatus::{getLastUpdatedDateTime,getInfo} and UploadDataResponseHeaders::{getXPsnAtomicOperationId,hasXPsnAtomicOperationId} throw, as a failed request never produces those objects. The console behaviour is not measured.

  • sce::Np::CppWebApi::UserProfile::V1, ProfanityFilter::V2, CommunicationRestrictionStatus::V3 (libSceNpCppWebApi) - FriendsApi::ParameterToGetFriends, PresenceApi::ParameterToGetBasicPresences, BlocksApi::ParameterToGetBlockingUsers, ProfanityApi::ParameterToFilterProfanity and CommunicationRestrictionStatusApi::ParameterToGetCommunicationRestrictionStatus keep only whether they are initialized, as the SessionManager::V1 parameters do: initialize and terminate return the codes of the module bundled with PPSA21564, 0x80553512 for an empty WebApiFilterRequest included. They store none of the arguments: only a request would read them

  • sce::Np::CppWebApi::UserProfile::V1 public profiles (libSceNpCppWebApi) - BasicProfileApi::ParameterToGetPublicProfile {ctor,dtor,initialize,terminate} and TransactionBase<IntrusivePtr<GetPublicProfilesResponse>>::setResponseInformationOption return success without keeping state, as the plural ParameterToGetPublicProfiles does, and the constructor and destructor of Transaction<IntrusivePtr<GetPublicProfileResponse>> do the same: start fails, so none of them is ever used

  • sce::Np::CppWebApi::Activities::V1 (libSceNpCppWebApi) - ParameterToGetUserActivities::initialize ignores the account-id vector, setlimit and setnpServiceLabel store their value in a host block that nothing reads, and getUserActivities returns SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN; the response accessors throw because an offline request never produces a response object. The 0x10-byte handle and the lifecycle codes come from the module bundled with PPSA21564/PPSA23732 (builds J03093737/J03341606, addresses 0x3e7a10, 0x3e7a70, 0x3e7cb0, 0x3e7e50, 0x3e7ec0, 0x3e7f20); the module's setters write no return value, so they stay void. Nothing here is measured on a console. PPSA22408 (Hot Wheels Infinite Rush) imports the 15 NIDs

Unknown function info

  • sce::Np::CppWebApi (libSceNpCppWebApi) - every request entry point (API calls, transaction start/getResponse/readData, the *Factory::creates) returns SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN offline. The constant's name and value follow the reference tables in shadPS4 np_error.h and fpPS4 np_error.pas, where 0x80552907 is ORBIS_NP_WEBAPI_ERROR_NOT_SIGNED_IN and 0x80552901 is OUT_OF_MEMORY (no UNAVAILABLE exists in the 0x80552901-0x8055291F range); it is the code a signed-out console returns from these entry points. The earlier 0x80552901 value came from the module the previous implementation shipped, which used the same incorrect constant

  • sce::Np::CppWebApi::Common::IntrusivePtr (libSceNpCppWebApi) - the 0x18-byte layout (object, deleter, LibContext*) and the offset of the 32-bit reference count in the pointee (0x00; in a Vector, 0x20 for unsigned long, 0x30 for IntrusivePtr and 0x38 for String elements) come from the module bundled with one title (PPSA21564); other SDK versions are not checked. The destructor throws on the last reference of a pointer without a deleter: destroying the object needs its destructor and the LibContext allocator, which are not implemented

  • sce::Np::CppWebApi::Common::String (libSceNpCppWebApi) - the 0x20-byte layout (32-bit reference count, buffer at 0x08, used size including the terminator at 0x10, LibContext* at 0x18), the +0x10 semantics and the 0x80553503/0x80553504 results follow the module bundled with PPSA21564 and PPSA23732 (builds J03093737/J03341606): append, copyFrom, clear, size, length, operator==, setContext and the intrusive reference operations match it. Allocation and release still use the host allocator instead of the LibContext allocator, so a title-provided buffer released through this destructor would use the wrong allocator; find, replace and npos remain unimplemented. pushBack into Vector<String> stores a deep copy, so a destroyed temporary cannot invalidate the stored element; a title that byte-copies a String with a live buffer would still double-free, as nothing increments the reference count

  • sce::Np::CppWebApi::Common::Vector (libSceNpCppWebApi) - imported by PPSA03671, whose dump ships no libSceNpCppWebApi.prx. A Vector handle is an IntrusivePtr over a shared body; bodies created by pushBack use a host layout with the reference count at 0x30. The pointer/deleter constructor adopts a title-provided Vector<String>, counting the reference at 0x38, which the Vector<String> constructor zeroes, as the module bundled with PPSA21564 does, and releases it through the stored deleter; pushBack on such a body throws, as its element layout is unknown. Vector<String>::begin/end and Iterator<String> operators walk host-created bodies and throw on title-provided ones; other begin, end and iterators, and copyFrom, throw: the only Vectors the title reads back come from failed transactions, which never produce one. empty, size and operator[] read host-created bodies and throw on title-provided ones

  • sce::Np::CppWebApi::Common::Binary (libSceNpCppWebApi) - the 0x20-byte layout (32-bit reference count, buffer at 0x08, size at 0x10, LibContext* at 0x18) comes from the module bundled with PPSA21564/PPSA23732 (builds J03093737/J03341606); other SDK versions are not checked. setBinary and appendBinary use the host allocator instead of the LibContext allocator, reject a null source with a non-zero size where the module does not, keep the old contents when the input is invalid or allocation fails, and copy the input before releasing a buffer it aliases. A title that byte-copies a Binary with a live buffer would double-free, as nothing increments the reference count

  • sce::Np::CppWebApi::Common::Vector audited members (libSceNpCppWebApi) - begin, end, iterators and copyFrom follow the bundled module for the audited IntrusivePtr/unsigned long families (iterator = zero tag plus element pointer; copyFrom replaces elements through the element reference count) and throw on adopted bodies and other families; they accept either the IntrusivePtr handle or the object its operator-> returns, which module bodies read at offsets 0x18/0x28. copyFrom releases old elements — a deliberate deviation: the module installs the fresh zeroed array before its release loop

  • sce::Np::CppWebApi::SessionManager::V1 friends player sessions (libSceNpCppWebApi) - the getFriendsPlayerSessions family follows the module bundled with the titles (build J03341606): Friend stores account id at 0x10, accountIdIsSet at 0x18, IntrusivePtr<Vector<FriendJoinedPlayerSession>> at 0x30 and playerSessionsIsSet at 0x48; FriendJoinedPlayerSession stores String sessionId at 0x10 and sessionIdIsSet at 0x30; the response body stores IntrusivePtr<Vector<Friend>> at 0x30. Vector views use the real inline layout (begin 0x18, end 0x28, refcount 0x30, 0x18-byte elements). The model layouts are measured in build J03341606; destroying the last vector reference without a deleter throws until the allocator lands. Other builds are not checked.

  • sce::Np::CppWebApi::SessionManager::V1 friends transaction (libSceNpCppWebApi) - the transaction is 0x10 bytes; its constructor zeroes it. start returns 0x80553503 for a null context, 0x80553502 for an uninitialized context and then SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN; getResponse and getFriendsPlayerSessions return 0x80553508 while the two transaction words are zero. No response is produced; these offline paths are not console measurements.

  • sce::Np::CppWebApi::SessionManager2V1 (libSceNpCppWebApi) - imported by PPSA03671. Offline, the factories, PlayerSessionsApi calls and transaction start/getResponse/readData fail with SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN; parameter setters, initialize, terminate, constructors and destructors succeed without keeping state, as no request is ever sent. Response-body accessors (getSessionId, getPlayerSessions, getInvitations, the IsSet queries) throw: a failed request never produces a response object

  • sce::Np::CppWebApi::Matchmaking::V1 (libSceNpCppWebApi) - imported by PPSA21564 (86 of 92) and PPSA05510, PPSA25256, PPSA17226 and PPSA08395 for the other six; behaviour comes from the module bundled with PPSA21564/PPSA23732 (builds J03093737/J03341606), not from a console. Offline, the four Api calls and four factories return SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN. The four ParameterTo* objects keep only an initialized flag: initialize returns 0x80553503 for a null context or string, 0x80553502 for an unset context, 0x8055350f when already initialized and 0x80553512 for an empty SubmitTicketRequestBody; terminate returns 0x80553510. ParameterToGetTicket::setview returns 0x80553502 uninitialized and 0x80553503 for a null string. Other setters succeed without keeping state. Response accessors throw: a failed request produces no response. 0x80553504 is never returned; the stub stores a static pointer.

  • sce::Np::CppWebApi::UserProfile::V1, ProfanityFilter::V2, CommunicationRestrictionStatus::V3 (libSceNpCppWebApi) - imported by an Epic Online Services module whose dump ships no libSceNpCppWebApi.prx. The 0x10-byte ResponseHeaderBase (count at 0x00, header block at 0x08) comes from PPSA21564/PPSA23732 J03093737/J03341606 (0x14980, 0x149a0, 0x149b0); getHeaderValue returns 0x80553512 when the block is null and throws when it is present. The WebApiFilterRequest offset 0x00 is assumed, not measured. Offline, the five API calls, WebApiFilterRequestFactory::create and the transactions' start/getResponseHeaders fail with SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN. Response accessors throw: a failed request never produces a response. The Vector/Iterator members over IntrusivePtr<UserProfile::V1::BasicPresence> follow the bundled module on host-created bodies and throw on title-provided ones. Nothing can create a host Vector<unsigned long> body, so its begin, end and iterator throw for every non-empty vector

  • libSceNpCppWebApi (libSceNpCppWebApi) - unimplemented stubs have their parameter lists, const qualifiers and return types aligned with the demangled symbols confirmed by NID matching in #8143. They cover response-body accessors, iterators, and uninstantiated transactions in Leaderboards::V1, SessionManager::V1, InGameCatalog::V5, TitleCloudStorage::V1, and Common templates: each mangled name gives the method and parameter types, but the runtime layout of response objects and errors are unverified on console, so each call continues to throw NotImplemented_nid_no_patch. No call site is recorded for them

  • sce::Np::CppWebApi::SessionManager2V1 and sce::Np::CppWebApi::InGameCatalog2V5 (libSceNpCppWebApi) - 198 further exports imported by PPSA20397, named from aerolib. API calls, factories and transaction start/getResponse* fail SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN; parameter bookkeeping succeeds without state, except the PlayerSessionsApi parameters, which track it per SessionManager::V1; IntrusivePtr/Vector helpers follow the layouts above, Vector::empty/size/operator[] reading host bodies and throwing on title-provided ones. The audited accessors read the offsets in the next entry; the other response accessors, iterators, Vector::begin/end/copyFrom and transaction operator= throw: no response object exists. As start never succeeds here, TransactionBase::finish and abort return 0x80553508 and getId returns 0, as the bundled module does while its Transaction constructor's zeroed words are unset

  • sce::Np::CppWebApi::InGameCatalog2V5 audited accessors (libSceNpCppWebApi) - measured on the sce_module copy of libSceNpCppWebApi.prx bundled with PPSA21564 (build J03093737): the Sku price/label fields and *IsSet bytes, Product getId/getType/getDisplayName/getDescription/getReleaseDate/releaseDateIsSet/skusIsSet/getSkus, Container::getChildren (vector handle at 0x228) and the Container-response TransactionBase::operator=/start guards

  • sce::Np::CppWebApi::SessionManager2V1 audited accessors (libSceNpCppWebApi) - measured on the same bundled module: PlayerSession::getSessionId (string at 0x10) and getMember (pointer member at 0x30), PlayerSessionForRead getLeader (0xf8), getCustomData1/getCustomData2 (strings at 0x1c8/0x1e8), customData2IsSet (byte at 0x200) and getExclusiveLeaderPrivileges (pointer member at 0x188), ResponsePlayerSessionPlayer getPlatform (member at 0x18) and getAccountId (word at 0x10), GetPlayerSessionsResponseBody::getPlayerSessions (0x30), ResponsePlayerSessionMemberPlayer::getPlayers (0x10), the matching iterators, Vector begin/end/empty/size and ResponsePlayerSessionPlayer copyFrom/size

  • sce::Np::CppWebApi::UserProfile::V1, sce::Np::CppWebApi::CommunicationRestrictionStatus::V3 and the remaining sce::Np::CppWebApi::Common instantiations (libSceNpCppWebApi) - 87 further exports imported by PPSA20397, plus the previously-throwing ContainerApi::ParameterToGetContainer lifecycle and getContainer. API verbs and transaction start/getResponse fail SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN; parameter and model bookkeeping (initialize, terminate, set*, constructors, destructors) succeeds without state. ResponseHeaderBase::getHeaderValue and the remaining response accessors and transaction abort/getId/operator= throw: no response object exists offline

  • sce::Np::CppWebApi::Common::TransactionBase and Transaction (libSceNpCppWebApi) - not read in a module for the four UserProfile::V1 transactions: their abort and getId return 0x80553508 and 0, as the TransactionBase code read in the PPSA21564 module does for six and five other instantiations (#11235). The InGameCatalog::V5 Vector<IntrusivePtr<Container>> and TitleCloudStorage::V1 GetMultiDataStatusesResponseBody transactions still throw from start and DataApi::getMultiDataStatusesByUser: past the LibContext checks (0x80553503, 0x80553502), the module bundled with PPSA21567 returns what libSceNpWebApi2 and the service answer, which is not measured. Their getResponse returns 0x80553508 and writes nothing, as that module does while the words at +0 and +8 are null

  • sce::Np::CppWebApi audited member batch (libSceNpCppWebApi) - the second audited batch implements BasicProfile::getOnlineId/getPersonalDetail/getIsOfficiallyVerified, BasicPresence::accountIdIsSet, PersonalDetail::getDisplayName, the PlayerSessionForRead getters and *IsSet bytes, PlayerSession::getMember, ResponsePlayerSessionPlayer::{getPlatform,getAccountId}, FilterProfanityResponse::getMessage, the Get*Response/GetPlayerSessionsResponseBody vector getters, Vector<String>::copyFrom, Vector<IntrusivePtr<BasicProfile>>::begin, the BasicProfile/Sku iterator compare/advance and the CRS-response TransactionBase::operator=. Vector<String>::copyFrom deviates by design: the bundled module allocates a fresh max(8, 2n) array and assigns each string over it without releasing the old elements; the host releases them first, avoiding the orphan leak the module accepts

  • sce::Np::CppWebApi::UserProfile::V1 audited accessors (libSceNpCppWebApi) - measured on the bundled module: BasicPresence construct/destruct, set{AccountId,InContext,OnlineStatus}, get{AccountId,InContext,OnlineStatus} and the inContextIsSet/onlineStatusIsSet/accountIdIsSet bytes at 0x22/0x20/0x18; BasicProfile construct/destruct, setOnlineId, setIsOfficiallyVerified, getOnlineId (0x14 bytes at 0x10/0x20), getPersonalDetail (pointer member at 0x28), getIsOfficiallyVerified (byte at 0xa9) and the onlineIdIsSet/personalDetailIsSet/isOfficiallyVerifiedIsSet bytes at 0x24/0x40/0xaa; PersonalDetail::getDisplayName (member at 0x88)

  • sce::Np::CppWebApi::UserProfile::V1 and CommunicationRestrictionStatus::V3 audited response accessors (libSceNpCppWebApi) - measured on the bundled module: GetPublicProfilesResponse::getProfiles (vector handle at 0x30), GetFriendsResponse::getFriends/GetBlockingUsersResponse::getBlocks (members at 0x30), GetBasicPresencesResponse::getBasicPresences (pointer member at 0x30), FilterProfanityResponse::getMessage (member at 0x38) and the restriction response getRestricted (byte at 0x30)

  • sce::Np::CppWebApi title-imported exports (libSceNpCppWebApi) - exports imported by the sce_module copies shipped with PPSA20397 and PPSA03530 that main did not declare. NIDs and signatures come only from the titles' import tables; const and return types are inferred from the demangled name. Layouts and offline behaviour follow the landed same-template implementations sourced from the module bundled with PPSA21564. The audited subset reads the bundled module's measured layouts — model fields, Vector/Iterator members, copyFrom and the transaction operator=/start guards; the rest still throw: a failed request produces no response object. SessionManager::V1 GameSessionsApi, Matches::V1, Matchmaking::V1, UserProfile::V1, TitleCloudStorage::V1 and InGameCatalog::V5 accessors have no other source, so behaviour is only what the signatures admit.

  • sce::Np::CppWebApi::Matches::V1 (libSceNpCppWebApi) - imported by PPSA21564/PPSA23732 (builds J03093737/J03341606). The 34 request/model setters store the value and the is-set flag at the measured offsets; the 10 vector setters copy the IntrusivePtr handle and increment the body reference count at +0x30 instead of deep-copying the elements, which is a host choice. A constructor-created empty vector (null backing pointer) is a valid value: those setters copy the empty handle and set the flag instead of returning 0x80553512. The six ParameterTo* objects allocate a host implementation of the module's layout and initialize/terminate follow the measured results. The host allocator stands in for the module's LibContext allocator. Twelve factories are implemented from the PPSA03530 (GTA Vice City) bundled module's create protocol: null context or out returns 0x80553503, allocation failure returns 0x80553504, the object is wrapped {object, deleter, context} into out and each create parameter is stored at its measured offset. CreateMatchRequestFactory's host size 0xb8 exceeds the module's 0x88 to keep the measured setter range at +152..+176 inside the allocation. The remaining ten factories still throw NotImplemented_nid_no_patch: their second create parameters have no measured field offset. The TitleCloudStorage2V1::DataStatus Vector::begin/end iterators produce the host iterator, matching the module's [self]/[self+0x10] element reads; Product::getLabel and the TitleCloudStorage TransactionBase::start still throw, their bodies unmeasured past the first checks. Only the six API verbs keep SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN. The three accessors read +0x30/+0x48/+0x28. Response layouts beyond those fields are unverified.