mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
added trailer decoding
This commit is contained in:
parent
c5c75d494b
commit
9f77f2741f
1 changed files with 25 additions and 3 deletions
|
@ -545,14 +545,25 @@ int CmdHF14AMfRdBl(const char *Cmd) {
|
|||
uint8_t isOK = resp.arg[0] & 0xff;
|
||||
uint8_t *data = resp.d.asBytes;
|
||||
|
||||
if (isOK)
|
||||
if (isOK) {
|
||||
PrintAndLogEx(NORMAL, "isOk:%02x data:%s", isOK, sprint_hex(data, 16));
|
||||
else
|
||||
} else {
|
||||
PrintAndLogEx(NORMAL, "isOk:%02x", isOK);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mfIsSectorTrailer(blockNo) && (data[6] || data[7] || data[8])) {
|
||||
PrintAndLogEx(NORMAL, "Trailer decoded:");
|
||||
for (int i = 0; i < 4; i++) {
|
||||
PrintAndLogEx(NORMAL, "Access block %d: %s", i + mfFirstBlockOfSector(mfSectorNum(blockNo)), mfGetAccessConditionsDesc(i, &data[6]));
|
||||
}
|
||||
PrintAndLogEx(NORMAL, "UserData: %s", sprint_hex_inrow(&data[9], 1));
|
||||
}
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "Command execute timeout");
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2759,6 +2770,17 @@ int CmdHF14AMfCGetBlk(const char *Cmd) {
|
|||
}
|
||||
|
||||
PrintAndLogEx(NORMAL, "data: %s", sprint_hex(data, sizeof(data)));
|
||||
|
||||
if (mfIsSectorTrailer(blockNo)) {
|
||||
PrintAndLogEx(NORMAL, "Trailer decoded:");
|
||||
PrintAndLogEx(NORMAL, "Key A: %s", sprint_hex_inrow(data, 6));
|
||||
PrintAndLogEx(NORMAL, "Key B: %s", sprint_hex_inrow(&data[10], 6));
|
||||
for (int i = 0; i < 4; i++) {
|
||||
PrintAndLogEx(NORMAL, "Access block %d: %s", i + mfFirstBlockOfSector(mfSectorNum(blockNo)), mfGetAccessConditionsDesc(i, &data[6]));
|
||||
}
|
||||
PrintAndLogEx(NORMAL, "UserData: %s", sprint_hex_inrow(&data[9], 1));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue