From ca21348ff68e49ead23612504ea831c53865c42c Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 15 Jan 2024 17:14:04 +0100 Subject: [PATCH] text --- armsrc/iso15693.c | 33 +++++++++++++++++---------------- client/src/cmdhf15.c | 13 ++++++------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/armsrc/iso15693.c b/armsrc/iso15693.c index 61b77fa99..af404a5ce 100644 --- a/armsrc/iso15693.c +++ b/armsrc/iso15693.c @@ -2648,10 +2648,9 @@ void LockPassSlixIso15693(uint32_t pass_id, uint32_t password) { void SetTag15693Uid(const uint8_t *uid) { LED_A_ON(); - uint8_t cmd[4][9] = { - {ISO15_REQ_DATARATE_HIGH, ISO15693_WRITEBLOCK, 0x3e, 0x00, 0x00, 0x00, 0x00}, - {ISO15_REQ_DATARATE_HIGH, ISO15693_WRITEBLOCK, 0x3f, 0x69, 0x96, 0x00, 0x00}, + {ISO15_REQ_DATARATE_HIGH, ISO15693_WRITEBLOCK, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xE9, 0x8F}, + {ISO15_REQ_DATARATE_HIGH, ISO15693_WRITEBLOCK, 0x3f, 0x69, 0x96, 0x00, 0x00, 0x8A, 0xBB}, {ISO15_REQ_DATARATE_HIGH, ISO15693_WRITEBLOCK, 0x38}, {ISO15_REQ_DATARATE_HIGH, ISO15693_WRITEBLOCK, 0x39} }; @@ -2668,29 +2667,31 @@ void SetTag15693Uid(const uint8_t *uid) { cmd[3][5] = uid[1]; cmd[3][6] = uid[0]; - AddCrc15(cmd[0], 7); - AddCrc15(cmd[1], 7); AddCrc15(cmd[2], 7); AddCrc15(cmd[3], 7); - uint8_t recvbuf[ISO15693_MAX_RESPONSE_LENGTH]; + uint8_t buf[ISO15693_MAX_RESPONSE_LENGTH] = {0x00}; uint32_t start_time = 0; uint32_t eof_time = 0; uint16_t recvlen = 0; + int res = PM3_SUCCESS; + for (int i = 0; i < 4; i++) { res = SendDataTag( - cmd[i], - sizeof(cmd[i]), - (i == 0) ? true : false, - true, - recvbuf, - sizeof(recvbuf), - start_time, - ISO15693_READER_TIMEOUT_WRITE, - &eof_time, - &recvlen); + cmd[i], + sizeof(cmd[i]), + (i == 0) ? true : false, + true, + buf, + sizeof(buf), + start_time, + ISO15693_READER_TIMEOUT_WRITE, + &eof_time, + &recvlen + ); + start_time = eof_time + DELAY_ISO15693_VICC_TO_VCD_READER; } diff --git a/client/src/cmdhf15.c b/client/src/cmdhf15.c index b32b0a8f4..77e6534f5 100644 --- a/client/src/cmdhf15.c +++ b/client/src/cmdhf15.c @@ -97,8 +97,6 @@ } #endif - - typedef struct { uint8_t lock; uint8_t block[8]; @@ -2680,9 +2678,9 @@ static int CmdHF15CSetUID(const char *Cmd) { return PM3_EINVARG; } - PrintAndLogEx(SUCCESS, "Reverse input UID... " _YELLOW_("%s"), iso15693_sprintUID(NULL, payload.uid)); + PrintAndLogEx(DEBUG, "Reverse input UID... " _YELLOW_("%s"), iso15693_sprintUID(NULL, payload.uid)); - PrintAndLogEx(INFO, "Getting current card details..."); + PrintAndLogEx(INFO, "Get current tag"); uint8_t carduid[HF15_UID_LENGTH] = {0x00}; if (getUID(true, false, carduid) != PM3_SUCCESS) { @@ -2690,8 +2688,7 @@ static int CmdHF15CSetUID(const char *Cmd) { return PM3_ESOFT; } - PrintAndLogEx(INFO, "Updating tag uid..."); - + PrintAndLogEx(INFO, "Writing..."); PacketResponseNG resp; clearCommandBuffer(); SendCommandNG(CMD_HF_ISO15693_CSETUID, (uint8_t *)&payload, sizeof(payload)); @@ -2701,7 +2698,7 @@ static int CmdHF15CSetUID(const char *Cmd) { return PM3_ESOFT; } - PrintAndLogEx(INFO, "Verifying write..."); + PrintAndLogEx(INFO, "Verifying..."); if (getUID(true, false, carduid) != PM3_SUCCESS) { PrintAndLogEx(FAILED, "no tag found"); @@ -2714,10 +2711,12 @@ static int CmdHF15CSetUID(const char *Cmd) { if (memcmp(revuid, payload.uid, HF15_UID_LENGTH) == 0) { PrintAndLogEx(SUCCESS, "Setting new UID ( " _GREEN_("ok") " )"); + PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS;; } PrintAndLogEx(FAILED, "Setting new UID ( " _RED_("fail") " )"); + PrintAndLogEx(NORMAL, ""); return PM3_ESOFT; }