]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
`hf mf sniff` small fix
authormerlokk <olegmsn@gmail.com>
Tue, 16 Jan 2018 12:34:04 +0000 (14:34 +0200)
committermerlokk <olegmsn@gmail.com>
Tue, 16 Jan 2018 12:34:04 +0000 (14:34 +0200)
armsrc/iso14443a.c
armsrc/mifaresniff.c

index 7d589f0e64f6354227db678b703d379ba71b4909..bd37fe9acf4050772f790f0eb299d60ad8b0b628 100644 (file)
@@ -2539,7 +2539,9 @@ void RAMFUNC SniffMifare(uint8_t param) {
                        if(!TagIsActive) {              // no need to try decoding tag data if the reader is sending
                                uint8_t readerdata = (previous_data & 0xF0) | (*data >> 4);
                                if(MillerDecoding(readerdata, (sniffCounter-1)*4)) {
-                                       LED_C_INV();
+                                       LED_B_ON();
+                                       LED_C_OFF();
+
                                        if (MfSniffLogic(receivedCmd, Uart.len, Uart.parity, Uart.bitCount, true)) break;
 
                                        /* And ready to receive another command. */
@@ -2549,12 +2551,14 @@ void RAMFUNC SniffMifare(uint8_t param) {
                                        DemodReset();
                                }
                                ReaderIsActive = (Uart.state != STATE_UNSYNCD);
+                               TagIsActive = !ReaderIsActive;
                        }
                        
                        if(!ReaderIsActive) {           // no need to try decoding tag data if the reader is sending
                                uint8_t tagdata = (previous_data << 4) | (*data & 0x0F);
                                if(ManchesterDecoding(tagdata, 0, (sniffCounter-1)*4)) {
-                                       LED_C_INV();
+                                       LED_B_OFF();
+                                       LED_C_ON();
 
                                        if (MfSniffLogic(receivedResponse, Demod.len, Demod.parity, Demod.bitCount, false)) break;
 
@@ -2564,6 +2568,7 @@ void RAMFUNC SniffMifare(uint8_t param) {
                                        UartInit(receivedCmd, receivedCmdPar);
                                }
                                TagIsActive = (Demod.state != DEMOD_UNSYNCD);
+                               ReaderIsActive = !TagIsActive;
                        }
                }
 
index 7f94b0fe7c01ecdbce7a036a1fb94e00cfb1cbb2..b9ab3df4d13f4f38865160be13030c7eca493430 100644 (file)
@@ -124,16 +124,10 @@ bool RAMFUNC MfSniffLogic(const uint8_t *data, uint16_t len, uint8_t *parity, ui
                        sniffBuf[12] = 0xFF;\r
                        sniffBuf[13] = 0xFF;\r
                        LogTrace(sniffBuf, 14, 0, 0, NULL, TRUE);\r
-               }       // intentionally no break;\r
-               case SNF_CARD_CMD:{             \r
-                       LogTrace(data, len, 0, 0, NULL, TRUE);\r
-                       sniffState = SNF_CARD_RESP;\r
-                       timerData = GetTickCount();\r
-                       break;\r
-               }\r
-               case SNF_CARD_RESP:{\r
-                       LogTrace(data, len, 0, 0, NULL, FALSE);\r
                        sniffState = SNF_CARD_CMD;\r
+               }       // intentionally no break;\r
+               case SNF_CARD_CMD:{     \r
+                       LogTrace(data, len, 0, 0, NULL, reader);\r
                        timerData = GetTickCount();\r
                        break;\r
                }\r
Impressum, Datenschutz