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

Manually merged
github merged 3 commits from github-bot/gh-1217 into main 2026-11-29 08:22:11 +00:00 AGit
Owner

@⁠kibagami-nc on GitHub · 2026-11-28 15:45 UTC · original
kibagami-nc:port/startup-archive-check → main · +256 −1 · 2 files · 3 commits · merged 2026-11-29 08:16 UTC

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.

**@⁠kibagami-nc** on GitHub · 2026-11-28 15:45 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1217) `kibagami-nc:port/startup-archive-check` → `main` · +256 −1 · 2 files · 3 commits · merged 2026-11-29 08:16 UTC ## 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.
Without appdata0.rpf beside the executable, or with another file in its
place, the title stops in its package mounts at a breakpoint (+0x2237178)
before any window, and nothing says why. Upstream found this (Marvisak/VIctory
#8, #12): removing only appdata0.rpf reproduced the breakpoint and its
registers.

Ported from Marvisak/VIctory a3acc87 by Peter Bonanni: KNOWN_BUILDS names
Series 1.0.2.1 by its executable's BLAKE3 (a build identity, which
docs/asset-policy.md allows), with appdata0.rpf as its startup archive. Before
executing that build, `run` reads the archive's first four bytes and stops
with an error naming the file if it is missing, unreadable, too short or not
RPF9 ("9FPR"). The build line now says "Series 1.0.2.1" instead of "unknown".

Test: the_startup_archive_is_checked_before_the_title_runs.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 15:48:51 +00:00
github-bot changed title from Series 1.0.2.1: the startup archive is checked before the title runs (port of Marvisak/VIctory#12) to Series 1.0.2.1: the package's archives are checked before the title runs (port of Marvisak/VIctory#12, and more) 2026-11-28 16:47:24 +00:00
Beyond the port: a damaged archive further in stops the title later and
says nothing either. 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.

All 22 archives of Series 1.0.2.1 are RPF9 (counted in Marvisak/VIctory#12).
So before that build runs, every .rpf beside the executable and under its
pack folder must start with "9FPR". Those that don't are named, relative to
the folder, and the start stops. `--set VICTORY_ARCHIVE_CHECK=0` starts
anyway. Blocks zeroed further in are not seen. Other folders and file types
are not looked at, and a bare file name checks the current folder.

Test: damaged_archives_of_the_package_are_named.
#1190 stopped at +0x2237178 with the registers a missing appdata0.rpf gives,
though the file was there to the eye. Some archives had been saved as
"appdata0 (1).rpf" and the like, a download's second copy, which the title
never opens. Renaming them fixed it.

KNOWN_BUILDS now lists the twelve archives beside the 1.0.2.1 executable. If
any is not there by its name, the start stops and names it, along with any
file beside it whose name begins as its own and ends in .rpf: "appdata0.rpf
(there is appdata0 (1).rpf: rename it if it is that archive)". This comes
before the header checks; `--set VICTORY_ARCHIVE_CHECK=0` still skips both.

Test: missing_archives_are_named_with_their_look_alikes.
github-bot force-pushed github-bot/gh-1217 from b0b21b8bed to fdedfff9de 2026-11-28 19:14:10 +00:00 Compare
github manually merged commit 395ffffb89 into main 2026-11-29 08:22:11 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

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