]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/iclass.c
CHG: 'lf em4x' - the em4x50 demod didn't calc ASKDemod_ext with a refenence bool.
[proxmark3-svn] / armsrc / iclass.c
index c6031562001a9c49cd79472df33b8c794448f845..f5e821cb3a8a3dabc83c9f4454b5c12a2760c7bc 100644 (file)
 //
 //-----------------------------------------------------------------------------
 
-#include "proxmark3.h"
 #include "apps.h"
-#include "util.h"
-#include "string.h"
-#include "common.h"
 #include "cmd.h"
 // Needed for CRC in emulation mode;
 // same construction as in ISO 14443;
@@ -52,7 +48,6 @@
 
 static int timeout = 4096;
 
-
 static int SendIClassAnswer(uint8_t *resp, int respLen, int delay);
 
 //-----------------------------------------------------------------------------
@@ -63,7 +58,7 @@ static struct {
     enum {
         STATE_UNSYNCD,
         STATE_START_OF_COMMUNICATION,
-       STATE_RECEIVING
+               STATE_RECEIVING
     }       state;
     uint16_t    shiftReg;
     int     bitCnt;
@@ -425,6 +420,7 @@ static RAMFUNC int ManchesterDecoding(int v)
                                if(!(Demod.buffer2 & Demod.syncBit) || !(Demod.buffer3 & Demod.syncBit)) {
                                        Demod.state = DEMOD_UNSYNCD;
                                        error = 0x88;
+                                       return FALSE;
                                }
                                
                                // TODO: use this error value to print?  Ask Holiman.
@@ -1986,7 +1982,7 @@ void iClass_Dump(uint8_t blockno, uint8_t numblks) {
 }
 
 bool iClass_WriteBlock_ext(uint8_t blockNo, uint8_t *data) {
-       uint8_t write[] = { ICLASS_CMD_UPDATE, blockNo, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+       uint8_t write[] = { ICLASS_CMD_UPDATE, blockNo, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
        //uint8_t readblockdata[10];
        //write[1] = blockNo;
        memcpy(write+2, data, 12); // data + mac
Impressum, Datenschutz