Repository navigation
feat(libSceNpCppWebApi): answer the Matchmaking response-body accessors - #19484
oneandonlydean merged 9 commits into
Conversation
`libSceNpCppWebApi.prx` answers these 14 accessors with one field read:
GetOfferResponseBody::getStatus mov eax, [rdi + 0x9c]
GetOfferResponseBody::statusIsSet movzx eax, byte [rdi + 0xa0]
GetOfferResponseBody::offerIdIsSet movzx eax, byte [rdi + 0x50]
GetOfferResponseBody::rulesetNameIsSet movzx eax, byte [rdi + 0x78]
GetOfferResponseBody::playersIsSet movzx eax, byte [rdi + 0x98]
GetOfferResponseBody::locationIsSet movzx eax, byte [rdi + 0xc0]
GetTicketResponseBody::getStatus mov eax, [rdi + 0xbc]
GetTicketResponseBody::statusIsSet movzx eax, byte [rdi + 0xc0]
GetTicketResponseBody::ticketIdIsSet movzx eax, byte [rdi + 0x50]
GetTicketResponseBody::rulesetNameIsSet movzx eax, byte [rdi + 0x78]
GetTicketResponseBody::ticketAttributesIsSet movzx eax, byte [rdi + 0x98]
GetTicketResponseBody::playersIsSet movzx eax, byte [rdi + 0xb8]
GetTicketResponseBody::submitterIsSet movzx eax, byte [rdi + 0x108]
SubmitTicketResponseBody::ticketIdIsSet movzx eax, byte [rdi + 0x50]
Each flag is anchored by its own accessor in the same module, so the
offsets form a layout instead of a list: `getOfferId` and `getTicketId`
are `lea rax, [rdi + 0x30]` and the flags at `0x50` close a 32-byte
`String`; both `getRulesetName` accessors are `lea rax, [rdi + 0x58]`
with the flags at `0x78`; `getStatus` reads four bytes at `0x9c` / `0xbc`
and its flag is the immediately following byte.
`include/Api.hpp` is untouched, since all 14 already return `int` and the
reads are 1 or 4 bytes wide.
The `getCreatedDateTime`, `getUpdatedDateTime`, `getMaxScoreLimit` and
`getMinScoreLimit` accessors of this family are left alone: the module
returns them in `rax` as 64-bit values while the tree declares `int`, so
they need a declaration change and a separate PR.
`guest_np_cpp_web_api_matchmaking_response` fills a buffer whose byte i
holds i and checks all 14, then rewrites the status bytes to prove the
values track memory. The library's measured count moves from 1332 to
1346, and all 14 appear as NID exports in the patched prx.
|
@Opensource55 the accessors are small and the test is a good one (byte i holds i). Two things before this can land:
|
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
The fourteen flag and status accessors this branch answers had no debt entry, and the `Matchmaking::V1` entry still says response accessors throw. The new entry lists each accessor with its offset, says they were inspected statically and not executed, and states that they were read from the PPSA01341 v01.007.000 build only, because no Matchmaking member is among the offsets this file records from PPSA21564. It also records the boundary the reviewer named: the value getters of the fields these flags guard, the objects' other fields, their construction and any console value are unverified, and the four 64-bit DateTime accessors belong to the sibling PR rather than this one.
|
Both points are in 1. A second module. I cannot read one. The PPSA21564 What I did instead is check the direction of the difference, because that decides whether these fourteen are PPSA01341-only or family-wide: reading the 34 offsets this debt file records from PPSA21564 back out of the PPSA01341 module agrees on 34 of 34 (class, method and displacement). Those 34 are SessionManager::V1 members plus four Leaderboards accessors and two Activities ones; no Matchmaking member is among them, so that agreement is evidence that the two builds share a layout family — not a per-member measurement of these fourteen. The entry therefore records that they were read from the PPSA01341 build only, which is the fallback your point allows, and does not claim a second build. 2. The debt entry. Added next to the Account-ID entry, as asked. It lists all fourteen with offsets ( |
The entry this branch added ran to 1191 characters, past the 1000 the conventions check warns at. It is tighter now: the accessors and their offsets are unchanged, the DateTime cross-reference is gone because the sibling PR gives those eight their own entry, and the note that these fourteen are one-build only is stated once.
Progress report (f8627a5 → 4becfe3)📈 System libraries: 40.64% (+0.03%, +14 implemented functions) ✅ 14 implemented
Changed libraries (implemented exports)
|
The only conflict is the tail of `libSceNpCppWebApi/CMakeLists.txt`, where both sides append a `BUILD_TESTING` block. Both blocks are kept: the two that main gained from the DateTime and string PRs stay in their order and this branch's `guest_np_cpp_web_api_matchmaking_response` block goes after them. `Export.cpp` merged without help and each of the fourteen accessors this branch answers is still converted, with no implementation that main has gained since dropped; `guest_np_cpp_web_api_*` is 20 of 20 after the merge.
…accessors' into feat/npcpp-matchmaking-response-accessors # Conflicts: # core/libs/prx/libSceNpCppWebApi/CMakeLists.txt
# Conflicts: # core/libs/prx/libSceNpCppWebApi/CMakeLists.txt
# Conflicts: # core/libs/prx/libSceNpCppWebApi/CMakeLists.txt
|
Merged Re-verified on the merged tree: The |
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
What
Answers 14 accessors of the Matchmaking response bodies that the console reduces to a single field read. Offsets come from the decrypted
libSceNpCppWebApi.prxof Demon's Souls (PPSA01341):Each flag is anchored by the neighbouring accessor that is already implemented against the same module, so the numbers are a layout rather than a list:
GetOfferResponseBody::getOfferIdandGetTicketResponseBody::getTicketIdarelea rax, [rdi + 0x30]; both flags at0x50close a 32-byteString.getRulesetNameaccessors arelea rax, [rdi + 0x58], and both flags at0x78close another.getStatusreads a 4-byte value at0x9c/0xbc, and the matching flag is the byte immediately after it,0xa0/0xc0.include/Api.hppis untouched: every one of these already returnsint, and the reads are 1 or 4 bytes wide.Not included:
getCreatedDateTime,getUpdatedDateTime,getMaxScoreLimit,getMinScoreLimitin this family. The module returns them inraxas 64-bit values while the tree declaresint, so they need a declaration change and belong in their own PR rather than here.Tested
Windows 10 19045, MinGW GCC 15.2, Release.
guest_np_cpp_web_api_matchmaking_responsetest: a buffer whose byte i holds i, so a wrong offset, a wrong width or a constant answer fails.getStatusandstatusIsSetare also re-checked after rewriting their bytes, so the values track memory. Passes.build/core/libs/libs/libSceNpCppWebApi.prx.tools/progress.py --module libSceNpCppWebApimoves from 1332 to 1346 with nothing else changing.tools/check_conventions.py --base upstream/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)