package check: name a right-sized .ttpf whose contents are damaged #2448
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2448"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by HyperRamzey on 2026-11-29T13:09:59Z.
What
A download paused and resumed leaves files of the right size with zeroed blocks.
check_packagepassed them on size alone, the title started, and stopped minutes later at+0x3e42541with nothing saying why (#1622, #421, #595). Right-sized.ttpffiles are now also checked by content:RDS5container: entry 0's low 32 bits shifted left 8 are the first extent's file offset; entry 1's 4 KB page minus entry 0's gives the extent's length. The layer at that offset must be a validETPF.ETPFat offset 0 is accepted too.ETPFlayer: magic, flags with mask 2 set, a layer count at most 0xFFFF, and a 24-byte-per-entry table (0x10 + 24 x count) inside the extent and inside the file.A damaged file is printed as
damaged files <path> is the right size but <why>and stops the run like a missing one, naming the file and the skip switch (VICTORY_SKIP_FILE_CHECK=1).victory run's preflight message now reads "incomplete or damaged".The check was written from the dump's own loader (
sub_143BDD340reads the ETPF header: 0x10 bytes, magic, flags & 2, count <= 0xFFFF; entries 24 bytes), and validated against the real package:ttdb_graphics.ttpf(34,411,776 bytes) is RDS5 with 1550 entries, entry 0 = 0x31 -> extent at 0x3100, ETPF flags 0x27A, 912 layers, table 0x5590 bytes <= the 0xC000-byte extent.Tests
crates/victory-game/src/lib.rs: a zeroed right-sized.ttpf, a valid RDS5, a layer that is not ETPF, a layer count over 0xFFFF, a truncated entry table, and a bare ETPF.apps/victory/src/run.rs: a full package of right-sized zeroed files stops the run and the message names the file, the reason andVICTORY_SKIP_FILE_CHECK=1, with the skip honoured and a non-executing run not stopped.All pass under Wine (
cargo xwin test); sabotage-checked: returning early fromttpf_problemmakes four of them fail.Resolves / relates
View 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.