From 9d710943881f2717669bd8b1e71c7b9d8e1198a9 Mon Sep 17 00:00:00 2001
From: caioxmag <caioxmag@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Date: Tue, 6 Sep 2011 09:16:32 +0000
Subject: [PATCH] updates to function hf mf retore1k

---
 client/cmdhfmf.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

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