From 6cddaa0a08c575727e5ee6b566f22e8d59e81845 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 30 Apr 2019 14:29:52 +0200 Subject: [PATCH] fix: 'hf mf keybrute' - adapt to NG for checkkeys. Kind of out-of-datem, since hardnested solves this better. --- client/mifare/mifarehost.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/mifare/mifarehost.c b/client/mifare/mifarehost.c index cd823b3a7..293fc76b0 100644 --- a/client/mifare/mifarehost.c +++ b/client/mifare/mifarehost.c @@ -220,9 +220,9 @@ int mfCheckKeys_fast(uint8_t sectorsCnt, uint8_t firstChunk, uint8_t lastChunk, // ref: https://github.com/J-Run/mf_key_brute int mfKeyBrute(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint64_t *resultkey) { -#define KEYS_IN_BLOCK 84 -#define KEYBLOCK_SIZE 510 -#define CANDIDATE_SIZE 0xFFFF * 6 +#define KEYS_IN_BLOCK ((USB_CMD_DATA_SIZE - 4) / 6) +#define KEYBLOCK_SIZE (KEYS_IN_BLOCK * 6) +#define CANDIDATE_SIZE (0xFFFF * 6) uint64_t key64; uint8_t found = false;