mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-13 18:57:12 +08:00
chg: 'sc raw' reading byte to the end of line now exists correct
This commit is contained in:
parent
4a8e048694
commit
7394bb14a0
1 changed files with 13 additions and 5 deletions
|
@ -68,7 +68,7 @@ int CmdSmartRaw(const char *Cmd) {
|
||||||
bool active = false;
|
bool active = false;
|
||||||
bool active_select = false;
|
bool active_select = false;
|
||||||
uint8_t cmdp = 0;
|
uint8_t cmdp = 0;
|
||||||
bool errors = false, reply = true, decodeTLV = false;
|
bool errors = false, reply = true, decodeTLV = false, breakloop = false;
|
||||||
uint8_t data[USB_CMD_DATA_SIZE] = {0x00};
|
uint8_t data[USB_CMD_DATA_SIZE] = {0x00};
|
||||||
|
|
||||||
while (param_getchar(Cmd, cmdp) != 0x00 && !errors) {
|
while (param_getchar(Cmd, cmdp) != 0x00 && !errors) {
|
||||||
|
@ -102,7 +102,7 @@ int CmdSmartRaw(const char *Cmd) {
|
||||||
PrintAndLogEx(WARNING, "Hex must have even number of digits.");
|
PrintAndLogEx(WARNING, "Hex must have even number of digits.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
cmdp += 2;
|
breakloop = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -110,6 +110,9 @@ int CmdSmartRaw(const char *Cmd) {
|
||||||
errors = true;
|
errors = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( breakloop )
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Validations
|
//Validations
|
||||||
|
@ -155,9 +158,14 @@ int CmdSmartRaw(const char *Cmd) {
|
||||||
uint8_t *data = resp.d.asBytes;
|
uint8_t *data = resp.d.asBytes;
|
||||||
|
|
||||||
// TLV decoder
|
// TLV decoder
|
||||||
if (decodeTLV && datalen > 4) {
|
if (decodeTLV ) {
|
||||||
PrintAndLogEx(SUCCESS, "APDU response: %02x %02x - %s", data[datalen - 2], data[datalen - 1], GetAPDUCodeDescription(data[datalen - 2], data[datalen - 1]));
|
|
||||||
|
if (datalen >= 2) {
|
||||||
|
PrintAndLogEx(SUCCESS, "%02x %02x | %s", data[datalen - 2], data[datalen - 1], GetAPDUCodeDescription(data[datalen - 2], data[datalen - 1]));
|
||||||
|
}
|
||||||
|
if (datalen > 4) {
|
||||||
TLVPrintFromBuffer(data, datalen - 2);
|
TLVPrintFromBuffer(data, datalen - 2);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(SUCCESS, "%s", sprint_hex(data, datalen));
|
PrintAndLogEx(SUCCESS, "%s", sprint_hex(data, datalen));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue