mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-20 13:23:25 -07:00
fix 'hf 14b sriwrite' (#880)
This commit is contained in:
parent
e55b441992
commit
ea5e5d042e
1 changed files with 8 additions and 3 deletions
|
@ -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 (HF14BCmdRaw(true, &crc2, true, cmd2, &cmdLen, false) == 0) return switch_off_field_14b();
|
||||||
|
|
||||||
if (SRx && (cmdLen != 3 || !crc2) ) return switch_off_field_14b();
|
if (SRx) {
|
||||||
else if (cmd2[0] != 0x50 || cmdLen != 14 || !crc2) return switch_off_field_14b();
|
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;
|
uint8_t chipID = 0;
|
||||||
if (SRx) {
|
if (SRx) {
|
||||||
|
@ -263,7 +266,9 @@ static int CmdHF14BCmdRaw (const char *Cmd) {
|
||||||
if (cmdLen != 3 || !crc2) return switch_off_field_14b();
|
if (cmdLen != 3 || !crc2) return switch_off_field_14b();
|
||||||
if (SRx && cmd2[0] != chipID) return switch_off_field_14b();
|
if (SRx && cmd2[0] != chipID) return switch_off_field_14b();
|
||||||
}
|
}
|
||||||
|
|
||||||
return HF14BCmdRaw(reply, &crc, power, data, &datalen, true);
|
return HF14BCmdRaw(reply, &crc, power, data, &datalen, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -720,7 +725,7 @@ int CmdSriWrite(const char *Cmd) {
|
||||||
else
|
else
|
||||||
PrintAndLog("[%s] Write block %02X [ %s ]", (isSrix4k)?"SRIX4K":"SRI512", blockno, sprint_hex(data, 4));
|
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);
|
CmdHF14BCmdRaw(str);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue