X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/623e9da44873b8d7b444b61ce9536efcc35c67c5..0efcb691287836bc0afddfa8f7c595b149909f96:/client/cmdhfmfu.c?ds=inline diff --git a/client/cmdhfmfu.c b/client/cmdhfmfu.c index 25a073d3..81502250 100644 --- a/client/cmdhfmfu.c +++ b/client/cmdhfmfu.c @@ -7,8 +7,16 @@ //----------------------------------------------------------------------------- // High frequency MIFARE ULTRALIGHT (C) commands //----------------------------------------------------------------------------- -#include "loclass/des.h" + #include "cmdhfmfu.h" + +#include +#include +#include "proxmark3.h" +#include "usb_cmd.h" +#include "cmdmain.h" +#include "ui.h" +#include "loclass/des.h" #include "cmdhfmf.h" #include "cmdhf14a.h" #include "mifare.h" @@ -1230,6 +1238,7 @@ int CmdHF14AMfUDump(const char *Cmd){ bool manualPages = false; uint8_t startPage = 0; char tempStr[50]; + unsigned char cleanASCII[4]; while(param_getchar(Cmd, cmdp) != 0x00) { @@ -1372,7 +1381,7 @@ int CmdHF14AMfUDump(const char *Cmd){ PrintAndLog("---------------------------------"); for (i = 0; i < Pages; ++i) { if ( i < 3 ) { - PrintAndLog("%02d/0x%02X | %s| | ", i+startPage, i+startPage, sprint_hex(data + i * 4, 4)); + PrintAndLog("%3d/0x%02X | %s| | ", i+startPage, i+startPage, sprint_hex(data + i * 4, 4)); continue; } switch(i){ @@ -1419,7 +1428,12 @@ int CmdHF14AMfUDump(const char *Cmd){ case 43: tmplockbit = bit2[9]; break; //auth1 default: break; } - PrintAndLog("%02d/0x%02X | %s| %d | %.4s", i+startPage, i+startPage, sprint_hex(data + i * 4, 4), tmplockbit, data+i*4); + + // convert unprintable characters and line breaks to dots + memcpy(cleanASCII, data+i*4, 4); + clean_ascii(cleanASCII, 4); + + PrintAndLog("%3d/0x%02X | %s| %d | %.4s", i+startPage, i+startPage, sprint_hex(data + i * 4, 4), tmplockbit, cleanASCII); } PrintAndLog("---------------------------------"); @@ -1460,7 +1474,7 @@ int CmdHF14AMfucAuth(const char *Cmd){ //Change key to user defined one if (cmdp == 'k' || cmdp == 'K'){ keyNo = param_get8(Cmd, 1); - if(keyNo > KEYS_3DES_COUNT) + if(keyNo > KEYS_3DES_COUNT-1) errors = true; }