Minor bug fixes with help from Holiman.

FIX: sprint_hex, sprint_bin  has better length detection.
FIX: ui.c has removed all c99 array declarations, with malloc
FIX: hfmfmfu.c wrong length in one array caused crashes in CmdHF14AMfURdCard
FIX: cmdlft55xx.c CmdDump has now a correct pwd string.
This commit is contained in:
iceman1001
2014-10-26 21:25:06 +01:00
parent 081151eabb
commit 149aeadaa6
4 changed files with 56 additions and 53 deletions

View File

@@ -306,14 +306,13 @@ int CmdDump(const char *Cmd){
char cmdp = param_getchar(Cmd, 0);
char s[20];
uint8_t pwd[4] = {0x00};
if (strlen(Cmd)>1 || cmdp == 'h' || cmdp == 'H') {
bool hasPwd = ( strlen(Cmd) > 0);
if ( cmdp == 'h' || cmdp == 'H') {
PrintAndLog("Usage: lf t55xx dump <password>");
PrintAndLog(" sample: lf t55xx dump FFFFFFFF");
return 0;
}
bool hasPwd = ( strlen(Cmd) > 0);
if ( hasPwd ){
if (param_gethex(Cmd, 0, pwd, 4)) {
@@ -323,9 +322,9 @@ int CmdDump(const char *Cmd){
}
for ( int i = 0; i <8; ++i){
*s = 0;
memset(s,0,sizeof(s));
if ( hasPwd ) {
sprintf(s,"%d %d", i, pwd);
sprintf(s,"%d %s", i, sprint_hex(pwd,4));
CmdReadBlkPWD(s);
} else {
sprintf(s,"%d", i);