mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 06:13:51 -07:00
Merge pull request #180 from brianpow/PrintAndLogEx
Add PrintAndLogEx()
This commit is contained in:
commit
3eaddc2b3d
6 changed files with 15 additions and 16 deletions
|
@ -955,7 +955,7 @@ int CmdDetectClockRate(const char *Cmd)
|
||||||
clock = GetPskClock("", true);
|
clock = GetPskClock("", true);
|
||||||
break;
|
break;
|
||||||
default :
|
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;
|
break;
|
||||||
}
|
}
|
||||||
RepaintGraphWindow();
|
RepaintGraphWindow();
|
||||||
|
|
|
@ -553,9 +553,9 @@ bool HF14B_Other_Reader(){
|
||||||
// WaitForResponse(CMD_ACK,&resp);
|
// WaitForResponse(CMD_ACK,&resp);
|
||||||
|
|
||||||
// if (datalen > 2 ) {
|
// if (datalen > 2 ) {
|
||||||
// printandlog ("\n14443-3b tag found:");
|
// PrintAndLogEx(NORMAL, "\n"); PrintAndLogEx(NORMAL, "14443-3b tag found:");
|
||||||
// printandlog ("unknown tag type answered to a 0x000b3f80 command ans:");
|
// PrintAndLogEx(NORMAL, "unknown tag type answered to a 0x000b3f80 command ans:");
|
||||||
// //printandlog ("%s", sprint_hex(data, datalen));
|
// //PrintAndLogEx(NORMAL, "%s", sprint_hex(data, datalen));
|
||||||
// rawclose();
|
// rawclose();
|
||||||
// return true;
|
// return true;
|
||||||
// }
|
// }
|
||||||
|
@ -568,9 +568,9 @@ bool HF14B_Other_Reader(){
|
||||||
// WaitForResponse(CMD_ACK, &resp);
|
// WaitForResponse(CMD_ACK, &resp);
|
||||||
|
|
||||||
// if (datalen > 0) {
|
// if (datalen > 0) {
|
||||||
// PrintAndLog ("\n14443-3b tag found:");
|
// PrintAndLogEx(NORMAL, "\n"); PrintAndLogEx(NORMAL, "14443-3b tag found:");
|
||||||
// PrintAndLog ("Unknown tag type answered to a 0x0A command ans:");
|
// PrintAndLogEx(NORMAL, "Unknown tag type answered to a 0x0A command ans:");
|
||||||
// // PrintAndLog ("%s", sprint_hex(data, datalen));
|
// // PrintAndLogEx(NORMAL, "%s", sprint_hex(data, datalen));
|
||||||
// rawClose();
|
// rawClose();
|
||||||
// return true;
|
// return true;
|
||||||
// }
|
// }
|
||||||
|
@ -583,9 +583,9 @@ bool HF14B_Other_Reader(){
|
||||||
// WaitForResponse(CMD_ACK, &resp);
|
// WaitForResponse(CMD_ACK, &resp);
|
||||||
|
|
||||||
// if (datalen > 0) {
|
// if (datalen > 0) {
|
||||||
// PrintAndLog ("\n14443-3b tag found:");
|
// PrintAndLogEx(NORMAL, "\n"); PrintAndLogEx(NORMAL, "14443-3b tag found:");
|
||||||
// PrintAndLog ("Unknown tag type answered to a 0x0C command ans:");
|
// PrintAndLogEx(NORMAL, "Unknown tag type answered to a 0x0C command ans:");
|
||||||
// PrintAndLog ("%s", sprint_hex(data, datalen));
|
// PrintAndLogEx(NORMAL, "%s", sprint_hex(data, datalen));
|
||||||
// rawClose();
|
// rawClose();
|
||||||
// return true;
|
// return true;
|
||||||
// }
|
// }
|
||||||
|
|
|
@ -376,7 +376,6 @@ void annotateMfDesfire(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize){
|
||||||
pos = pos + 1;
|
pos = pos + 1;
|
||||||
if ( (cmd[0] & 0x04) == 0x04) // nad byte following
|
if ( (cmd[0] & 0x04) == 0x04) // nad byte following
|
||||||
pos = pos + 1;
|
pos = pos + 1;
|
||||||
|
|
||||||
switch ( cmd[pos] ){
|
switch ( cmd[pos] ){
|
||||||
case MFDES_CREATE_APPLICATION :snprintf(exp, size, "CREATE APPLICATION");break;
|
case MFDES_CREATE_APPLICATION :snprintf(exp, size, "CREATE APPLICATION");break;
|
||||||
case MFDES_DELETE_APPLICATION :snprintf(exp, size, "DELETE APPLICATION");break;
|
case MFDES_DELETE_APPLICATION :snprintf(exp, size, "DELETE APPLICATION");break;
|
||||||
|
|
|
@ -840,7 +840,7 @@ int CmdHF14AMfDump(const char *Cmd) {
|
||||||
uint16_t numblocks = FirstBlockOfSector(numSectors - 1) + NumBlocksPerSector(numSectors - 1);
|
uint16_t numblocks = FirstBlockOfSector(numSectors - 1) + NumBlocksPerSector(numSectors - 1);
|
||||||
fwrite(carddata, 1, 16*numblocks, fout);
|
fwrite(carddata, 1, 16*numblocks, fout);
|
||||||
fclose(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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -472,7 +472,7 @@ int CmdLFfskSim(const char *Cmd) {
|
||||||
dataLen = hextobinarray((char *)data, hexData);
|
dataLen = hextobinarray((char *)data, hexData);
|
||||||
|
|
||||||
if (dataLen == 0) errors = true;
|
if (dataLen == 0) errors = true;
|
||||||
if (errors) PrintAndLog ("Error getting hex data");
|
if (errors) PrintAndLogEx(WARNING, "Error getting hex data");
|
||||||
cmdp+=2;
|
cmdp+=2;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -573,7 +573,7 @@ int CmdLFaskSim(const char *Cmd) {
|
||||||
dataLen = hextobinarray((char *)data, hexData);
|
dataLen = hextobinarray((char *)data, hexData);
|
||||||
|
|
||||||
if (dataLen == 0) errors = true;
|
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;
|
cmdp += 2;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -668,7 +668,7 @@ int CmdLFpskSim(const char *Cmd) {
|
||||||
dataLen = hextobinarray((char *)data, hexData);
|
dataLen = hextobinarray((char *)data, hexData);
|
||||||
|
|
||||||
if (dataLen == 0) errors = true;
|
if (dataLen == 0) errors = true;
|
||||||
if (errors) PrintAndLog ("Error getting hex data");
|
if (errors) PrintAndLogEx(WARNING, "Error getting hex data");
|
||||||
cmdp+=2;
|
cmdp+=2;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -578,7 +578,7 @@ int testKeyDiversificationWithMasterkeyTestcases() {
|
||||||
int i;
|
int i;
|
||||||
uint8_t empty[8]={0};
|
uint8_t empty[8]={0};
|
||||||
|
|
||||||
PrintfAndLog("[+} Testing encryption/decryption");
|
PrintfAndLog("[+] Testing encryption/decryption");
|
||||||
|
|
||||||
for (i = 0; memcmp(testcases+i, empty, 8); i++)
|
for (i = 0; memcmp(testcases+i, empty, 8); i++)
|
||||||
error += testDES(testcases[i], ctx_enc, ctx_dec);
|
error += testDES(testcases[i], ctx_enc, ctx_dec);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue