hf iclass chk , textual

This commit is contained in:
iceman1001 2020-08-18 11:11:43 +02:00
commit 1689a73101

View file

@ -2997,11 +2997,11 @@ static int CmdHFiClassCheckKeys(const char *Cmd) {
PrintAndLogEx(SUCCESS, " CSN: " _GREEN_("%s"), sprint_hex(CSN, sizeof(CSN))); PrintAndLogEx(SUCCESS, " CSN: " _GREEN_("%s"), sprint_hex(CSN, sizeof(CSN)));
PrintAndLogEx(SUCCESS, " CCNR: " _GREEN_("%s"), sprint_hex(CCNR, sizeof(CCNR))); PrintAndLogEx(SUCCESS, " CCNR: " _GREEN_("%s"), sprint_hex(CCNR, sizeof(CCNR)));
PrintAndLogEx(SUCCESS, "Generating diversified keys..."); PrintAndLogEx(SUCCESS, "Generating diversified keys %s", (use_elite || use_raw) ? NOLF : "");
if (use_elite) if (use_elite)
PrintAndLogEx(SUCCESS, "Using " _YELLOW_("elite algo")); PrintAndLogEx(NORMAL, "using " _YELLOW_("elite algo"));
if (use_raw) if (use_raw)
PrintAndLogEx(SUCCESS, "Using " _YELLOW_("raw mode")); PrintAndLogEx(NORMAL, "using " _YELLOW_("raw mode"));
GenerateMacFrom(CSN, CCNR, use_raw, use_elite, keyBlock, keycount, pre); GenerateMacFrom(CSN, CCNR, use_raw, use_elite, keyBlock, keycount, pre);
@ -3024,7 +3024,8 @@ static int CmdHFiClassCheckKeys(const char *Cmd) {
uint8_t timeout = 0; uint8_t timeout = 0;
if (kbd_enter_pressed()) { if (kbd_enter_pressed()) {
PrintAndLogEx(WARNING, "Aborted via keyboard!\n"); PrintAndLogEx(NORMAL, "");
PrintAndLogEx(WARNING, "Aborted via keyboard!");
goto out; goto out;
} }
@ -3069,13 +3070,14 @@ static int CmdHFiClassCheckKeys(const char *Cmd) {
switch (isOK) { switch (isOK) {
case 1: { case 1: {
found_key = true; found_key = true;
PrintAndLogEx(NORMAL, "");
PrintAndLogEx(SUCCESS, "Found valid key " _GREEN_("%s") PrintAndLogEx(SUCCESS, "Found valid key " _GREEN_("%s")
, sprint_hex(keyBlock + (key_offset + found_offset) * 8, 8) , sprint_hex(keyBlock + (key_offset + found_offset) * 8, 8)
); );
break; break;
} }
case 0: { case 0: {
PrintAndLogEx(INFO, "Chunk [%d/%d] : %.1fs - no luck" PrintAndLogEx(INPLACE, "Chunk [%d/%d] : %.1fs - no luck"
, key_offset , key_offset
, keycount , keycount
, (float)(t2 / 1000.0) , (float)(t2 / 1000.0)
@ -3084,8 +3086,9 @@ static int CmdHFiClassCheckKeys(const char *Cmd) {
} }
case 99: { case 99: {
} }
default: default: {
break; break;
}
} }
// both keys found. // both keys found.
@ -3098,7 +3101,8 @@ static int CmdHFiClassCheckKeys(const char *Cmd) {
out: out:
t1 = msclock() - t1; t1 = msclock() - t1;
PrintAndLogEx(SUCCESS, "Time in iclass chk: " _YELLOW_("%.0f") " seconds\n", (float)t1 / 1000.0); PrintAndLogEx(NORMAL, "");
PrintAndLogEx(SUCCESS, "Time in iclass chk: " _YELLOW_("%.0f") " seconds", (float)t1 / 1000.0);
DropField(); DropField();
if (found_key) { if (found_key) {