]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlffdx.c
fixing the crash on exit
[proxmark3-svn] / client / cmdlffdx.c
index 69c3c4830b49c5979b72a94541d2ca122bb8f324..234db59fbb2583a2ff2bd27879abb5bb7d16db14 100644 (file)
@@ -5,11 +5,14 @@
 // the license.
 //-----------------------------------------------------------------------------
 // Low frequency fdx-b tag commands
 // the license.
 //-----------------------------------------------------------------------------
 // Low frequency fdx-b tag commands
+// Differential Biphase, rf/32, 128 bits (known)
 //-----------------------------------------------------------------------------
 
 #include "cmdlffdx.h"
 
 //-----------------------------------------------------------------------------
 
 #include "cmdlffdx.h"
 
+#include <stdio.h>
 #include <inttypes.h>
 #include <inttypes.h>
+#include <string.h>
 #include "proxmark3.h"
 #include "ui.h"         // for PrintAndLog
 #include "util.h"
 #include "proxmark3.h"
 #include "ui.h"         // for PrintAndLog
 #include "util.h"
@@ -134,7 +137,7 @@ int CmdFdxDemod(const char *Cmd){
 
        //Differential Biphase / di-phase (inverted biphase)
        //get binary from ask wave
 
        //Differential Biphase / di-phase (inverted biphase)
        //get binary from ask wave
-       if (!ASKbiphaseDemod("0 32 1 0", FALSE)) {
+       if (!ASKbiphaseDemod("0 32 1 0", false)) {
                if (g_debugMode) PrintAndLog("DEBUG: Error - FDX-B ASKbiphaseDemod failed");
                return 0;
        }
                if (g_debugMode) PrintAndLog("DEBUG: Error - FDX-B ASKbiphaseDemod failed");
                return 0;
        }
@@ -156,6 +159,8 @@ int CmdFdxDemod(const char *Cmd){
 
        // set and leave DemodBuffer intact
        setDemodBuf(DemodBuffer, 128, preambleIndex);
 
        // set and leave DemodBuffer intact
        setDemodBuf(DemodBuffer, 128, preambleIndex);
+       setClockGrid(g_DemodClock, g_DemodStartIdx + (preambleIndex*g_DemodClock));
+
        uint8_t bits_no_spacer[117];
        memcpy(bits_no_spacer, DemodBuffer + 11, 117);
 
        uint8_t bits_no_spacer[117];
        memcpy(bits_no_spacer, DemodBuffer + 11, 117);
 
@@ -201,8 +206,7 @@ int CmdFdxDemod(const char *Cmd){
 }
 
 int CmdFdxRead(const char *Cmd) {
 }
 
 int CmdFdxRead(const char *Cmd) {
-       CmdLFRead("s");
-       getSamples("10000", TRUE);
+       lf_read(true, 10000);
        return CmdFdxDemod(Cmd);
 }
 
        return CmdFdxDemod(Cmd);
 }
 
Impressum, Datenschutz