fix: change db7 to 5byte frame header from 8byte header

This commit is contained in:
2026-04-16 13:57:26 -04:00
parent a46961c124
commit 145074d8b5
2 changed files with 66 additions and 12 deletions
+13 -6
View File
@@ -1356,9 +1356,12 @@ def _decode_a5_waveform(
they are derived from the compliance config (the correct permanent source).
A5[1..N] (chunk responses):
db[7:] = [8-byte per-frame header] [waveform bytes ...]
Header: [ctr LE uint16, 0x00 × 6] — frame sequence counter
Waveform starts at byte 8 of db[7:].
db[7:] = [5-byte per-frame header] [waveform bytes ...]
Header: [ctr LE uint16, 0x00 × 3] — frame sequence counter + 3 null bytes
Waveform starts at byte 5 of db[7:].
NOTE: Previously documented as 8-byte header — INCORRECT. Confirmed 5 bytes
via "Standard Recording Setup" cross-frame continuity test on MITM capture
(4-11-26): A5[5] ends "St", A5[6].w[0:5] = 5 nulls, w[5:]= "andard…" ✓.
── Cross-frame alignment ────────────────────────────────────────────────────
Frame waveform chunk sizes are NOT multiples of 8. Naive concatenation
@@ -1491,10 +1494,14 @@ def _decode_a5_waveform(
# (read_bulk_waveform_stream returns early on page_key==0).
# No hardcoded frame-index skip here — all non-metadata frames are data.
else:
# Strip the 8-byte per-frame header (ctr + 6 zero bytes)
if len(w) < 8:
# Strip the 5-byte per-frame header (ctr[2] + 3 zero bytes + 1 flag byte).
# Confirmed 2026-04-15 via "Standard Recording Setup" cross-frame continuity
# test on MITM capture (4-11-26): A5[5] ends with "St", A5[6].w[0:5] are
# 5 null bytes, w[5:] begins with "andard Recording Setup…" — contiguous iff
# header=5. Previously documented as 8 bytes — INCORRECT.
if len(w) < 5:
continue
wave = w[8:]
wave = w[5:]
if len(wave) < 2:
continue