]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
updates to function hf mf retore1k
authorcaioxmag <caioxmag@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Tue, 6 Sep 2011 09:16:32 +0000 (09:16 +0000)
committercaioxmag <caioxmag@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Tue, 6 Sep 2011 09:16:32 +0000 (09:16 +0000)
client/cmdhfmf.c

index 9bfa055bcdd4d7781fb71fcd944f8def006827d6..051f414b6653877e428b1926500c5ea050834e46 100644 (file)
@@ -403,6 +403,8 @@ int CmdHF14AMfRestore1k(const char *Cmd)
        FILE *fdump;\r
        FILE *fkeys;\r
        \r
        FILE *fdump;\r
        FILE *fkeys;\r
        \r
+       char c;\r
+       \r
        if ((fdump = fopen("dumpdata.bin","rb")) == NULL) {\r
                PrintAndLog("Could not find file dump.bin");\r
                return 1;\r
        if ((fdump = fopen("dumpdata.bin","rb")) == NULL) {\r
                PrintAndLog("Could not find file dump.bin");\r
                return 1;\r
@@ -419,7 +421,7 @@ int CmdHF14AMfRestore1k(const char *Cmd)
                fread(keyB[i], 1, 6, fkeys);\r
        }\r
        \r
                fread(keyB[i], 1, 6, fkeys);\r
        }\r
        \r
-       PrintAndLog("going...");\r
+       PrintAndLog("Restoring dumpdata.bin to card");\r
 \r
        for (i=0 ; i<16 ; i++) {\r
                for( j=0 ; j<4 ; j++) {\r
 \r
        for (i=0 ; i<16 ; i++) {\r
                for( j=0 ; j<4 ; j++) {\r
@@ -443,7 +445,13 @@ int CmdHF14AMfRestore1k(const char *Cmd)
                                bldata[15] = (keyB[i][5]);\r
                        }               \r
                        \r
                                bldata[15] = (keyB[i][5]);\r
                        }               \r
                        \r
-                       PrintAndLog("writing to block %2d: %s confirm?", i*4+j, sprint_hex(bldata, 16));\r
+                       PrintAndLog("Writing to block %2d: %s Confirm? [Y,N]", i*4+j, sprint_hex(bldata, 16));\r
+                       \r
+                       scanf("%c",&c);\r
+                       if ((c != 'y') || (c != 'Y')){\r
+                               PrintAndLog("Aborting !");\r
+                               return 1;\r
+                       }\r
                        \r
                        memcpy(c.d.asBytes + 10, bldata, 16);\r
                        SendCommand(&c);\r
                        \r
                        memcpy(c.d.asBytes + 10, bldata, 16);\r
                        SendCommand(&c);\r
Impressum, Datenschutz