-
- // test keys
- res = mfCheckKeys(trgBlockNo, trgKeyType, 8, keyBlock, &key64);
- if (res)
- res = mfCheckKeys(trgBlockNo, trgKeyType, 8, &keyBlock[6 * 8], &key64);
- if (!res)
- PrintAndLog("Found valid key:%012llx", key64);
- else
- PrintAndLog("No valid key found");
- } else // ------------------------------------ multiple sectors working
- {
- blDiff = blockNo % 4;
- PrintAndLog("Block shift=%d", blDiff);
- e_sector = calloc(SectorsCnt, sizeof(sector));
- if (e_sector == NULL) return 1;
-
- //test current key 4 sectors
- memcpy(keyBlock, key, 6);
- num_to_bytes(0xa0a1a2a3a4a5, 6, (uint8_t*)(keyBlock + 1 * 6));
- num_to_bytes(0xb0b1b2b3b4b5, 6, (uint8_t*)(keyBlock + 2 * 6));
- num_to_bytes(0xffffffffffff, 6, (uint8_t*)(keyBlock + 3 * 6));
- num_to_bytes(0x000000000000, 6, (uint8_t*)(keyBlock + 4 * 6));
- num_to_bytes(0xaabbccddeeff, 6, (uint8_t*)(keyBlock + 5 * 6));
-
- PrintAndLog("Testing known keys. Sector count=%d", SectorsCnt);
- for (i = 0; i < SectorsCnt; i++) {
- for (j = 0; j < 2; j++) {
- if (e_sector[i].foundKey[j]) continue;
-
- res = mfCheckKeys(i * 4 + blDiff, j, 6, keyBlock, &key64);
-
- if (!res) {
- e_sector[i].Key[j] = key64;
- e_sector[i].foundKey[j] = 1;
+ if (tc1) {
+ PrintAndLog(" - TC1 : NAD is%s supported, CID is%s supported",
+ (card.ats[pos] & 0x01) ? "" : " NOT",
+ (card.ats[pos] & 0x02) ? "" : " NOT");
+ pos++;
+ }
+ if (card.ats[0] > pos) {
+ char *tip = "";
+ if (card.ats[0] - pos >= 7) {
+ if (memcmp(card.ats + pos, "\xC1\x05\x2F\x2F\x01\xBC\xD6", 7) == 0) {
+ tip = "-> MIFARE Plus X 2K or 4K";
+ } else if (memcmp(card.ats + pos, "\xC1\x05\x2F\x2F\x00\x35\xC7", 7) == 0) {
+ tip = "-> MIFARE Plus S 2K or 4K";