mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
Merge pull request #65 from merlokk/merge_trailer
Merge trailer fix and 4k access bits fix
This commit is contained in:
commit
2fb8805ee9
2 changed files with 9 additions and 3 deletions
|
@ -456,7 +456,7 @@ int CmdHFFidoAuthenticate(const char *cmd) {
|
||||||
|
|
||||||
// public key
|
// public key
|
||||||
CLIGetHexWithReturn(8, hdata, &hdatalen);
|
CLIGetHexWithReturn(8, hdata, &hdatalen);
|
||||||
if (hdatalen && hdatalen != 130) {
|
if (hdatalen && hdatalen != 65) {
|
||||||
PrintAndLog("ERROR: public key length must be 65 bytes only.");
|
PrintAndLog("ERROR: public key length must be 65 bytes only.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -554,8 +554,11 @@ int CmdHF14AMfRdBl(const char *Cmd) {
|
||||||
|
|
||||||
if (mfIsSectorTrailer(blockNo) && (data[6] || data[7] || data[8])) {
|
if (mfIsSectorTrailer(blockNo) && (data[6] || data[7] || data[8])) {
|
||||||
PrintAndLogEx(NORMAL, "Trailer decoded:");
|
PrintAndLogEx(NORMAL, "Trailer decoded:");
|
||||||
|
int bln = mfFirstBlockOfSector(mfSectorNum(blockNo));
|
||||||
|
int blinc = (mfNumBlocksPerSector(mfSectorNum(blockNo)) > 4) ? 5 : 1;
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
PrintAndLogEx(NORMAL, "Access block %d: %s", i + mfFirstBlockOfSector(mfSectorNum(blockNo)), mfGetAccessConditionsDesc(i, &data[6]));
|
PrintAndLogEx(NORMAL, "Access block %d%s: %s", bln, ((blinc > 1) && (i < 3) ? "+" : "") , mfGetAccessConditionsDesc(i, &data[6]));
|
||||||
|
bln += blinc;
|
||||||
}
|
}
|
||||||
PrintAndLogEx(NORMAL, "UserData: %s", sprint_hex_inrow(&data[9], 1));
|
PrintAndLogEx(NORMAL, "UserData: %s", sprint_hex_inrow(&data[9], 1));
|
||||||
}
|
}
|
||||||
|
@ -2775,8 +2778,11 @@ int CmdHF14AMfCGetBlk(const char *Cmd) {
|
||||||
PrintAndLogEx(NORMAL, "Trailer decoded:");
|
PrintAndLogEx(NORMAL, "Trailer decoded:");
|
||||||
PrintAndLogEx(NORMAL, "Key A: %s", sprint_hex_inrow(data, 6));
|
PrintAndLogEx(NORMAL, "Key A: %s", sprint_hex_inrow(data, 6));
|
||||||
PrintAndLogEx(NORMAL, "Key B: %s", sprint_hex_inrow(&data[10], 6));
|
PrintAndLogEx(NORMAL, "Key B: %s", sprint_hex_inrow(&data[10], 6));
|
||||||
|
int bln = mfFirstBlockOfSector(mfSectorNum(blockNo));
|
||||||
|
int blinc = (mfNumBlocksPerSector(mfSectorNum(blockNo)) > 4) ? 5 : 1;
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
PrintAndLogEx(NORMAL, "Access block %d: %s", i + mfFirstBlockOfSector(mfSectorNum(blockNo)), mfGetAccessConditionsDesc(i, &data[6]));
|
PrintAndLogEx(NORMAL, "Access block %d%s: %s", bln, ((blinc > 1) && (i < 3) ? "+" : "") , mfGetAccessConditionsDesc(i, &data[6]));
|
||||||
|
bln += blinc;
|
||||||
}
|
}
|
||||||
PrintAndLogEx(NORMAL, "UserData: %s", sprint_hex_inrow(&data[9], 1));
|
PrintAndLogEx(NORMAL, "UserData: %s", sprint_hex_inrow(&data[9], 1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue