Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/648"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T06:09:15Z.
## Summary
Fixes the crash at +0xb5a5f8 (read of uninitialized object at offset x68) right after XUserAddAsync during account init (#348, #622, #630).
Root Cause
During account initialization right after XUserAddAsync, the title's auth subsystem calls slot 0x30 (GetMaxUsers) on the user provider interface (IXUserProvider). Previously, slot 0x30 was mapped to missing::<6>, which returned E_NOTIMPL without writing to the caller's output pointer. The title dereferenced the uninitialized pointer, causing an immediate xc0000005 access violation at +0xb5a5f8.
Fix
Verification
ustfmt --edition 2024 --check crates/victory-hle/src/modules/xuser.rs: clean.
Imported from Marvisak/VIctory. Originally posted by dpalacios69 on 2026-11-24T09:53:49Z.
Thanks for picking this up! There's an ABI bug in
get_max_usersthat needs to be fixed before merging:1. Extra
Handleparameter shiftsoutfromrdxtor8In the public GDK C API (from the documented signature, not from a disassembly of the title),
XUserGetMaxUserstakes only the output pointer — noXUserHandle:Every other slot in
xuser.rsmirrors the C API 1:1 withThisprepended (none of the non-handle slots likeadd_async,find_by_id,register, etc. take a dummyHandle).With the current signature:
under the Windows x64 ABI, the caller passes
maxUsersinrdx, which is ignored, whileput(out, 1)writes1through whatever stale value happens to be inr8(leaving*maxUsersunwritten, and either returningE_INVALIDARGifr8 == 0, silently corrupting 4 bytes ifr8happens to be writable, or crashing with an access violation). The unit test didn't catch this becauseslot::<GetMaxUsers>transmutes the raw vtable pointer to the same 3-arg signature.It should be:
And
get_max_users_reports_one_usershould be updated to match (type GetMaxUsers = extern "system" fn(This, *mut u32) -> HRESULT;). (If you have a capture/disassembly of the call site in#622showing otherwise, please share!)2. Minor: misplaced
VTABLEcommentInserting
get_max_usersbetween// Unset slots (no title seen calls them): ...andstatic VTABLEdetaches that comment fromVTABLE. Movingget_max_usersabove the// Unset slotscomment (or next tocompare/add_async) keeps the comment attached to the table.Reviewed against the diff and the code on
main; not run on hardware. AI-assisted.Imported from Marvisak/VIctory. Originally posted by molodayamama on 2026-11-24T14:05:06Z.
Independent Windows check of
241b08f4943973800de7c867d332b32d14436cf5(Windows 10 22H2 19045, Rust 1.98.1, MSVC x64).cargo test -p victory-hle --locked --lib get_max_users_reports_one_user -- --test-threads=1 --nocapture: 1 passed.The offline XUser fixture confirms the max-users slot reports one supported user. The test invokes the shim with synthetic arguments.
Only source-built synthetic fixtures were used. AI-assisted verification.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:26:51Z.
Automated triage for the maintainers. Closing because another open pull request covers the same change.
See #398. Same slot as #398 with a wrong signature: it adds a handle argument the public call does not have, so a real call would write through whatever is in the third argument register. Its crash explanation (the title calling slot 0x30 at account init) is unsupported.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed