From 5ff9150e3bfecdeee84fcabcc712ef595c33d2d6 Mon Sep 17 00:00:00 2001 From: caioxmag Date: Wed, 31 Aug 2011 07:09:50 +0000 Subject: [PATCH] Corrected some errors from r487, WHICH I FORGOT TO COMMENT. Log for r487 should have been: "added hf mf dump1k and hf mf restore1k functions" "modified hf mf nested function to add option to create dumpkeys.bin file from its output" --- client/cmdhfmf.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 742b7b3b..ed3394e5 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -381,20 +381,15 @@ int CmdHF14AMfRestore1k(const char *Cmd) { int i,j; - uint8_t blockNo = 0; uint8_t keyType = 0; uint8_t key[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; uint8_t bldata[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; uint8_t keyA[16][6]; uint8_t keyB[16][6]; - char cmdp = 0x00; - FILE *fdump; FILE *fkeys; - FILE *fdebug = fopen("debug.bin","wb"); - if ((fdump = fopen("dumpdata.bin","rb")) == NULL) { PrintAndLog("Could not find file dump.bin"); return 1; @@ -641,15 +636,15 @@ int CmdHF14AMfNested(const char *Cmd) if (createDumpFile) { if ((fkeys = fopen("dumpkeys.bin","wb")) == NULL) { - rintAndLog("Could not create file keys.bin"); + PrintAndLog("Could not create file keys.bin"); free(e_sector); return 1; } for(i=0; i<16; i++) { - fwrite ( e_sector[i].Key[0], sizeof(e_sector[i].Key[0]), 1, fkeys ); + fwrite ( e_sector[i].Key, sizeof(e_sector[i].Key[0]), 1, fkeys ); } for(i=0; i<16; i++) { - fwrite ( e_sector[i].Key[1], sizeof(e_sector[i].Key[1]), 1, fkeys ); + fwrite ( e_sector[i].Key, sizeof(e_sector[i].Key[1]), 1, fkeys ); } fclose(fkeys); } -- 2.39.5