mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 06:13:51 -07:00
changed the key table output. In some cases it didnt print non found keys red
This commit is contained in:
parent
6fe3263576
commit
94b0bcc758
1 changed files with 44 additions and 46 deletions
|
@ -2861,6 +2861,9 @@ tryNested:
|
||||||
}
|
}
|
||||||
case PM3_ESTATIC_NONCE:
|
case PM3_ESTATIC_NONCE:
|
||||||
PrintAndLogEx(ERR, "Error: Static encrypted nonce detected. Aborted\n");
|
PrintAndLogEx(ERR, "Error: Static encrypted nonce detected. Aborted\n");
|
||||||
|
|
||||||
|
e_sector[current_sector_i].Key[current_key_type_i] = 0xffffffffffff;;
|
||||||
|
e_sector[current_sector_i].foundKey[current_key_type_i] = false;
|
||||||
// Show the results to the user
|
// Show the results to the user
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
PrintAndLogEx(SUCCESS, _GREEN_("found keys:"));
|
PrintAndLogEx(SUCCESS, _GREEN_("found keys:"));
|
||||||
|
@ -2907,6 +2910,10 @@ tryHardnested: // If the nested attack fails then we try the hardnested attack
|
||||||
}
|
}
|
||||||
case PM3_ESTATIC_NONCE: {
|
case PM3_ESTATIC_NONCE: {
|
||||||
PrintAndLogEx(ERR, "\nError: Static encrypted nonce detected. Aborted\n");
|
PrintAndLogEx(ERR, "\nError: Static encrypted nonce detected. Aborted\n");
|
||||||
|
|
||||||
|
e_sector[current_sector_i].Key[current_key_type_i] = 0xffffffffffff;;
|
||||||
|
e_sector[current_sector_i].foundKey[current_key_type_i] = false;
|
||||||
|
|
||||||
// Show the results to the user
|
// Show the results to the user
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
PrintAndLogEx(SUCCESS, _GREEN_("found keys:"));
|
PrintAndLogEx(SUCCESS, _GREEN_("found keys:"));
|
||||||
|
@ -3899,34 +3906,17 @@ void printKeyTableEx(uint8_t sectorscnt, sector_t *e_sector, uint8_t start_secto
|
||||||
PrintAndLogEx(SUCCESS, "-----+-----+--------------+---+--------------+----");
|
PrintAndLogEx(SUCCESS, "-----+-----+--------------+---+--------------+----");
|
||||||
PrintAndLogEx(SUCCESS, " Sec | Blk | key A |res| key B |res");
|
PrintAndLogEx(SUCCESS, " Sec | Blk | key A |res| key B |res");
|
||||||
PrintAndLogEx(SUCCESS, "-----+-----+--------------+---+--------------+----");
|
PrintAndLogEx(SUCCESS, "-----+-----+--------------+---+--------------+----");
|
||||||
|
|
||||||
|
bool extended_legend = false;
|
||||||
for (uint8_t i = 0; i < sectorscnt; i++) {
|
for (uint8_t i = 0; i < sectorscnt; i++) {
|
||||||
|
|
||||||
snprintf(strA, sizeof(strA), "------------");
|
if ((e_sector[i].foundKey[0] > 1) || (e_sector[i].foundKey[1] > 1)) {
|
||||||
snprintf(strB, sizeof(strB), "------------");
|
extended_legend = true;
|
||||||
|
}
|
||||||
if (e_sector[i].foundKey[0])
|
|
||||||
snprintf(strA, sizeof(strA), "%012" PRIX64, e_sector[i].Key[0]);
|
|
||||||
|
|
||||||
if (e_sector[i].foundKey[1])
|
|
||||||
snprintf(strB, sizeof(strB), "%012" PRIX64, e_sector[i].Key[1]);
|
|
||||||
|
|
||||||
if (e_sector[i].foundKey[0] > 1) {
|
|
||||||
PrintAndLogEx(SUCCESS, " "_YELLOW_("%03d")" | %03d | " _GREEN_("%s")" | " _BRIGHT_GREEN_("%c")" | " _GREEN_("%s")" | " _BRIGHT_GREEN_("%c")
|
|
||||||
, i
|
|
||||||
, mfSectorTrailerOfSector(i)
|
|
||||||
, strA, e_sector[i].foundKey[0]
|
|
||||||
, strB, e_sector[i].foundKey[1]
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// keep track if we use start_sector or i...
|
|
||||||
uint8_t s = start_sector;
|
|
||||||
if (start_sector == 0)
|
|
||||||
s = i;
|
|
||||||
|
|
||||||
if (e_sector[i].foundKey[0]) {
|
if (e_sector[i].foundKey[0]) {
|
||||||
snprintf(strA, sizeof(strA), _GREEN_("%012" PRIX64), e_sector[i].Key[0]);
|
snprintf(strA, sizeof(strA), _GREEN_("%012" PRIX64), e_sector[i].Key[0]);
|
||||||
snprintf(resA, sizeof(resA), _BRIGHT_GREEN_("%d"), 1);
|
snprintf(resA, sizeof(resA), _BRIGHT_GREEN_("%c"), e_sector[i].foundKey[0]);
|
||||||
} else {
|
} else {
|
||||||
snprintf(strA, sizeof(strA), _RED_("%s"), "------------");
|
snprintf(strA, sizeof(strA), _RED_("%s"), "------------");
|
||||||
snprintf(resA, sizeof(resA), _RED_("%d"), 0);
|
snprintf(resA, sizeof(resA), _RED_("%d"), 0);
|
||||||
|
@ -3934,12 +3924,19 @@ void printKeyTableEx(uint8_t sectorscnt, sector_t *e_sector, uint8_t start_secto
|
||||||
|
|
||||||
if (e_sector[i].foundKey[1]) {
|
if (e_sector[i].foundKey[1]) {
|
||||||
snprintf(strB, sizeof(strB), _GREEN_("%012" PRIX64), e_sector[i].Key[1]);
|
snprintf(strB, sizeof(strB), _GREEN_("%012" PRIX64), e_sector[i].Key[1]);
|
||||||
snprintf(resB, sizeof(resB), _BRIGHT_GREEN_("%d"), 1);
|
snprintf(resB, sizeof(resB), _BRIGHT_GREEN_("%c"), e_sector[i].foundKey[1]);
|
||||||
} else {
|
} else {
|
||||||
snprintf(strB, sizeof(strB), _RED_("%s"), "------------");
|
snprintf(strB, sizeof(strB), _RED_("%s"), "------------");
|
||||||
snprintf(resB, sizeof(resB), _RED_("%d"), 0);
|
snprintf(resB, sizeof(resB), _RED_("%d"), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// keep track if we use start_sector or i
|
||||||
|
// show one sector or all.
|
||||||
|
uint8_t s = start_sector;
|
||||||
|
if (start_sector == 0) {
|
||||||
|
s = i;
|
||||||
|
}
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, " " _YELLOW_("%03d") " | %03d | %s | %s | %s | %s"
|
PrintAndLogEx(SUCCESS, " " _YELLOW_("%03d") " | %03d | %s | %s | %s | %s"
|
||||||
, s
|
, s
|
||||||
, mfSectorTrailerOfSector(s)
|
, mfSectorTrailerOfSector(s)
|
||||||
|
@ -3947,9 +3944,10 @@ void printKeyTableEx(uint8_t sectorscnt, sector_t *e_sector, uint8_t start_secto
|
||||||
, strB, resB
|
, strB, resB
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
PrintAndLogEx(SUCCESS, "-----+-----+--------------+---+--------------+----");
|
PrintAndLogEx(SUCCESS, "-----+-----+--------------+---+--------------+----");
|
||||||
if (e_sector[0].foundKey[0] > 1) {
|
|
||||||
|
if (extended_legend) {
|
||||||
PrintAndLogEx(INFO, "( "
|
PrintAndLogEx(INFO, "( "
|
||||||
_YELLOW_("D") ":Dictionary / "
|
_YELLOW_("D") ":Dictionary / "
|
||||||
_YELLOW_("S") ":darkSide / "
|
_YELLOW_("S") ":darkSide / "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue