From dbadc2b8e05f77f9a4b09903d72fb130544ce777 Mon Sep 17 00:00:00 2001 From: Niel Nielsen Date: Mon, 31 Aug 2026 12:20:26 +0200 Subject: [PATCH] Update MFC_CHKKEYS_FAST_MAX_KEYS definition Signed-off-by: Niel Nielsen --- include/pm3_cmd.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index a12b01177..6f7cf9753 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -552,7 +552,9 @@ typedef struct { } PACKED mf_chkkeys_fast_t; // most keys that fit alongside the header in one frame -#define MFC_CHKKEYS_FAST_MAX_KEYS ((PM3_CMD_DATA_SIZE - sizeof(mf_chkkeys_fast_t)) / 6) +#define MFC_CHKKEYS_FAST_MAX_KEYS \ + (((PM3_CMD_DATA_SIZE - sizeof(mf_chkkeys_fast_t)) / 6) > 255 ? 255 : \ + ((PM3_CMD_DATA_SIZE - sizeof(mf_chkkeys_fast_t)) / 6)) // CMD_HF_MIFARE_VALUE payload. // Replaces a 34 byte blob addressed by hardcoded offsets: