+ PrintAndLog("\n-- Tag Information ---------");
+ PrintAndLog("-------------------------------------------------------------");
+
+ UsbCommand cmd = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_RAW | ISO14A_APPEND_CRC , 1, 0}};
+ cmd.d.asBytes[0] = 0x60;
+ SendCommand(&cmd);
+ WaitForResponse(CMD_ACK, &resp);
+
+ if ( resp.arg[0] ) {
+ if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
+
+ uint8_t version[8] = {0,0,0,0,0,0,0,0};
+ memcpy(&version, resp.d.asBytes, sizeof(version));
+ uint8_t len = resp.arg[0] & 0xff;
+ switch (len) {
+ // todo, identify "Magic UL-C tags". // they usually have a static nonce response to 0x1A command.
+ // UL-EV1, size, check version[6] == 0x0b (smaller) 0x0b * 4 == 48
+ case 0x0A:PrintAndLog(" TYPE : NXP MIFARE Ultralight EV1 %d bytes", (version[6] == 0xB) ? 48 : 128); break;
+ case 0x01:PrintAndLog(" TYPE : NXP MIFARE Ultralight C");break;
+ case 0x00:PrintAndLog(" TYPE : NXP MIFARE Ultralight");break;
+ }
+ }
+ }
+ // TODO:
+ // Answers to 0x1A == UL-C
+ // NONCE seems to be fixed for my Magic UL-C. How to detect a Magic UL?
+ // maybe read Block0, change 1 byte, write back, and see if it failes or not. If magic, revert changes made?
+