X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/d216a5711bfb91d589b0aee5b798660cbb04abc4..aa9b584f5c3050e4f186f12c097219814422b19b:/client/cmdlfem4x.c

diff --git a/client/cmdlfem4x.c b/client/cmdlfem4x.c
index 89f68171..59a1eef3 100644
--- a/client/cmdlfem4x.c
+++ b/client/cmdlfem4x.c
@@ -14,6 +14,20 @@ uint64_t g_em410xid = 0;
 
 static int CmdHelp(const char *Cmd);
 
+int usage_lf_em410x_sim(void) {
+	PrintAndLog("Simulating EM410x tag");
+	PrintAndLog("");
+	PrintAndLog("Usage:  lf em 410xsim [h] <uid> <clock>");
+	PrintAndLog("Options:");
+	PrintAndLog("       h         - this help");
+	PrintAndLog("       uid       - uid (10 HEX symbols)");
+	PrintAndLog("       clock     - clock (32|64) (optional)");
+	PrintAndLog("samples:");
+	PrintAndLog("      lf em 410xsim 0F0368568B");
+	PrintAndLog("      lf em 410xsim 0F0368568B 32");
+	return 0;
+}
+
 int CmdEMdemodASK(const char *Cmd)
 {
 	char cmdp = param_getchar(Cmd, 0);
@@ -37,31 +51,12 @@ int CmdEM410xRead(const char *Cmd)
 	uint64_t lo = 0;
 
 	if(!AskEm410xDemod("", &hi, &lo, false)) return 0;
-	if (hi)
-		PrintAndLog ("EM410x XL pattern found");
-	else
- 		PrintAndLog("EM410x pattern found: ");
 
 	printEM410x(hi, lo);
 	g_em410xid = lo;
 	return 1;
 }
 
-
-int usage_lf_em410x_sim(void) {
-	PrintAndLog("Simulating EM410x tag");
-	PrintAndLog("");
-	PrintAndLog("Usage:  lf em 410xsim [h] <uid> <clock>");
-	PrintAndLog("Options:");
-	PrintAndLog("       h         - this help");
-	PrintAndLog("       uid       - uid (10 HEX symbols)");
-	PrintAndLog("       clock     - clock (32|64) (optional)");
-	PrintAndLog("samples:");
-	PrintAndLog("      lf em 410xsim 0F0368568B");
-	PrintAndLog("      lf em 410xsim 0F0368568B 32");
-	return 0;
-}
-
 // emulate an EM410X tag
 int CmdEM410xSim(const char *Cmd)
 {
@@ -448,7 +443,7 @@ int EM4x50Read(const char *Cmd, bool verbose) {
 			}
 		}
 		if (!clk) {
-			PrintAndLog("ERROR: EM4x50 - didn't find a clock");
+			if (verbose || g_debugMode) PrintAndLog("ERROR: EM4x50 - didn't find a clock");
 			return 0;
 		}
 	} else tol = clk/8;
@@ -802,7 +797,7 @@ int EM4x05ReadWord_ext(uint8_t addr, uint32_t pwd, bool usePwd, uint32_t *word)
 	}
 	int testLen = (GraphTraceLen < 1000) ? GraphTraceLen : 1000;
 	if (graphJustNoise(GraphBuffer, testLen)) {
-		PrintAndLog("no tag not found");
+		PrintAndLog("no tag found");
 		return -1;
 	}
 	return demodEM4x05resp(word);
@@ -889,7 +884,7 @@ int CmdEM4x05Write(const char *Cmd) {
 		PrintAndLog("Address must be between 0 and 15");
 		return 1;
 	}
-	if ( pwd == -1 )
+	if ( pwd == 1 )
 		PrintAndLog("Writing address %d data %08X", addr, data);	
 	else {
 		usePwd = true;
@@ -986,6 +981,7 @@ void printEM4x05info(uint32_t block0, uint32_t serial) {
 	
 	switch (chipType) {
 		case 9:  PrintAndLog("\n Chip Type:   %u | EM4305", chipType); break;
+		case 8:  PrintAndLog("\n Chip Type:   %u | EM4205", chipType); break;
 		case 4:  PrintAndLog(" Chip Type:   %u | Unknown", chipType); break;
 		case 2:  PrintAndLog(" Chip Type:   %u | EM4469", chipType); break;
 		//add more here when known