]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/mifaresniff.c
hf mf eset: reuse mfEmlSetMem().
[proxmark3-svn] / armsrc / mifaresniff.c
index 3929561e1f1b09cc713ff2dcfb8353f6c02eb7af..4e573be7dc9c630b6f6ec7c3b7ef21c351eafc3e 100644 (file)
@@ -60,9 +60,16 @@ bool RAMFUNC MfSniffLogic(const uint8_t *data, uint16_t len, uint8_t *parity, ui
                                memset(sniffATQA, 0x00, 2);
                                sniffSAK = 0;
                                sniffState = SNF_ATQA;
+                               if (data[0] == 0x40) 
+                                       sniffState = SNF_MAGIC_WUPC2;
                        }
                        break;
                }
+               case SNF_MAGIC_WUPC2:
+                       if ((len == 1) && (reader) && (data[0] == 0x43) ) {  
+                               sniffState = SNF_CARD_IDLE;
+                       }
+                       break;
                case SNF_ATQA:{
                        if ((!reader) && (len == 2)) {          // ATQA from tag
                                memcpy(sniffATQA, data, 2);
@@ -71,22 +78,12 @@ bool RAMFUNC MfSniffLogic(const uint8_t *data, uint16_t len, uint8_t *parity, ui
                        break;
                }
                case SNF_UID1:{\r
-                       if ((reader) && (len == 2) && (data[0] == 0x93) && (data[1] == 0x20)) { // Select ALL from reader
-                               sniffState = SNF_ANTICOL1;
-                       }\r
-                       \r
                        if ((reader) && (len == 9) && (data[0] == 0x93) && (data[1] == 0x70) && (CheckCrc14443(CRC_14443_A, data, 9))) {   // Select 4 Byte UID from reader\r
                                memcpy(sniffUID + 3, &data[2], 4);\r
                                sniffState = SNF_SAK;\r
                        }\r
                        break;
                }\r
-               case SNF_ANTICOL1:{
-                       if ((!reader) && (len == 5) && ((data[0] ^ data[1] ^ data[2] ^ data[3]) == data[4])) {  // UID from tag (CL1) 
-                               sniffState = SNF_UID1;
-                       }
-                       break;
-               }
                case SNF_SAK:{
                        if ((!reader) && (len == 3) && (CheckCrc14443(CRC_14443_A, data, 3))) { // SAK from card?
                                sniffSAK = data[0];
@@ -100,17 +97,7 @@ bool RAMFUNC MfSniffLogic(const uint8_t *data, uint16_t len, uint8_t *parity, ui
                        }
                        break;
                }
-               case SNF_ANTICOL2:{
-                       if ((!reader) && (len == 5) && ((data[0] ^ data[1] ^ data[2] ^ data[3]) == data[4])) { // CL2 UID 
-                               sniffState = SNF_UID2;
-                       }
-                       break;
-               }
                case SNF_UID2:{\r
-                       if ((reader) && (len == 2) && (data[0] == 0x95) && (data[1] == 0x20)) {\r
-                               sniffState = SNF_ANTICOL2;\r
-                       }\r
-                       \r
                        if ((reader) && (len == 9) && (data[0] == 0x95) && (data[1] == 0x70) && (CheckCrc14443(CRC_14443_A, data, 9))) {\r
                                memcpy(sniffUID + 3, &data[2], 4);\r
                                sniffState = SNF_SAK;\r
Impressum, Datenschutz