From 3438d016c77cae6d0c2e040b4bfe33b126c0a350 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 15 Mar 2018 20:06:12 +0100 Subject: [PATCH] idea based on @jamchamb PR in official pm3 https://github.com/Proxmark/proxmark3/pull/584 --- CHANGELOG.md | 1 + armsrc/mifarecmd.c | 4 ++-- armsrc/mifareutil.c | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0081b1c3f..dd6e683a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] + - 'hf mfu dumop / read' - now retries five times. (@jamchamb) - Added `hf list mf` - deciphers crypto1 stream and works with first authentication and weak nested authentications (@Merlok) - Adjusted `lf cmdread` to respond to client when complete and the client will then automatically call `data samples` (@marshmellow42) - Added a bitbang mode to `lf cmdread` if delay is 0 the cmd bits turn off and on the antenna with 0 and 1 respectively (@marshmellow42) diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index 6f753432b..821eb9761 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -330,9 +330,9 @@ void MifareUReadCard(uint8_t arg0, uint16_t arg1, uint8_t arg2, uint8_t *datain) if (len) { if (MF_DBGLEVEL >= MF_DBG_ERROR) Dbprintf("Read block %d error",i); // if no blocks read - error out - if (i==0){ + if (i == 0) { OnError(2); - return; + return; } else { //stop at last successful read block and return what we got break; diff --git a/armsrc/mifareutil.c b/armsrc/mifareutil.c index 8e158a91b..70b5907ec 100644 --- a/armsrc/mifareutil.c +++ b/armsrc/mifareutil.c @@ -362,10 +362,9 @@ int mifare_ultra_readblockEx(uint8_t blockNo, uint8_t *blockData) { } int mifare_ultra_readblock(uint8_t blockNo, uint8_t *blockData) { #define MFU_MAX_CRC_RETRIES 5 - uint8_t retries = 0; uint8_t res; - - for (retries = 0; retries < MFU_MAX_CRC_RETRIES; ++retries) { + + for (uint8_t retries = 0; retries < MFU_MAX_CRC_RETRIES; ++retries) { res = mifare_ultra_readblockEx(blockNo, blockData); // break if OK, or NACK.