X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/7d5ebac99397fe7661760259377a4f222fdb92cb..3fe7103959574d63f9310c46548786b219a32771:/armsrc/mifaresniff.c?ds=sidebyside

diff --git a/armsrc/mifaresniff.c b/armsrc/mifaresniff.c
index 59e84697..7f94b0fe 100644
--- a/armsrc/mifaresniff.c
+++ b/armsrc/mifaresniff.c
@@ -10,6 +10,15 @@
 
 #include "mifaresniff.h"
 #include "apps.h"
+#include "proxmark3.h"
+#include "util.h"
+#include "string.h"
+#include "iso14443crc.h"
+#include "iso14443a.h"
+#include "crapto1/crapto1.h"
+#include "mifareutil.h"
+#include "common.h"
+
 
 static int sniffState = SNF_INIT;
 static uint8_t sniffUIDType;
@@ -139,7 +148,7 @@ bool RAMFUNC MfSniffLogic(const uint8_t *data, uint16_t len, uint8_t *parity, ui
 }
 
 bool RAMFUNC MfSniffSend(uint16_t maxTimeoutMs) {
-	if (traceLen && (GetTickCount() > timerData + maxTimeoutMs)) {
+	if (BigBuf_get_traceLen() && (GetTickCount() > timerData + maxTimeoutMs)) {
 		return intMfSniffSend();
 	}
 	return FALSE;
@@ -149,7 +158,7 @@ bool RAMFUNC MfSniffSend(uint16_t maxTimeoutMs) {
 bool intMfSniffSend() {
 
 	int pckSize = 0;
-	int pckLen = traceLen;
+	int pckLen = BigBuf_get_traceLen();
 	int pckNum = 0;
 	uint8_t *trace = BigBuf_get_addr();
 	
@@ -157,7 +166,7 @@ bool intMfSniffSend() {
 	while (pckLen > 0) {
 		pckSize = MIN(USB_CMD_DATA_SIZE, pckLen);
 		LED_B_ON();
-		cmd_send(CMD_ACK, 1, traceLen, pckSize, trace + traceLen - pckLen, pckSize);
+		cmd_send(CMD_ACK, 1, BigBuf_get_traceLen(), pckSize, trace + BigBuf_get_traceLen() - pckLen, pckSize);
 		LED_B_OFF();
 
 		pckLen -= pckSize;
@@ -168,7 +177,7 @@ bool intMfSniffSend() {
 	cmd_send(CMD_ACK,2,0,0,0,0);
 	LED_B_OFF();
 
-	iso14a_clear_trace();
+	clear_trace();
 	
 	return TRUE;
 }