printandlogex

This commit is contained in:
iceman1001 2020-05-14 16:59:02 +02:00
commit e444640068
5 changed files with 18 additions and 15 deletions

View file

@ -401,7 +401,7 @@ static int CmdHF14ACUIDs(const char *Cmd) {
for (int i = 0; i < n; i++) {
if (kbd_enter_pressed()) {
PrintAndLogEx(WARNING, "\n[!] aborted via keyboard!\n");
PrintAndLogEx(WARNING, "aborted via keyboard!\n");
break;
}

View file

@ -1632,7 +1632,7 @@ static int CmdHFFelicaDumpLite(const char *Cmd) {
printf(".");
fflush(stdout);
if (kbd_enter_pressed()) {
PrintAndLogEx(WARNING, "\n[!] aborted via keyboard!\n");
PrintAndLogEx(WARNING, "aborted via keyboard!\n");
DropField();
return PM3_EOPABORTED;
}

View file

@ -1324,7 +1324,8 @@ static int CmdHFiClassReader_Dump(const char *Cmd) {
printf(".");
fflush(stdout);
if (kbd_enter_pressed()) {
PrintAndLogEx(WARNING, "\n[!] aborted via keyboard!\n");
PrintAndLogEx(NORMAL, "");
PrintAndLogEx(WARNING, "aborted via keyboard!\n");
DropField();
return PM3_EOPABORTED;
}
@ -2470,7 +2471,7 @@ static int CmdHFiClassCheckKeys(const char *Cmd) {
uint8_t timeout = 0;
if (kbd_enter_pressed()) {
PrintAndLogEx(WARNING, "\n[!] Aborted via keyboard!\n");
PrintAndLogEx(WARNING, "Aborted via keyboard!\n");
goto out;
}
@ -2497,10 +2498,12 @@ static int CmdHFiClassCheckKeys(const char *Cmd) {
printf(".");
fflush(stdout);
if (timeout > 120) {
PrintAndLogEx(WARNING, "\nNo response from Proxmark3. Aborting...");
PrintAndLogEx(NORMAL, "");
PrintAndLogEx(WARNING, "No response from Proxmark3. Aborting...");
goto out;
}
}
PrintAndLogEx(NORMAL, "");
found_offset = resp.oldarg[1] & 0xFF;
uint8_t isOK = resp.oldarg[0] & 0xFF;
@ -2509,8 +2512,7 @@ static int CmdHFiClassCheckKeys(const char *Cmd) {
switch (isOK) {
case 1: {
found_debit = true;
PrintAndLogEx(NORMAL, "\n[-] Chunk [%d/%d]: %.1fs [%s] idx [%u] - found key "_YELLOW_("%s")
PrintAndLogEx(INFO, "Chunk [%d/%d]: %.1fs [%s] idx [%u] - found key "_YELLOW_("%s")
, key_offset
, keycount
, (float)(t2 / 1000.0)
@ -2521,7 +2523,7 @@ static int CmdHFiClassCheckKeys(const char *Cmd) {
break;
}
case 0: {
PrintAndLogEx(NORMAL, "\n[-] Chunk [%d/%d] : %.1fs [%s]"
PrintAndLogEx(INFO, "Chunk [%d/%d] : %.1fs [%s]"
, key_offset
, keycount
, (float)(t2 / 1000.0)
@ -2546,7 +2548,7 @@ static int CmdHFiClassCheckKeys(const char *Cmd) {
out:
t1 = msclock() - t1;
PrintAndLogEx(SUCCESS, "\nTime in iclass checkkeys: %.0f seconds\n", (float)t1 / 1000.0);
PrintAndLogEx(SUCCESS, "Time in iclass checkkeys: %.0f seconds\n", (float)t1 / 1000.0);
DropField();
// add to managekeys
@ -2806,7 +2808,7 @@ static void permute(uint8_t *data, uint8_t len, uint8_t *output) {
return;
}
if (len != KEY_SIZE) {
PrintAndLogEx(NORMAL, "[!] wrong key size\n");
PrintAndLogEx(WARNING, "wrong key size\n");
return;
}
for (uint8_t i = 0; i < KEY_SIZE; ++i) {

View file

@ -1240,7 +1240,7 @@ int mfTraceDecode(uint8_t *data_src, int len, bool wantSaveToEmlFile) {
traceCrypto1 = lfsr_recovery64(ks2, ks3);
} else {
PrintAndLogEx(NORMAL, "[!] nested key recovery not implemented!\n");
PrintAndLogEx(WARNING, "nested key recovery not implemented!\n");
//at_enc = bytes_to_num(data, 4);
crypto1_destroy(traceCrypto1);
traceState = TRACE_ERROR;

View file

@ -43,6 +43,7 @@
#include <stdlib.h>
#include "comms.h"
#include "ui.h"
// The windows serial port implementation
#ifdef _WIN32
@ -90,7 +91,7 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
serial_port_windows *sp = calloc(sizeof(serial_port_windows), sizeof(uint8_t));
if (sp == 0) {
printf("[!] UART failed to allocate memory\n");
PrintAndLogEx(WARNING, "UART failed to allocate memory\n");
return INVALID_SERIAL_PORT;
}
// Copy the input "com?" to "\\.\COM?" format
@ -111,14 +112,14 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
sp->dcb.DCBlength = sizeof(DCB);
if (!BuildCommDCBA("baud=115200 parity=N data=8 stop=1", &sp->dcb)) {
uart_close(sp);
printf("[!] UART error cdc setup\n");
PrintAndLogEx(WARNING, "UART error cdc setup\n");
return INVALID_SERIAL_PORT;
}
// Update the active serial port
if (!SetCommState(sp->hPort, &sp->dcb)) {
uart_close(sp);
printf("[!] UART error while setting com state\n");
PrintAndLogEx(WARNING, "UART error while setting com state\n");
return INVALID_SERIAL_PORT;
}
@ -130,7 +131,7 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
speed = 115200;
if (!uart_set_speed(sp, speed)) {
uart_close(sp);
printf("[!] UART error while setting baudrate\n");
PrintAndLogEx(WARNING, "UART error while setting baudrate\n");
return INVALID_SERIAL_PORT;
}
}