From 7fade30465f0c3164fb62017ffe4d07cba889fa7 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sat, 29 Aug 2026 17:48:25 +0200 Subject: [PATCH] remove commented out code --- client/src/cmdhfmf.c | 122 ------------------------------------------- 1 file changed, 122 deletions(-) diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index 7473751b1..1be506608 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -6723,128 +6723,6 @@ static int CmdHf14AMfNack(const char *Cmd) { return PM3_SUCCESS; } -/* -static int CmdHF14AMfice(const char *Cmd) { - CLIParserContext *ctx; - CLIParserInit(&ctx, "hf mf ice", - "Collect MIFARE Classic nonces to file", - "hf mf ice\n" - "hf mf ice -f nonces.bin"); - - void *argtable[] = { - arg_param_begin, - arg_str0("f", "file", "", "filename of nonce dump"), - arg_u64_0(NULL, "limit", "", "nonces to be collected"), - arg_param_end - }; - CLIExecWithReturn(ctx, Cmd, argtable, true); - - int fnlen = 0; - char filename[FILE_PATH_SIZE] = {0}; - CLIParamStrToBuf(arg_get_str(ctx, 1), (uint8_t *)filename, FILE_PATH_SIZE, &fnlen); - - uint32_t limit = arg_get_u32_def(ctx, 2, 50000); - - CLIParserFree(ctx); - - // Validations - char *fptr; - - if (filename[0] == '\0') { - fptr = GenerateFilename("hf-mf-", "-nonces.bin"); - if (fptr == NULL) - return PM3_EFILE; - strncpy(filename, fptr, sizeof(filename) - 1); - free(fptr); - } - - uint8_t blockNo = 0; - uint8_t keyType = MF_KEY_A; - uint8_t trgBlockNo = 0; - uint8_t trgKeyType = MF_KEY_B; - bool slow = false; - bool initialize = true; - bool acquisition_completed = false; - uint32_t total_num_nonces = 0; - PacketResponseNG resp; - - uint32_t part_limit = 3000; - - PrintAndLogEx(NORMAL, "Collecting "_YELLOW_("%u")" nonces \n", limit); - - FILE *fnonces = NULL; - if ((fnonces = fopen(filename, "wb")) == NULL) { - PrintAndLogEx(WARNING, "Could not create file " _YELLOW_("%s"), filename); - return PM3_EFILE; - } - - clearCommandBuffer(); - - uint64_t t1 = msclock(); - - do { - if (kbd_enter_pressed()) { - PrintAndLogEx(WARNING, "\naborted via keyboard!\n"); - break; - } - - uint32_t flags = 0; - flags |= initialize ? 0x0001 : 0; - flags |= slow ? 0x0002 : 0; - clearCommandBuffer(); - mf_acquire_nonces_t payload = { - .blockno = blockNo, - .keytype = keyType, - .trg_blockno = trgBlockNo, - .trg_keytype = trgKeyType, - .flags = flags, - }; - SendCommandNG(CMD_HF_MIFARE_ACQ_NONCES, (uint8_t *)&payload, sizeof(payload)); - - if (WaitForResponseTimeout(CMD_HF_MIFARE_ACQ_NONCES, &resp, 3000) == false) { - goto out; - } - if (resp.status != PM3_SUCCESS) goto out; - if (resp.length < sizeof(mf_nonces_resp_t)) goto out; - - const mf_nonces_resp_t *nresp = (const mf_nonces_resp_t *)resp.data.asBytes; - uint32_t items = nresp->num_nonces; - fwrite(nresp->nonces, 1, items * 4, fnonces); - fflush(fnonces); - - total_num_nonces += items; - if (total_num_nonces > part_limit) { - PrintAndLogEx(INFO, "Total nonces %u\n", total_num_nonces); - part_limit += 3000; - } - - acquisition_completed = (total_num_nonces > limit); - - initialize = false; - - } while (!acquisition_completed); - -out: - PrintAndLogEx(SUCCESS, "time: %" PRIu64 " seconds\n", (msclock() - t1) / 1000); - - if (fnonces) { - fflush(fnonces); - fclose(fnonces); - } - - clearCommandBuffer(); - mf_acquire_nonces_t off_payload = { - .blockno = blockNo, - .keytype = keyType, - .trg_blockno = trgBlockNo, - .trg_keytype = trgKeyType, - .flags = 4, - }; - SendCommandNG(CMD_HF_MIFARE_ACQ_NONCES, (uint8_t *)&off_payload, sizeof(off_payload)); - return PM3_SUCCESS; -} -*/ - static int CmdHF14AMfAuth4(const char *Cmd) { uint8_t keyn[20] = {0}; int keynlen = 0;