X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/db4de4d82f2e4539b2528e604b7d82f79cc92f3a..0194ce8fc842da0e40b9d7bbfcb1837f508de9ce:/armsrc/mifaresniff.c diff --git a/armsrc/mifaresniff.c b/armsrc/mifaresniff.c index 910ea74d..53970e44 100644 --- a/armsrc/mifaresniff.c +++ b/armsrc/mifaresniff.c @@ -11,14 +11,13 @@ #include "mifaresniff.h" #include "apps.h" - static int sniffState = SNF_INIT; static uint8_t sniffUIDType; static uint8_t sniffUID[8]; static uint8_t sniffATQA[2]; static uint8_t sniffSAK; static uint8_t sniffBuf[16]; -static uint32_t timerData = 0; +static uint32_t timerData; bool MfSniffInit(void){ @@ -26,7 +25,6 @@ bool MfSniffInit(void){ memset(sniffATQA, 0x00, 2); sniffSAK = 0; sniffUIDType = SNF_UID_4; - return FALSE; } @@ -34,7 +32,6 @@ bool MfSniffEnd(void){ LED_B_ON(); cmd_send(CMD_ACK,0,0,0,0,0); LED_B_OFF(); - return FALSE; } @@ -140,7 +137,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; @@ -150,14 +147,15 @@ 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(); + FpgaDisableSscDma(); while (pckLen > 0) { pckSize = MIN(USB_CMD_DATA_SIZE, pckLen); LED_B_ON(); - cmd_send(CMD_ACK, 1, pckSize, pckNum, 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 +166,6 @@ bool intMfSniffSend() { cmd_send(CMD_ACK,2,0,0,0,0); LED_B_OFF(); - iso14a_clear_trace(); - + clear_trace(); return TRUE; }