]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlfem4x.c
CHG: modified cmdlf.c - CmdLFfind with a parameter to accept traces loaded with...
[proxmark3-svn] / client / cmdlfem4x.c
index 07f909ac392ae272761ae9535b93a3cd99953044..6567ee41014698b15f6b21ec9b7fed73cf588544 100644 (file)
@@ -28,6 +28,20 @@ char *global_em410xId;
 
 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
@@ -196,15 +210,15 @@ retest:
  */
 int CmdEM410xSim(const char *Cmd)
 {      
-       int i, n, j, h, binary[4], parity[4];
+       int i, n, j, binary[4], parity[4];
 
        char cmdp = param_getchar(Cmd, 0);
        uint8_t uid[5] = {0x00};
 
        if (cmdp == 'h' || cmdp == 'H') {
-               PrintAndLog("Usage:  lf em4x sim <UID>");
+               PrintAndLog("Usage:  lf em4x 410xsim <UID>");
                PrintAndLog("");
-               PrintAndLog("     sample: lf em4x sim 0F0368568B");
+               PrintAndLog("     sample: lf em4x 410xsim 0F0368568B");
                return 0;
        }
 
@@ -222,9 +236,6 @@ int CmdEM410xSim(const char *Cmd)
   /* clear our graph */
   ClearGraph(0);
   
-  /* write it out a few times */
-  //for (h = 0; h < 4; h++)
-  //{
     /* write 9 start bits */
     for (i = 0; i < 9; i++)
       AppendGraph(0, clock, 1);
@@ -260,17 +271,10 @@ int CmdEM410xSim(const char *Cmd)
     AppendGraph(0, clock, parity[2]);
     AppendGraph(0, clock, parity[3]);
 
-    /* stop bit */
-    AppendGraph(0, clock, 0);
-  //}
-
-  /* modulate that biatch */
-  //CmdManchesterMod("64");
-
-  /* booyah! */
-  RepaintGraphWindow();
-  
-  CmdLFSim("");
+  /* stop bit */
+  AppendGraph(1, clock, 0);
+  CmdLFSim("240"); //240 start_gap.
   return 0;
 }
 
@@ -654,7 +658,7 @@ int CmdWriteWordPWD(const char *Cmd)
 static command_t CommandTable[] =
 {
   {"help", CmdHelp, 1, "This help"},
-  
+  {"410xdemod", CmdEMdemodASK, 0, "[clock rate] -- Extract ID from EM410x tag"},    
   {"410xread", CmdEM410xRead, 1, "[clock rate] -- Extract ID from EM410x tag"},
   {"410xsim", CmdEM410xSim, 0, "<UID> -- Simulate EM410x tag"},
   {"replay",  MWRem4xReplay, 0, "Watches for tag and simulates manchester encoded em4x tag"},
Impressum, Datenschutz