From 4e3976bab169a38f2785f45f21ab289a66b4ed36 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sat, 4 Apr 2020 07:22:03 +0200 Subject: [PATCH] textual --- client/cmdhfmf.c | 11 ++++++----- client/fileutils.c | 14 +++++++------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 03245fef6..4c49187ca 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -3751,7 +3751,7 @@ int CmdHF14AMfELoad(const char *Cmd) { return PM3_SUCCESS; } } - PrintAndLogEx(SUCCESS, "Loaded %d blocks from file: " _YELLOW_("%s"), blockNum, filename); + PrintAndLogEx(SUCCESS, "Done"); free(data); return PM3_SUCCESS; } @@ -3835,6 +3835,7 @@ static int CmdHF14AMfECFill(const char *Cmd) { mfc_eload_t payload; payload.sectorcnt = numSectors; payload.keytype = keyType; + clearCommandBuffer(); SendCommandNG(CMD_HF_MIFARE_EML_LOAD, (uint8_t *)&payload, sizeof(payload)); return PM3_SUCCESS; @@ -3842,8 +3843,6 @@ static int CmdHF14AMfECFill(const char *Cmd) { static int CmdHF14AMfEKeyPrn(const char *Cmd) { - char filename[FILE_PATH_SIZE]; - char *fptr = filename; uint8_t sectors_cnt = MIFARE_1K_MAXSECTOR; uint8_t data[16]; uint8_t uid[4]; @@ -3915,6 +3914,8 @@ static int CmdHF14AMfEKeyPrn(const char *Cmd) { // dump the keys if (createDumpFile) { + char filename[FILE_PATH_SIZE] = {0}; + char *fptr = filename; fptr += sprintf(fptr, "hf-mf-"); FillFileNameByUID(fptr + strlen(fptr), uid, "-key", sizeof(uid)); @@ -3981,8 +3982,8 @@ static int CmdHF14AMfCSetUID(const char *Cmd) { return PM3_ESOFT; } - PrintAndLogEx(SUCCESS, "old UID:%s", sprint_hex(oldUid, 4)); - PrintAndLogEx(SUCCESS, "new UID:%s", sprint_hex(uid, 4)); + PrintAndLogEx(SUCCESS, "Old UID : %s", sprint_hex(oldUid, 4)); + PrintAndLogEx(SUCCESS, "New UID : %s", sprint_hex(uid, 4)); return PM3_SUCCESS; } diff --git a/client/fileutils.c b/client/fileutils.c index 3343ebc05..ecf47383f 100644 --- a/client/fileutils.c +++ b/client/fileutils.c @@ -180,7 +180,7 @@ int saveFile(const char *preferredName, const char *suffix, const void *data, si fwrite(data, 1, datalen, f); fflush(f); fclose(f); - PrintAndLogEx(SUCCESS, "saved " _YELLOW_("%zu")" bytes to binary file " _YELLOW_("%s"), datalen, fileName); + PrintAndLogEx(SUCCESS, "saved " _YELLOW_("%zu") "bytes to binary file " _YELLOW_("%s"), datalen, fileName); free(fileName); return PM3_SUCCESS; } @@ -223,7 +223,7 @@ int saveFileEML(const char *preferredName, uint8_t *data, size_t datalen, size_t } fflush(f); fclose(f); - PrintAndLogEx(SUCCESS, "saved " _YELLOW_("%" PRId32)" blocks to text file " _YELLOW_("%s"), blocks, fileName); + PrintAndLogEx(SUCCESS, "saved " _YELLOW_("%" PRId32) "blocks to text file " _YELLOW_("%s"), blocks, fileName); out: free(fileName); @@ -480,7 +480,7 @@ int saveFileWAVE(const char *preferredName, int *data, size_t datalen) { } fclose(wave_file); - PrintAndLogEx(SUCCESS, "saved " _YELLOW_("%zu")" bytes to wave file " _YELLOW_("'%s'"), 2 * datalen, fileName); + PrintAndLogEx(SUCCESS, "saved " _YELLOW_("%zu") "bytes to wave file " _YELLOW_("'%s'"), 2 * datalen, fileName); out: free(fileName); @@ -507,7 +507,7 @@ int saveFilePM3(const char *preferredName, int *data, size_t datalen) { fflush(f); fclose(f); - PrintAndLogEx(SUCCESS, "saved " _YELLOW_("%zu")" bytes to PM3 file " _YELLOW_("'%s'"), datalen, fileName); + PrintAndLogEx(SUCCESS, "saved " _YELLOW_("%zu") "bytes to PM3 file " _YELLOW_("'%s'"), datalen, fileName); out: free(fileName); @@ -606,7 +606,7 @@ int loadFile(const char *preferredName, const char *suffix, void *data, size_t m memcpy((data), dump, bytes_read); free(dump); - PrintAndLogEx(SUCCESS, "loaded %zu bytes from binary file " _YELLOW_("%s"), bytes_read, fileName); + PrintAndLogEx(SUCCESS, "loaded " _YELLOW_("%zu") "bytes from binary file " _YELLOW_("%s"), bytes_read, fileName); *datalen = bytes_read; @@ -662,7 +662,7 @@ int loadFile_safe(const char *preferredName, const char *suffix, void **pdata, s *datalen = bytes_read; - PrintAndLogEx(SUCCESS, "loaded %zu bytes from binary file " _YELLOW_("%s"), bytes_read, preferredName); + PrintAndLogEx(SUCCESS, "loaded " _YELLOW_("%zu") "bytes from binary file " _YELLOW_("%s"), bytes_read, preferredName); return PM3_SUCCESS; } @@ -713,7 +713,7 @@ int loadFileEML(const char *preferredName, void *data, size_t *datalen) { } } fclose(f); - PrintAndLogEx(SUCCESS, "loaded %zu bytes from text file " _YELLOW_("%s"), counter, fileName); + PrintAndLogEx(SUCCESS, "loaded " _YELLOW_("%zu") "bytes from text file " _YELLOW_("%s"), counter, fileName); if (datalen) *datalen = counter;