From 45926261dbbeec4ed28fce9adeb28b803a8255b9 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Fri, 6 Dec 2019 17:12:29 +0200 Subject: [PATCH] style --- client/cmdhfmf.c | 4 ++-- client/mifare/mifarehost.c | 14 +++++++------- tools/pm3_mf7b_wipe.py | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 680b9da19..2ace2d214 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -3691,7 +3691,7 @@ static int CmdHF14AMfCWipe(const char *cmd) { CLIGetHexWithReturn(2, atqa, &atqaLen); CLIGetHexWithReturn(3, sak, &sakLen); CLIParserFree(); - + if (uidLen && uidLen != 4) { PrintAndLogEx(ERR, "UID length must be 4 bytes instead of: %d", uidLen); return PM3_EINVARG; @@ -3705,7 +3705,7 @@ static int CmdHF14AMfCWipe(const char *cmd) { return PM3_EINVARG; } - int res = mfCWipe((uidLen)? uid : NULL, (atqaLen) ? atqa : NULL, (sakLen) ? sak : NULL); + int res = mfCWipe((uidLen) ? uid : NULL, (atqaLen) ? atqa : NULL, (sakLen) ? sak : NULL); if (res) { PrintAndLogEx(ERR, "Can't wipe card. error=%d", res); return PM3_ESOFT; diff --git a/client/mifare/mifarehost.c b/client/mifare/mifarehost.c index 151ac72cf..e9baa7ee7 100644 --- a/client/mifare/mifarehost.c +++ b/client/mifare/mifarehost.c @@ -616,9 +616,9 @@ int mfCSetUID(uint8_t *uid, uint8_t *atqa, uint8_t *sak, uint8_t *oldUID, uint8_ } int mfCWipe(uint8_t *uid, uint8_t *atqa, uint8_t *sak) { - uint8_t block0[16] = {0x01, 0x02, 0x03, 0x04, 0x04, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBE, 0xAF}; - uint8_t blockD[16] = {0x00}; - uint8_t blockK[16] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x08, 0x77, 0x8F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; + uint8_t block0[16] = {0x01, 0x02, 0x03, 0x04, 0x04, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBE, 0xAF}; + uint8_t blockD[16] = {0x00}; + uint8_t blockK[16] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x08, 0x77, 0x8F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; uint8_t params = MAGIC_SINGLE; if (uid != NULL) { @@ -632,7 +632,7 @@ int mfCWipe(uint8_t *uid, uint8_t *atqa, uint8_t *sak) { block0[6] = atqa[1]; block0[7] = atqa[0]; } - int res; + int res; for (int blockNo = 0; blockNo < 4 * 16; blockNo++) { for (int retry = 0; retry < 3; retry++) { if (blockNo == 0) { @@ -643,19 +643,19 @@ int mfCWipe(uint8_t *uid, uint8_t *atqa, uint8_t *sak) { else res = mfCSetBlock(blockNo, blockD, NULL, params); } - + if (res == PM3_SUCCESS) break; PrintAndLogEx(WARNING, "Retry block[%d]...", blockNo); } - + if (res) { PrintAndLogEx(ERR, "Error setting block[%d]: %d", blockNo, res); return res; } } DropField(); - + return PM3_SUCCESS; } diff --git a/tools/pm3_mf7b_wipe.py b/tools/pm3_mf7b_wipe.py index f4c58ce01..9f7b29c6b 100644 --- a/tools/pm3_mf7b_wipe.py +++ b/tools/pm3_mf7b_wipe.py @@ -71,7 +71,7 @@ # # Thats it! Your S50 7byte UID card is wiped back. Now you can return back to Step 1 of this manual. # -# +#