From: pwpiwi Date: Tue, 5 Nov 2019 10:43:03 +0000 (+0100) Subject: fix 'hf 14b sriwrite' (#880) X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/ea5e5d042e94ab3750def0b9b9b7c18558741f37?ds=inline fix 'hf 14b sriwrite' (#880) --- diff --git a/client/cmdhf14b.c b/client/cmdhf14b.c index 4685f3f5..577b4fc8 100644 --- a/client/cmdhf14b.c +++ b/client/cmdhf14b.c @@ -237,8 +237,11 @@ static int CmdHF14BCmdRaw (const char *Cmd) { if (HF14BCmdRaw(true, &crc2, true, cmd2, &cmdLen, false) == 0) return switch_off_field_14b(); - if (SRx && (cmdLen != 3 || !crc2) ) return switch_off_field_14b(); - else if (cmd2[0] != 0x50 || cmdLen != 14 || !crc2) return switch_off_field_14b(); + if (SRx) { + if (cmdLen != 3 || !crc2) return switch_off_field_14b(); + } else { + if (cmd2[0] != 0x50 || cmdLen != 14 || !crc2) return switch_off_field_14b(); + } uint8_t chipID = 0; if (SRx) { @@ -263,7 +266,9 @@ static int CmdHF14BCmdRaw (const char *Cmd) { if (cmdLen != 3 || !crc2) return switch_off_field_14b(); if (SRx && cmd2[0] != chipID) return switch_off_field_14b(); } + return HF14BCmdRaw(reply, &crc, power, data, &datalen, true); + } @@ -720,7 +725,7 @@ int CmdSriWrite(const char *Cmd) { else PrintAndLog("[%s] Write block %02X [ %s ]", (isSrix4k)?"SRIX4K":"SRI512", blockno, sprint_hex(data, 4)); - sprintf(str, "-c 09 %02x %02x%02x%02x%02x", blockno, data[0], data[1], data[2], data[3]); + sprintf(str, "-ss -c 09 %02x %02x%02x%02x%02x", blockno, data[0], data[1], data[2], data[3]); CmdHF14BCmdRaw(str); return 0;