]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlfindala.c
Merge pull request #600 from marshmellow42/master
[proxmark3-svn] / client / cmdlfindala.c
index de1757e9ee35243a5ae1fab388eec03addc3f55f..0a4f783492b8fd8bdf90a0a8743b7ab3780f454f 100644 (file)
@@ -40,10 +40,16 @@ int CmdIndalaDecode(const char *Cmd) {
        }
        uint8_t invert=0;
        size_t size = DemodBufferLen;
-       int startIdx = indala26decode(DemodBuffer, &size, &invert);
-       if (startIdx < 0 || size > 224) {
-               if (g_debugMode) PrintAndLog("Error2: %i",startIdx);
-               return -1;
+       int startIdx = indala64decode(DemodBuffer, &size, &invert);
+       if (startIdx < 0 || size != 64) {
+               // try 224 indala
+               invert = 0;
+               size = DemodBufferLen;
+               startIdx = indala224decode(DemodBuffer, &size, &invert);
+               if (startIdx < 0 || size != 224) {
+                       if (g_debugMode) PrintAndLog("Error2: %i",startIdx);
+                       return -1;
+               }
        }
        setDemodBuf(DemodBuffer, size, (size_t)startIdx);
        setClockGrid(g_DemodClock, g_DemodStartIdx + (startIdx*g_DemodClock));
@@ -96,8 +102,12 @@ int CmdIndalaDemod(const char *Cmd) {
        uint8_t rawbits[4096];
        int rawbit = 0;
        int worst = 0, worstPos = 0;
-       // PrintAndLog("Expecting a bit less than %d raw bits", GraphTraceLen / 32);
+
+       //clear clock grid and demod plot
+       setClockGrid(0, 0);
+       DemodBufferLen = 0;
        
+       // PrintAndLog("Expecting a bit less than %d raw bits", GraphTraceLen / 32);
        // loop through raw signal - since we know it is psk1 rf/32 fc/2 skip every other value (+=2)
        for (i = 0; i < GraphTraceLen-1; i += 2) {
                count += 1;
Impressum, Datenschutz