]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlfem4x.c
added data psk* cmds for pskdemod
[proxmark3-svn] / client / cmdlfem4x.c
index 287083e8743d233bb382956ead9453553177a027..f29da8e0735be59f3f1edb2c2899f9777880f913 100644 (file)
 
 static int CmdHelp(const char *Cmd);
 
+
+
+int CmdEMdemodASK(const char *Cmd)
+{
+  int findone=0;
+  UsbCommand c={CMD_EM410X_DEMOD};
+  if(Cmd[0]=='1') findone=1;
+  c.arg[0]=findone;
+  SendCommand(&c);
+  return 0;
+}
+
+
+
 /* Read the ID of an EM410x tag.
  * Format:
  *   1111 1111 1           <-- standard non-repeatable header
@@ -102,7 +116,7 @@ retest:
       {
         /* Read another byte! */
         sprintf(id+rows, "%x", (8 * BitStream[i]) + (4 * BitStream[i+1]) + (2 * BitStream[i+2]) + (1 * BitStream[i+3]));
-        sprintf(id+rows, "%x", (8 * BitStream[i+3]) + (4 * BitStream[i+2]) + (2 * BitStream[i+1]) + (1 * BitStream[i]));
+        sprintf(id2+rows, "%x", (8 * BitStream[i+3]) + (4 * BitStream[i+2]) + (2 * BitStream[i+1]) + (1 * BitStream[i]));
         rows++;
 
         /* Keep parity info */
@@ -137,7 +151,7 @@ retest:
       {
         /* Sweet! */
         PrintAndLog("EM410x Tag ID: %s", id);
-        PrintAndLog("Unique Tag ID: %s", id);
+        PrintAndLog("Unique Tag ID: %s", id2);
 
         /* Stop any loops */
         return 1;
@@ -319,7 +333,7 @@ int CmdEM4x50Read(const char *Cmd)
       ++i;
     while ((GraphBuffer[i] > low) && (i<GraphTraceLen))
       ++i;
-    if (j>(MAX_GRAPH_TRACE_LEN/64)) {
+    if (j>=(MAX_GRAPH_TRACE_LEN/64)) {
       break;
     }
     tmpbuff[j++]= i - start;
@@ -581,6 +595,7 @@ int CmdWriteWordPWD(const char *Cmd)
 static command_t CommandTable[] =
 {
   {"help", CmdHelp, 1, "This help"},
+  {"em410xdemod", CmdEMdemodASK, 0, "[findone] -- Extract ID from EM410x tag (option 0 for continuous loop, 1 for only 1 tag)"},  
   {"em410xread", CmdEM410xRead, 1, "[clock rate] -- Extract ID from EM410x tag"},
   {"em410xsim", CmdEM410xSim, 0, "<UID> -- Simulate EM410x tag"},
   {"em410xwatch", CmdEM410xWatch, 0, "['h'] -- Watches for EM410x 125/134 kHz tags (option 'h' for 134)"},
Impressum, Datenschutz