mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-09-11 18:29:22 -07:00
restore_bufferS32() returns the length it put back and every graph-buffer caller dropped it, so g_GraphTraceLen kept whatever value the code between save and restore had left. In try_detect_modulation() that is the 160 sample psk antenna-settle trim: `data modulation` gave the buffer's samples back but left it 160 short, and a following demod lost round(160 / clk) bits off the end. check_chiptype() loses the same way through the acquisitions its detections make, on the `lf search` path, and for g_DemodBuffer too. demodTI() loses convLen + 16 on its error path. save_graphbuffer() / restore_graphbuffer() pair the length and grid offset with the contents so no call site has to remember them. The visa2000 and zx8211 sites do not change the length, so converting them is a no-op today and keeps the next one from being a bug. Regression test in tools/pm3_tests.sh: `data modulation` on a saved psk1 trace must leave all 20000 samples. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>