After aggressive field cycling (e.g. tear-off attacks), the FPGA's
internal SSC/DMA state can become corrupted even though the bitstream
is technically loaded. FpgaDownloadAndGo() caches downloaded_bitstream
and skips re-download if it matches, so subsequent commands fail
silently or hang.
Add FpgaResetBitstream() which sets downloaded_bitstream to
FPGA_BITSTREAM_UNKNOWN, forcing the next FpgaDownloadAndGo() to
perform a complete reload.
In Get14443bAnswerFromTag(), the behindBy == 0 idle loop (waiting for
FPGA DMA samples) had no watchdog kick, no button check, and no
timeout. If the FPGA stops providing the SSC clock, this loop spins
infinitely until the hardware watchdog triggers a reboot.
Add WDT_HIT(), BUTTON_PRESS() check, and a 200ms failsafe timeout
using GetTickCountDelta() to prevent infinite spins.
When no --keys or --mfc-keys arguments are given, automatically
look for hf-mfp-<UID>-key.json and hf-mf-<UID>-key.bin files,
matching the output of hf mfp chk --dump and hf mf chk --dump.
Fail with helpful message if no keys are available, matching
the behaviour of hf mf dump.
Restructure dump into 4 phases:
1. Classify sectors via single MFC probe (SL3 vs SL1)
2. AES dictionary only on SL3 sectors
3. MFC dictionary only on SL1 sectors
4. Read with found keys
Suppress firmware debug output during key probing to prevent
auth error message flood, matching MifareChkKeys behavior.
Replace mf_check_keys (which hangs in firmware infinite retry loop)
with mf_read_sector for SL1 key probing. Defer MFC key probing to
the read phase so it only runs per-sector when SL3 auth fails.
Also fix mfcProbeKeys memory leak on early exit paths.
D:/a/proxmark3/proxmark3/client/deps/mqtt/win32_sockets.h: In function 'open_nb_socket':
D:/a/proxmark3/proxmark3/client/deps/mqtt/win32_sockets.h:35:25: error: format '%s' expects argument of type 'char *', but argument 3 has type 'WCHAR *' {aka 'short unsigned int *'} [-Werror=format=]
35 | fprintf(stderr, "error: getaddrinfo: %s", gai_strerror(rv));
| ^~~~~~~~~~~~~~~~~~~~~~~~