Fix pcap timestamp wrap, ATR-hunt EOF crash, start.bat protocol; tighten launchers + vs_reader

- pd.py ts_from_samplenum: drop c_uint32 truncation + dead sampleOverflowCount
  (pcap timestamps wrapped backwards past ~4.5 min at 16 MHz).
- pd.py handle_atr: guard None reads at EOF (was TypeError (None & 0x80) on a
  capture truncated mid-ATR-hunt).
- start.bat: add --protocol (+ :protocol=T=0 default) to match start.sh's
  mid-session decode; correct the 'flag-for-flag' header comment.
- start.sh: reject --rst/--vcc assigned to the same pin (was unchecked).
- setup.bat: set DEVICE_MSG on blocked/skipped probe so the trailing
  'unknown' message is suppressed.
- vs_reader.py: RESULT now fails on CONCAT / payload mismatch / suspicious
  CLA, not just GARBAGE (OK text unchanged; clean traces stay identical).
This commit is contained in:
catarrh committed 2026-09-11 01:21:02 +03:00
1 parent 9d00827837
commit e6ff3a2e14
5 files changed
+46 -12

No files matched your search

+20 -6
View File
@@ -380,12 +380,26 @@ def main():
print('\nWARNING: capture contains 0 APDUs but reader log has %d exchange(s).'
% len(reader))
ok = (len(pcap_garbage) == 0 and not no_apdu_failure)
print('\nRESULT: %s' % ('OK - capture fully explained (reader + CAT + valid retries)'
if ok else
'UNCLEAN - %d mis-framed capture APDU(s)%s'
% (len(pcap_garbage),
', 0 capture APDUs' if no_apdu_failure else '')))
ok = (len(pcap_garbage) == 0
and len(concat_indices) == 0
and len(payload_mismatches) == 0
and len(suspicious_cla) == 0
and not no_apdu_failure)
if ok:
print('\nRESULT: OK - capture fully explained (reader + CAT + valid retries)')
else:
problems = []
if pcap_garbage:
problems.append('%d garbage APDU(s)' % len(pcap_garbage))
if concat_indices:
problems.append('%d CONCAT packet(s)' % len(concat_indices))
if payload_mismatches:
problems.append('%d payload mismatch(es)' % len(payload_mismatches))
if suspicious_cla:
problems.append('%d suspicious CLA' % len(suspicious_cla))
if no_apdu_failure:
problems.append('0 capture APDUs')
print('\nRESULT: UNCLEAN - %s' % ', '.join(problems))
sys.exit(0 if ok else 1)