Series 1.0.2.1: the package's archives are checked before the title runs (port of Marvisak/VIctory#12, and more) #1217

Merged
kibagami-nc merged 3 commits from upstream-pr/1217 into main 2026-11-29 08:16:57 +00:00
kibagami-nc commented 2026-11-28 15:45:07 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kibagami-nc on 2026-11-28T15:45:07Z.


What happens

At its start, the title opens appdata0.rpf beside its executable, and sets up its package mounts with it (packroot:/, packcache:/config). If the file is missing, or another file is in its place, a mount step fails. The title then stops at its own breakpoint at +0x2237178, before any window, and nothing names the cause.

mercuryVM's static reading of that function and the reproduction are in Marvisak/VIctory#8. There, removing only appdata0.rpf from a package gave the same breakpoint and registers. Upstream fixed it in Marvisak/VIctory#12, merged after this fork's base, so it was never here. (Since #68, main identifies the 1.0.2.1 executable in KNOWN_BUILDS, as "Xbox Series master", for its upscaler patches. This PR adds its archives to that entry.)

The change

Ported from Marvisak/VIctory a3acc87 (Peter Bonanni):

  • crates/victory-game/src/lib.rs: KnownBuild gains startup_archive (appdata0.rpf for main's 1.0.2.1 entry). File names are small interoperability constants, which docs/asset-policy.md allows.
  • apps/victory/src/run.rs: before executing that build (victory play, run --execute), check_startup_archive reads the archive's first four bytes. If the file is missing, unreadable, shorter than that, or not RPF9 (9FPR), the start stops with an error that names the file and says to restore it from the package.
  • Beyond the port (second commit): every archive of the package is checked too. That means every .rpf beside the executable and under its pack folder. All 22 of Series 1.0.2.1's are RPF9 (counted by superboynick in Marvisak/VIctory#12), so one that doesn't start with 9FPR is damaged. Those are named, relative to the folder, and the start stops. --set VICTORY_ARCHIVE_CHECK=0 starts anyway.
    • Why: in Marvisak/VIctory#3492 a resumed download had left pack/story000_restofworld/story000_restofworld.rpf at the right size with its first 16 MiB zeroed. The title trapped at +0x29defb1 one to four minutes into the start, and replacing the damaged files ended it. #1250 here has that trap.
    • Not seen: blocks zeroed further into a file, and other file types (.ttpf).
  • Third commit: the twelve archives beside the 1.0.2.1 executable are named in KNOWN_BUILDS, and each must be there by its name. A missing one is named, along with any file beside it whose name begins as its own and ends in .rpf, for example "appdata0.rpf (there is appdata0 (1).rpf: rename it if it is that archive)". This runs before the header checks, and VICTORY_ARCHIVE_CHECK=0 skips both.
    • Why: #1190 stopped at +0x2237178 with the registers of a missing appdata0.rpf. Some of its archives had been saved as … (1).rpf, a download's second copy, which the title never opens. Renaming them fixed it.
  • Unchanged:
    • an unknown executable gets no check;
    • run without --execute gets no check;
    • the 1440p patch's "changed copy" hint is still added only for unknown builds.

What it covers here, and what not

It names the cause for a missing or replaced archive. #1190 and #1102 stop in the same package-mount code (+0x2237178, and +0x2237320 under the same +0x2236dae), but their appdata0.rpf has the right size. If its header is right too, this check passes and they still stop. Their cause is being narrowed down there, and this only takes one possible cause off the list at once.

Confirmed in #1255: the stop came from the layout. victory.exe and game_scarlett_master.exe were at the root of the game folder, and the whole package (with appdata0.rpf) one folder deeper. G: maps to the executable's folder, so the game's first lookup missed, with the same registers as a removed appdata0.rpf (rax = rbx = rcx = 0, rdx = 0x66). Moving the executables in with the package fixed it. This check names that case before the start: "cannot read the startup archive …ppdata0.rpf".

Update from #1102: the archive was its cause. Their appdata0.rpf (SHA-256 F08AD8B2…) has the right size and stops the game in the mounts. A copy from another source (D9D4D2DD…) gets past them and opens six more archives. So a wrong copy of the same size passes this header check. Catching that would take a known hash of the archive, which I have not added: one report is not enough to say which copy is the 1.0.2.1 one.

Tests

Rebased on main 32ecacf, which now has its own KNOWN_BUILDS entry for 1.0.2.1 (#68).

  • New run::startup_archive_tests::the_startup_archive_is_checked_before_the_title_runs:
    • identify gives main's "Xbox Series master" entry with appdata0.rpf for the hash, in any case;
    • an RPF9 file passes;
    • an RPF7 one, a 2-byte one and a missing one each fail, with the path in the message.
  • New run::startup_archive_tests::damaged_archives_of_the_package_are_named:
    • a zeroed .rpf beside the executable and one under pack are named, along with a 2-byte one;
    • they come in order, relative to the folder;
    • a .ttpf, a backup folder and a text file are not looked at;
    • a whole package passes.
  • New run::startup_archive_tests::missing_archives_are_named_with_their_look_alikes:
    • the build lists 12 archives, the startup one among them;
    • with three missing and appdata0 (1).rpf and levels(2).rpf beside them, the three are named with their look-alikes;
    • the error says so.
  • cargo test -p victory --locked (rebased on main 32ecacf): 31 + 2 passed. cargo test -p victory-game --locked: passed.
  • Clippy (-p victory -p victory-game --all-targets -D warnings, default and --all-features): clean. That is with main's three findings allowed (let_and_return, manual_is_multiple_of, some_filter), which #665 fixes.

Not run with the game. Without the game's executable here, the check can't be reached end to end; the test calls it directly.

No game files, dumps or extracted data are included.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5541883977 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1217). Originally posted by [kibagami-nc](https://github.com/kibagami-nc) on 2026-11-28T15:45:07Z. --- ## What happens At its start, the title opens `appdata0.rpf` beside its executable, and sets up its package mounts with it (`packroot:/`, `packcache:/config`). If the file is missing, or another file is in its place, a mount step fails. The title then stops at its own breakpoint at `+0x2237178`, before any window, and nothing names the cause. mercuryVM's static reading of that function and the reproduction are in Marvisak/VIctory#8. There, removing only `appdata0.rpf` from a package gave the same breakpoint and registers. Upstream fixed it in Marvisak/VIctory#12, merged after this fork's base, so it was never here. (Since #68, main identifies the 1.0.2.1 executable in `KNOWN_BUILDS`, as "Xbox Series master", for its upscaler patches. This PR adds its archives to that entry.) ## The change Ported from Marvisak/VIctory a3acc87 (Peter Bonanni): - `crates/victory-game/src/lib.rs`: `KnownBuild` gains `startup_archive` (`appdata0.rpf` for main's 1.0.2.1 entry). File names are small interoperability constants, which `docs/asset-policy.md` allows. - `apps/victory/src/run.rs`: before executing that build (`victory play`, `run --execute`), `check_startup_archive` reads the archive's first four bytes. If the file is missing, unreadable, shorter than that, or not RPF9 (`9FPR`), the start stops with an error that names the file and says to restore it from the package. - **Beyond the port (second commit):** every archive of the package is checked too. That means every `.rpf` beside the executable and under its `pack` folder. All 22 of Series 1.0.2.1's are RPF9 (counted by superboynick in Marvisak/VIctory#12), so one that doesn't start with `9FPR` is damaged. Those are named, relative to the folder, and the start stops. `--set VICTORY_ARCHIVE_CHECK=0` starts anyway. - Why: in Marvisak/VIctory#3492 a resumed download had left `pack/story000_restofworld/story000_restofworld.rpf` at the right size with its first 16 MiB zeroed. The title trapped at `+0x29defb1` one to four minutes into the start, and replacing the damaged files ended it. #1250 here has that trap. - Not seen: blocks zeroed further into a file, and other file types (`.ttpf`). - **Third commit:** the twelve archives beside the 1.0.2.1 executable are named in `KNOWN_BUILDS`, and each must be there by its name. A missing one is named, along with any file beside it whose name begins as its own and ends in `.rpf`, for example "appdata0.rpf (there is appdata0 (1).rpf: rename it if it is that archive)". This runs before the header checks, and `VICTORY_ARCHIVE_CHECK=0` skips both. - Why: #1190 stopped at `+0x2237178` with the registers of a missing `appdata0.rpf`. Some of its archives had been saved as `… (1).rpf`, a download's second copy, which the title never opens. Renaming them fixed it. - Unchanged: - an unknown executable gets no check; - `run` without `--execute` gets no check; - the 1440p patch's "changed copy" hint is still added only for unknown builds. ## What it covers here, and what not It names the cause for a missing or replaced archive. #1190 and #1102 stop in the same package-mount code (`+0x2237178`, and `+0x2237320` under the same `+0x2236dae`), but their `appdata0.rpf` has the right size. If its header is right too, this check passes and they still stop. Their cause is being narrowed down there, and this only takes one possible cause off the list at once. **Confirmed in #1255:** the stop came from the layout. `victory.exe` and `game_scarlett_master.exe` were at the root of the game folder, and the whole package (with `appdata0.rpf`) one folder deeper. `G:` maps to the executable's folder, so the game's first lookup missed, with the same registers as a removed `appdata0.rpf` (`rax = rbx = rcx = 0`, `rdx = 0x66`). Moving the executables in with the package fixed it. This check names that case before the start: "cannot read the startup archive …ppdata0.rpf". **Update from #1102:** the archive was its cause. Their `appdata0.rpf` (SHA-256 `F08AD8B2…`) has the right size and stops the game in the mounts. A copy from another source (`D9D4D2DD…`) gets past them and opens six more archives. So a wrong copy of the same size passes this header check. Catching that would take a known hash of the archive, which I have not added: one report is not enough to say which copy is the 1.0.2.1 one. ## Tests _Rebased on main `32ecacf`, which now has its own `KNOWN_BUILDS` entry for 1.0.2.1 (#68)._ - **New** `run::startup_archive_tests::the_startup_archive_is_checked_before_the_title_runs`: - `identify` gives main's "Xbox Series master" entry with `appdata0.rpf` for the hash, in any case; - an RPF9 file passes; - an RPF7 one, a 2-byte one and a missing one each fail, with the path in the message. - **New** `run::startup_archive_tests::damaged_archives_of_the_package_are_named`: - a zeroed `.rpf` beside the executable and one under `pack` are named, along with a 2-byte one; - they come in order, relative to the folder; - a `.ttpf`, a `backup` folder and a text file are not looked at; - a whole package passes. - **New** `run::startup_archive_tests::missing_archives_are_named_with_their_look_alikes`: - the build lists 12 archives, the startup one among them; - with three missing and `appdata0 (1).rpf` and `levels(2).rpf` beside them, the three are named with their look-alikes; - the error says so. - **`cargo test -p victory --locked`** (rebased on main `32ecacf`): 31 + 2 passed. **`cargo test -p victory-game --locked`**: passed. - **Clippy** (`-p victory -p victory-game --all-targets -D warnings`, default and `--all-features`): clean. That is with main's three findings allowed (`let_and_return`, `manual_is_multiple_of`, `some_filter`), which #665 fixes. Not run with the game. Without the game's executable here, the check can't be reached end to end; the test calls it directly. No game files, dumps or extracted data are included.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!1217
No description provided.