Loader: VICTORY_NULL_GUARD gives a start-up callback the null check it leaves out (RTX 4070 Ti) #531
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!531
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-531"
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?
@urielbeaupre on GitHub · 2026-11-27 09:55 UTC · original
urielbeaupre:nvidia-null-guard→a-publier· +225 −0 · 6 files · 1 commits · openWhat
On an NVIDIA RTX 4070 Ti, every start of
game_scarlett_master.exe1.0.2.1 ended right after pressing A on the start screen with a read of address 0x38 (7 runs of 7: Series X and S, 4K and 1080p, with and without-Safe, atcd8dfc0and4eb6cfd).VICTORY_NULL_GUARD=1gives the callback the same check: the 10 int3 padding bytes before +0x1cfa5a0 becometest rcx, rcx; jz <ret at +0x1cfa585>; jmp +0x1cfa5a0, and the callback's tail jump goes there instead. Both sites are byte-checked first; the jump is written only after the guard is. Off by default.VICTORY_LOCALE/VICTORY_GEO: the locale and region the title gets fromGetUserDefaultLocaleName/GetUserDefaultGeoName, in place of the PC's. They are for testing whether the empty lookup depends on the region. The module is served only when one of them is set.Tested
scripts\play.ps1 -More @{VICTORY_NULL_GUARD='1'}: both sites patched, the title went past the start screen into the game, and it closed cleanly with no crash logged.cargo test -p victory-loader null_guard: 2 passed.Not known / not done
VICTORY_LOCALE/VICTORY_GEOoverrides have not been tried in a run yet, andcargo test -p victory-hle localematched no test, so their unit test has not run.int3at +0x1ce6e13, called from +0x293ef38). It did not happen in the tested run.🤖 Generated with Claude Code
@MamaLeVrai on GitHub · 2026-11-27 11:40 UTC · original
Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At
a8b7c9e:victory-hle163 passed, 0 failed, 2 ignored;victory-loader58 passed;victorybins 25 passed.AI-assisted (Claude Code); no game data.
@gut0to on GitHub · 2026-11-27 13:23 UTC · original · reviewed
AI-assisted review: I checked the override behavior against the Win32 contracts for both functions. One compatibility detail is missing on their failure path:
@ -0,0 +37,4 @@if out.is_null() || count < need {return 0;}// SAFETY: the caller's buffer holds `count` units, at least `need`.@gut0to on GitHub · 2026-11-27 13:23 UTC · original
When
outis null orcountis too small, these overrides return 0 without settingERROR_INSUFFICIENT_BUFFER. Both Win32 APIs document that error for this failure, so callers that inspectGetLastError()will see a stale value only when the override is enabled. Please set the same last error as the host API and cover both cases in the helper/API tests. See Microsoft docs: https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getuserdefaultlocalename and https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getuserdefaultgeonameView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.