fix #747, 'hf mfu eload' - now detects and converts between plain/old/new mfu binary format

This commit is contained in:
iceman1001
2020-05-24 11:17:11 +02:00
parent a6f76444de
commit e7585b5944
6 changed files with 188 additions and 39 deletions

View File

@@ -2039,6 +2039,7 @@ static int CmdHF14AMfURestore(const char *Cmd) {
bool write_special = false;
bool write_extra = false;
bool read_key = false;
bool verbose = false;
size_t filelen = 0;
FILE *f;
@@ -2087,6 +2088,9 @@ static int CmdHF14AMfURestore(const char *Cmd) {
cmdp++;
read_key = true;
break;
case 'v':
cmdp++;
verbose = true;
default:
PrintAndLogEx(WARNING, "Unknown parameter: " _RED_("'%c'"), param_getchar(Cmd, cmdp));
errors = true;
@@ -2128,10 +2132,9 @@ static int CmdHF14AMfURestore(const char *Cmd) {
return 1;
}
// convert old format to new format, if need
int res = convertOldMfuDump(&dump, &bytes_read);
int res = convert_mfu_dump_format(&dump, &bytes_read, verbose);
if (res != PM3_SUCCESS) {
PrintAndLogEx(WARNING, "Failed convert on load to new Ultralight/NTAG format");
PrintAndLogEx(FAILED, "Failed convert on load to new Ultralight/NTAG format");
free(dump);
return res;
}