Repository navigation
XGameSave: decode %XX in save file names without slicing the name (#325) - #457
Closed
raulmesa96 wants to merge 1 commit into
Closed
raulmesa96 wants to merge 1 commit into
raulmesa96 wants to merge 1 commit into
Conversation
…l-dev#325) `dec` sliced `&file[i + 1..i + 3]` by byte index, so a name in the save folder with '%', an ASCII byte and then a multi-byte character (e.g. "%aé", copied there by hand or by another tool) panicked on a char boundary. `dec` runs during enumeration and reads from `extern "system"` functions, where the panic aborts the process. The two digits are now read as bytes and must both be hex digits, which also stops `from_str_radix` from taking a sign ("%+1" was decoded as 0x01). Fixes xcl-dev#325 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
decingamesave.rssliced the save file name by byte index after a%; a name with a multi-byte character right after%xpanicked inside anextern "system"call and aborted the process. It now reads the two digits as bytes, and both must be hex digits (so%+1/%-1are no longer decoded). Names XCL writes itself (enc) decode as before.Fixes #325
What is in it
decreads the escape's digits as bytes –crates/xcl/src/hle/xgameruntime/gamesave.rsdec_keeps_percent_not_followed_by_two_hex_digits(panicked withend byte index 3 is not a char boundarybefore the fix) – same fileTested
x86_64-pc-windows-msvc, debugaebea99onmaina6f5f7a, clean treecargo build --workspacethencargo test --workspace --no-fail-fast -- --test-threads=4: 677 passed, 0 failed, 41 ignored (thexcllib: 637 passed, 0 failed, 21 ignored)gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64)cargo test -p xcl --lib gamesave: 11 passed, 0 failedRegression run
scripts/smoke.ps1on. The change is limited todec(decoding save file names) and is covered by the unit tests and the full suite above; I would be grateful if someone with a title could add the twoxcl-smokeblocks.Not tested
AI use
🤖 Generated with Claude Code