Repository navigation
feat(libSceNpCppWebApi): answer the Matchmaking model accessors - #19481
oneandonlydean merged 11 commits into
Conversation
`libSceNpCppWebApi.prx` in Demon's Souls (PPSA01341) answers these 17
accessors with a single field read, so the offsets are read off the
module itself rather than guessed from the models:
PlayerForRead::getPlatform mov eax, [rdi + 0x30]
PlayerForRead::accountIdIsSet movzx eax, byte [rdi + 0x18]
PlayerForRead::onlineIdIsSet movzx eax, byte [rdi + 0x2d]
PlayerForRead::platformIsSet movzx eax, byte [rdi + 0x34]
PlayerForRead::teamNameIsSet movzx eax, byte [rdi + 0x58]
PlayerForRead::playerAttributesIsSet movzx eax, byte [rdi + 0x80]
PlayerForOfferRead::getPlatform mov eax, [rdi + 0x30]
PlayerForOfferRead::accountIdIsSet movzx eax, byte [rdi + 0x18]
PlayerForOfferRead::onlineIdIsSet movzx eax, byte [rdi + 0x2d]
PlayerForOfferRead::platformIsSet movzx eax, byte [rdi + 0x34]
PlayerForOfferRead::teamNameIsSet movzx eax, byte [rdi + 0x58]
PlayerForOfferRead::ticketIdIsSet movzx eax, byte [rdi + 0x80]
Attribute::getType mov eax, [rdi + 0x30]
Submitter::getPlatform mov eax, [rdi + 0x1c]
Submitter::accountIdIsSet movzx eax, byte [rdi + 0x18]
Submitter::platformIsSet movzx eax, byte [rdi + 0x20]
Location::gameSessionIdIsSet movzx eax, byte [rdi + 0x30]
Cross-checks that the offsets are the real layout rather than four
unrelated numbers:
- `PlayerForRead::getAccountId`, already implemented against the module,
reads `[rdi + 0x10]` as a `uint64_t`; `accountIdIsSet` at `0x18` is the
flag right after it.
- `getOnlineId` copies 16 bytes from `[rsi + 0x19]` and 4 more from
`[rsi + 0x29]`, i.e. a 20-byte `OnlineId` at `0x19`; `onlineIdIsSet` at
`0x2d` sits exactly at its end.
- `getTeamName` is `lea rax, [rdi + 0x38]`; the flag at `0x58` closes a
32-byte `String`.
- `Location::setGameSessionId` stores the string at `+0x10` and then sets
the byte at `0x30` to 1, which is the flag this change reads.
The new `guest_np_cpp_web_api_matchmaking_model` test fills a buffer with
each byte holding its own offset, so an accessor that read the wrong
offset, the wrong width, or returned a constant would fail. All 17
symbols also appear as NID exports in the built
`build/core/libs/libs/libSceNpCppWebApi.prx`, and the library's measured
count moves from 1332 to 1349 with nothing else changing.
No size, signature or declaration changes: every one of these already
returned `int`, so `include/Api.hpp` is untouched.
… test CONVENTIONS.md allows comments only for technical debt, #endif and the end of a namespace; the test relied on prose instead of names.
|
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 accessors read what the PR body lists, the test is a real one (an index-valued buffer, three of them re-read after a byte is rewritten), and the 17 NID exports are checked, so the code itself looks right. Two documentation points before it can pass:
|
…ome from The `Matchmaking::V1` debt entry said response accessors throw, which is no longer true for the seventeen model accessors this branch answers, and it names the PPSA21564/PPSA23732 builds as the source of the Matchmaking behaviour while the offsets here come from the PPSA01341 module. The entry now lists each accessor with its offset, says they were inspected statically and not executed, and states that these seventeen were read from the PPSA01341 v01.007.000 build only: none of the members this file records from PPSA21564 is a Matchmaking member, so the general agreement between those builds (recorded in the entry below) is context, not a per-member measurement. The models' other fields, their construction and any console value stay unverified.
|
Both points are in 1. The 2. Which build the listing is from. PPSA01341 v01.007.000, and the entry says so. On whether PPSA21564 has the same offsets, I have to be exact about what I could check: no Matchmaking member is among the offsets this file records from PPSA21564, so there is no per-member comparison to report for these seventeen — they are read from the PPSA01341 build only, and the entry says exactly that. What I could add is the direction of the difference. The PPSA21564 |
…wn entry Extending the `Matchmaking::V1` entry pushed it past the 1000-character limit `tools/check_conventions.py` warns at, so the list moves into an entry of its own next to the Account-ID one and the original entry goes back to what it said: its "response accessors throw" now covers the accessors that are not listed in the new entry. The new entry keeps the substance: seventeen accessors with their offsets, read from the PPSA01341 v01.007.000 module, statically inspected and not executed, one-build only because no Matchmaking member is among the offsets recorded from PPSA21564, with other fields, construction and console values unverified.
Progress report (2f6d40f → 9ac6cdc)📈 System libraries: 41.0% (+0.04%, +17 implemented functions) ✅ 17 implemented
Changed libraries (implemented exports)
|
…g-model-accessors
|
The The job's own test list has exactly two entries: Both are I could not rerun the failed job myself: After the merge, locally: |
|
Correction to my earlier comment, plus one commit ( My reply in
|
|
The The same window hit the sibling tests on the other two branches: #19526 failed on I cannot rerun jobs from this account (the API answers |
|
Merged Re-verified on the merged tree, not on the old one: The |
|
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.
|
…gment `main` now takes debt changes through `docs/dev/debt/changes/<branch>.md` instead of editing the debt files (CONTRIBUTING.md, docs/dev/TechnicalDebt.md#fragments). The two edits this branch made to `docs/dev/debt/libSceNpCppWebApi.md` - the `Matchmaking::V1` wording change and the new model accessors entry - are the same two operations in `docs/dev/debt/changes/feat-npcpp-matchmaking-model-accessors.md`, and the debt file is back to `main`'s version.
|
Merged One thing did change under this PR: the debt convention. On the overlap comment. #16018 and #16052 are the only open pull requests that share The Verified on the merged tree, not assumed: AI-assisted: yes. |
What
Answers 17
Matchmakingmodel accessors inlibSceNpCppWebApithat the console reduces to a single field read. The offsets come from the decryptedlibSceNpCppWebApi.prxof Demon's Souls (PPSA01341 v01.007.000, sha256d03d64abc6f82a2a6b0b9e992782f98b7f488fd225a8553132b41e23bdad5b10), read from its disassembly; nothing here was run on a console. They are not taken from the model headers:The numbers are not independent guesses; three other accessors in the same module close the layout around them:
PlayerForRead::getAccountIdwas already implemented here and reads[rdi + 0x10]as auint64_t.accountIdIsSetat0x18is the byte immediately after that id.PlayerForRead::getOnlineIdcopies 16 bytes from[rsi + 0x19]and 4 more from[rsi + 0x29], so the id is 20 bytes at0x19.onlineIdIsSetat0x2dis exactly its last byte plus one.getTeamNameislea rax, [rdi + 0x38], andteamNameIsSetat0x58closes a 32-byteString.Location::setGameSessionIdwrites the string at+0x10and then stores 1 at[rbx + 0x30], which is the flag this PR reads.include/Api.hppis untouched: all 17 already returnedint, and none of them needs a size or signature change.Tested
Windows 10 19045, MinGW GCC 15.2, Release.
guest_np_cpp_web_api_matchmaking_modeltest: a buffer whose byte i holds i. An accessor that read the wrong offset, the wrong width or a constant would fail; three of them are also re-checked after rewriting a byte, so the value tracks memory. Passes.guest_np_cpp_web_api_matchmakingstill passes.build/core/libs/libs/libSceNpCppWebApi.prx(patched form), 17 of 17.tools/progress.py --module libSceNpCppWebApimoves from 1332 to 1349 and nothing else changes.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)