Merge pull request #180 from brianpow/PrintAndLogEx

Add PrintAndLogEx()
This commit is contained in:
Iceman 2018-02-22 14:10:27 +01:00 committed by GitHub
commit 3eaddc2b3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 16 deletions

View file

@ -955,7 +955,7 @@ int CmdDetectClockRate(const char *Cmd)
clock = GetPskClock("", true);
break;
default :
PrintAndLog ("Please specify a valid modulation to detect the clock of - see option h for help");
PrintAndLogEx(NORMAL, "Please specify a valid modulation to detect the clock of - see option h for help");
break;
}
RepaintGraphWindow();

View file

@ -553,9 +553,9 @@ bool HF14B_Other_Reader(){
// WaitForResponse(CMD_ACK,&resp);
// if (datalen > 2 ) {
// printandlog ("\n14443-3b tag found:");
// printandlog ("unknown tag type answered to a 0x000b3f80 command ans:");
// //printandlog ("%s", sprint_hex(data, datalen));
// PrintAndLogEx(NORMAL, "\n"); PrintAndLogEx(NORMAL, "14443-3b tag found:");
// PrintAndLogEx(NORMAL, "unknown tag type answered to a 0x000b3f80 command ans:");
// //PrintAndLogEx(NORMAL, "%s", sprint_hex(data, datalen));
// rawclose();
// return true;
// }
@ -568,9 +568,9 @@ bool HF14B_Other_Reader(){
// WaitForResponse(CMD_ACK, &resp);
// if (datalen > 0) {
// PrintAndLog ("\n14443-3b tag found:");
// PrintAndLog ("Unknown tag type answered to a 0x0A command ans:");
// // PrintAndLog ("%s", sprint_hex(data, datalen));
// PrintAndLogEx(NORMAL, "\n"); PrintAndLogEx(NORMAL, "14443-3b tag found:");
// PrintAndLogEx(NORMAL, "Unknown tag type answered to a 0x0A command ans:");
// // PrintAndLogEx(NORMAL, "%s", sprint_hex(data, datalen));
// rawClose();
// return true;
// }
@ -583,9 +583,9 @@ bool HF14B_Other_Reader(){
// WaitForResponse(CMD_ACK, &resp);
// if (datalen > 0) {
// PrintAndLog ("\n14443-3b tag found:");
// PrintAndLog ("Unknown tag type answered to a 0x0C command ans:");
// PrintAndLog ("%s", sprint_hex(data, datalen));
// PrintAndLogEx(NORMAL, "\n"); PrintAndLogEx(NORMAL, "14443-3b tag found:");
// PrintAndLogEx(NORMAL, "Unknown tag type answered to a 0x0C command ans:");
// PrintAndLogEx(NORMAL, "%s", sprint_hex(data, datalen));
// rawClose();
// return true;
// }

View file

@ -376,7 +376,6 @@ void annotateMfDesfire(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize){
pos = pos + 1;
if ( (cmd[0] & 0x04) == 0x04) // nad byte following
pos = pos + 1;
switch ( cmd[pos] ){
case MFDES_CREATE_APPLICATION :snprintf(exp, size, "CREATE APPLICATION");break;
case MFDES_DELETE_APPLICATION :snprintf(exp, size, "DELETE APPLICATION");break;

View file

@ -840,7 +840,7 @@ int CmdHF14AMfDump(const char *Cmd) {
uint16_t numblocks = FirstBlockOfSector(numSectors - 1) + NumBlocksPerSector(numSectors - 1);
fwrite(carddata, 1, 16*numblocks, fout);
fclose(fout);
PrintAndLogEx(NORMAL, "[+} dumped %d blocks (%d bytes) to file %s", numblocks, 16*numblocks, dataFilename);
PrintAndLogEx(SUCCESS, "dumped %d blocks (%d bytes) to file %s", numblocks, 16*numblocks, dataFilename);
}
return 0;
}

View file

@ -472,7 +472,7 @@ int CmdLFfskSim(const char *Cmd) {
dataLen = hextobinarray((char *)data, hexData);
if (dataLen == 0) errors = true;
if (errors) PrintAndLog ("Error getting hex data");
if (errors) PrintAndLogEx(WARNING, "Error getting hex data");
cmdp+=2;
break;
default:
@ -573,7 +573,7 @@ int CmdLFaskSim(const char *Cmd) {
dataLen = hextobinarray((char *)data, hexData);
if (dataLen == 0) errors = true;
if (errors) PrintAndLog ("Error getting hex data, datalen: %d", dataLen);
if (errors) PrintAndLogEx(WARNING, "Error getting hex data, datalen: %d", dataLen);
cmdp += 2;
break;
default:
@ -668,7 +668,7 @@ int CmdLFpskSim(const char *Cmd) {
dataLen = hextobinarray((char *)data, hexData);
if (dataLen == 0) errors = true;
if (errors) PrintAndLog ("Error getting hex data");
if (errors) PrintAndLogEx(WARNING, "Error getting hex data");
cmdp+=2;
break;
default:

View file

@ -578,7 +578,7 @@ int testKeyDiversificationWithMasterkeyTestcases() {
int i;
uint8_t empty[8]={0};
PrintfAndLog("[+} Testing encryption/decryption");
PrintfAndLog("[+] Testing encryption/decryption");
for (i = 0; memcmp(testcases+i, empty, 8); i++)
error += testDES(testcases[i], ctx_enc, ctx_dec);