X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/49dc1d0a9eafdb1e369ead88c3c8882bc6959a17..623db3559bd3da895035f61cf1f1a7374f2365cf:/armsrc/iclass.c?ds=inline

diff --git a/armsrc/iclass.c b/armsrc/iclass.c
index e5bd4f42..51a9011f 100644
--- a/armsrc/iclass.c
+++ b/armsrc/iclass.c
@@ -633,8 +633,6 @@ static RAMFUNC int ManchesterDecoding(int v)
 //-----------------------------------------------------------------------------
 void RAMFUNC SnoopIClass(void)
 {
-
-
     // We won't start recording the frames that we acquire until we trigger;
     // a good trigger condition to get started is probably when we see a
     // response from the tag.
@@ -1676,7 +1674,8 @@ uint8_t handshakeIclassTag(uint8_t *card_data)
 // Reader iClass Anticollission
 void ReaderIClass(uint8_t arg0) {
 
-	uint8_t card_data[6 * 8]={0xFF};
+	uint8_t card_data[6 * 8]={0};
+	memset(card_data, 0xFF, sizeof(card_data));
     uint8_t last_csn[8]={0};
 	
 	//Read conf block CRC(0x01) => 0xfa 0x22
@@ -1688,13 +1687,15 @@ void ReaderIClass(uint8_t arg0) {
     int read_status= 0;
 	uint8_t result_status = 0;
     bool abort_after_read = arg0 & FLAG_ICLASS_READER_ONLY_ONCE;
-
+	bool try_once = arg0 & FLAG_ICLASS_READER_ONE_TRY;
 	set_tracing(TRUE);
     setupIclassReader();
 
+	uint16_t tryCnt=0;
     while(!BUTTON_PRESS())
     {
-
+		if (try_once && tryCnt > 5) break; 
+		tryCnt++;
 		if(!tracing) {
 			DbpString("Trace full");
 			break;