This commit is contained in:
iceman1001 2024-01-15 17:14:04 +01:00
parent f69eb8b127
commit ca21348ff6
2 changed files with 23 additions and 23 deletions

View file

@ -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;
}

View file

@ -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;
}