CSS DVD mux: per-title key via scan-key reuse + playback-order crack

A CSS DVD whose main title was mis-detected as unencrypted (the up-front
crack scanned the largest cell first and starved its budget in that cell's
clear prefix) muxed scrambled sectors as plaintext at exit 0. CSS leaves
the pack/PES header clear, so an un-descrambled sector muxes as a
structurally-valid but corrupt PES packet with zero loss reported.

decrypt_keys_for_title resolves a DVD title's CSS key two ways:
- Fast path: reuse the scan's cracked key when its crack_span covers this
  title's VTS (no re-read; on a live drive no second bus-auth).
- Crack: on a detection miss or a different VTS, crack from the title's OWN
  extents in a SINGLE scan in natural PLAYBACK ORDER (never largest-first).
  One scan = one CSS-locked early-bail, so a locked title is not re-hammered
  per cell against a live drive (hard rule #2); the 50k-sector budget is the
  same accepted bound the disc-wide scan uses. Cracked -> key; Unencrypted
  -> clear; ScrambledUncracked -> hard-fail.
ensure_title_decryptable hard-fails an uncrackable DVD title even when
detection missed, and passes a title that resolved its OWN valid key
regardless of the disc-wide css_error. descramble_region is unchanged from
v1.5.1 (validated-key seed).

Also rename the unlocker report's DVD entry CSS -> DVD. Bump 1.5.2.
This commit is contained in:
Matthew Jackson
2026-07-22 13:07:26 -07:00
parent bb59166e48
commit 34c5293704
4 changed files with 472 additions and 119 deletions
+25 -1
View File
@@ -1,6 +1,30 @@
# Changelog
## [1.5.1] — UNRELEASED
## [1.5.2] — UNRELEASED
### Fixed
- **A CSS DVD whose main title opens with a long unscrambled run no longer
produces a silent garbage MKV.** The mux resolved a DVD's descramble key from
an up-front detection pass that scanned the title's largest cell first and gave
up after a fixed budget; a feature cell that begins with a long clear stretch
(well over that budget) was read as "unencrypted", so the muxer passed the
still-scrambled sectors through as plaintext and exited 0 with corrupt video.
A DVD now always muxes through the self-contained CSS descramble path, which
checks each sector's own scramble flag and re-cracks the per-region title key
from the data itself — no up-front key, no detection gate. A clear DVD is a
per-sector no-op; an encrypted one self-recovers, including across VOB/VTS key
changes; a detection miss can no longer route scrambled data to the muxer.
### Changed
- The per-rip unlocker report renames the DVD entry **CSS → DVD** and now
reflects the bus-auth that actually ran (it engages on any DVD to clear the
drive's scrambled-read barrier), rather than whether a title-key crack happened
to succeed. An encrypted DVD that reads and muxes fine previously showed
`CSS: no`; it now correctly shows `DVD: yes`.
## [1.5.1] — 2026-07-20
### Fixed