- while (true) {\r
- if(!iso14443a_select_card(uid, NULL, &cuid)) {\r
- if (MF_DBGLEVEL >= 1) Dbprintf("Can't select card");\r
- break;\r
- };\r
- \r
- for (i = 0; i < 16; i++) {\r
- sectorNo = i;\r
- ui64Key = emlGetKey(sectorNo, keyType);\r
- \r
- if (!i){\r
- if(mifare_classic_auth(pcs, cuid, sectorNo * 4, keyType, ui64Key, AUTH_FIRST)) {\r
- if (MF_DBGLEVEL >= 1) Dbprintf("Sector[%d]. Auth error", i);\r
- break;\r
- }\r
- } else {\r
- if(mifare_classic_auth(pcs, cuid, sectorNo * 4, keyType, ui64Key, AUTH_NESTED)) {\r
- if (MF_DBGLEVEL >= 1) Dbprintf("Sector[%d]. Auth nested error", i);\r
- break;\r
- }\r
- }\r
+ bool isOK = true;\r
+\r
+ if(!iso14443a_select_card(uid, NULL, &cuid)) {\r
+ isOK = false;\r
+ if (MF_DBGLEVEL >= 1) Dbprintf("Can't select card");\r
+ }\r