From 109f859475d50d4c7a59657c1e2d8f84b06b21ae Mon Sep 17 00:00:00 2001 From: t0m4 Date: Sun, 7 Jul 2019 12:18:47 +0200 Subject: [PATCH] Code cleaning --- armsrc/iso15693.c | 2 +- client/cmdhf15.c | 24 +++++++----------------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/armsrc/iso15693.c b/armsrc/iso15693.c index b3d0be1e..f4120512 100644 --- a/armsrc/iso15693.c +++ b/armsrc/iso15693.c @@ -1604,7 +1604,7 @@ void SetTag15693Uid(uint8_t *uid) uint16_t crc; int recvlen = 0; - uint8_t recvbuf[ISO15693_MAX_RESPONSE_LENGTH]; + uint8_t recvbuf[ISO15693_MAX_RESPONSE_LENGTH]; LED_A_ON(); diff --git a/client/cmdhf15.c b/client/cmdhf15.c index e61f27ed..c2a13354 100644 --- a/client/cmdhf15.c +++ b/client/cmdhf15.c @@ -957,10 +957,8 @@ int CmdHF15CmdWrite(const char *Cmd) { int CmdHF15CSetUID(const char *Cmd) { - uint8_t uid[16] = {0x00}; - uint8_t oldUidReversed[8], oldUid[8] = {0x00}; - uint8_t newUidReversed[8], newUid[8] = {0x00}; - int res; + uint8_t uid[8] = {0x00}; + uint8_t oldUid[8], newUid[8] = {0x00}; uint8_t needHelp = 0; char cmdp = 1; @@ -970,7 +968,7 @@ int CmdHF15CSetUID(const char *Cmd) return 1; } - if (strcmp(sprint_hex_inrow_ex(uid, 1, 2), "e0") != 0) { + if (uid[0] != 0xe0) { PrintAndLog("UID must begin with the byte 'E0'"); return 1; } @@ -1003,11 +1001,7 @@ int CmdHF15CSetUID(const char *Cmd) PrintAndLog("new UID | %s", sprint_hex(uid, 8)); PrintAndLog("Using backdoor Magic tag function"); - if (getUID(oldUidReversed)) { - for (int i=0; i