Commit Graph

10 Commits

Author SHA1 Message Date
b13b6b3d3f Merge remote-tracking branch 'upstream/main' into HEAD 2026-12-01 19:17:10 +08:00
c28b21aa61 rpf9dump: harden segment bounds and CLI option validation (RPF9DUMP-SEGMENTS-AND-CLI) 2026-11-24 19:05:56 +08:00
68fd157f54 tests: block destination path in rpf9dump write-failure exit-code tests (TEST-RPF9DUMP-WRITE-BLOCKER) 2026-11-24 19:03:21 +08:00
c4cd71bed7 rpf9dump: guard --start/--length bounds and <64-byte sources in models/textures (#6344)
Squash-merged after review of PR #6344 - rpf9dump: guard --start/--length bounds and <64-byte sources in models/textures
2026-11-23 08:14:58 -06:00
20960a0112 Merge pull request #4636 from Michael
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:16:41 -05:00
046de42647 rpf9dump: reject a missing or non-file source before creating the output folder
A mistyped source path, or a directory passed as one, created <out>/<name> and then failed in FileInfo.Length with an unhandled FileNotFoundException and exit -532462766. Check the source after the argument checks and before Directory.CreateDirectory, print one line to stderr, and exit 2 like the other input errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016Nsrb3M85XUG34gwsU9emJ
2026-11-22 20:33:59 -07:00
60868f0ebd rpf9dump: reject an unknown mode before touching the source or output
An unknown first argument fell through every mode branch: it created <outdir>/<source>, printed ok=0 fail=0 skip=0 and exited 0, which make_game reads as a finished stage. Check the mode first, print one usage listing all five modes (audio and xma were missing) and exit 2.
2026-11-22 16:06:38 -06:00
54bb91389d rpf9dump: fix the write-failure fixture's page-count overlap; count embedded, directory and read-I/O failures as write failures
The fixture wrote the resource page counts at 0x88/0x89, which is the
texture descriptor's width field (t+0x38 at t=0x50): width read 257 and
Parse rejected the record (layout 20480 vs allocation 4096), so no entry
reached Export and the committed test failed before any DDS write. Move
the page-count pointer to 0x40 (counts at 0x48, below the descriptor);
the same binary now recovers one texture, hits the blocked DDS write,
withholds manifest.json and exits 1. The test also asserts the DDS is
absent, not only the return code.

Review gaps closed: embedded-texture DDS writes are no longer swallowed
by catch {} (decode failures count like the textures branch, write
failures count into writeFail and fail the run); dictionary-directory
and models _tex directory creation failures return WriteFail=1; a
retryable IOException while reading a resource or decoding (CreateDds)
also counts as a write failure, so a locked source no longer publishes
a manifest with missing files; marker withdrawal goes through
WithdrawMarker, which clears a read-only attribute first and turns any
remaining delete failure into a one-line error with exit 1 instead of a
traceback.

Verified offline: Program.cs compiles 0 warnings/0 errors against the
real Core sources with a BCnEncoder stub (BCnEncoder.Net is not cached
offline, so the DLL build runs in CI); a Python mirror of Recover/
RecoverAtOffsets/TryInflate/LooksLikeDictionary/Parse/ComputeLayout
recovers the committed fixture 1/1 (system 208 B, graphics 4096 B,
pages 1/1, texture 'probe' 4x4, allocation 4096) through both scan
paths, and rejects the pre-fix bytes with the reported mismatch
(layout 20480 != allocation 4096). python -I skip path: 2 skipped, OK.
2026-11-22 20:52:44 +01:00
01e27846e4 rpf9dump: a per-item write failure in models/textures must fail the run and withhold manifest.json 2026-11-22 20:15:40 +01:00
7e196840c4 rpf9dump xma: exit 1 when a stream write fails, so make_game retries it
make_game writes audio/xma.done after rpf9dump xma exits 0. The xma branch
counted failed writes but fell through to the final return, which only
fails for ttpf, so a failed stream was never written on a later run.
2026-11-22 12:04:43 +05:30