X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/7bc95e2e43c0b00b72fc794b18c26a880ac19d1c..7705bf4e37d2fcece03e5c0d693f10956f012bc3:/armsrc/mifaresniff.c

diff --git a/armsrc/mifaresniff.c b/armsrc/mifaresniff.c
index bd9840e8..910ea74d 100644
--- a/armsrc/mifaresniff.c
+++ b/armsrc/mifaresniff.c
@@ -11,6 +11,7 @@
 #include "mifaresniff.h"
 #include "apps.h"
 
+
 static int sniffState = SNF_INIT;
 static uint8_t sniffUIDType;
 static uint8_t sniffUID[8];
@@ -37,7 +38,7 @@ bool MfSniffEnd(void){
 	return FALSE;
 }
 
-bool RAMFUNC MfSniffLogic(const uint8_t *data, uint16_t len, uint32_t parity, uint16_t bitCnt, bool reader) {
+bool RAMFUNC MfSniffLogic(const uint8_t *data, uint16_t len, uint8_t *parity, uint16_t bitCnt, bool reader) {
 
 	if (reader && (len == 1) && (bitCnt == 7)) { 		// reset on 7-Bit commands from reader
 		sniffState = SNF_INIT;
@@ -93,7 +94,8 @@ bool RAMFUNC MfSniffLogic(const uint8_t *data, uint16_t len, uint32_t parity, ui
 		}
 		case SNF_ANTICOL2:{
 			if ((!reader) && (len == 5) && ((data[0] ^ data[1] ^ data[2] ^ data[3]) == data[4])) { // CL2 UID 
-				memcpy(sniffUID, data, 4);
+				memcpy(sniffUID, sniffUID+4, 3);
+				memcpy(sniffUID+3, data, 4);
 				sniffUIDType = SNF_UID_7;
 				sniffState = SNF_UID2;
 			}
@@ -113,16 +115,16 @@ bool RAMFUNC MfSniffLogic(const uint8_t *data, uint16_t len, uint32_t parity, ui
 			sniffBuf[11] = sniffSAK;
 			sniffBuf[12] = 0xFF;
 			sniffBuf[13] = 0xFF;
-			LogTrace(sniffBuf, 14, 0, parity, true);
+			LogTrace(sniffBuf, 14, 0, 0, NULL, TRUE);
 		}	// intentionally no break;
 		case SNF_CARD_CMD:{		
-			LogTrace(data, len, 0, parity, true);
+			LogTrace(data, len, 0, 0, NULL, TRUE);
 			sniffState = SNF_CARD_RESP;
 			timerData = GetTickCount();
 			break;
 		}
 		case SNF_CARD_RESP:{
-			LogTrace(data, len, 0, parity, false);
+			LogTrace(data, len, 0, 0, NULL, FALSE);
 			sniffState = SNF_CARD_CMD;
 			timerData = GetTickCount();
 			break;