+ PrintAndLog("DCF: %d (%02x %02x), Token Type=NM (New Media)",
+ dcf,
+ data_buf[5],
+ data_buf[6]
+ );
+
+ } else if(dcf > 60000) { // Master token?
+
+ int fl = 0;
+
+ if(data_buf[6] == 0xec) {
+ strncpy(token_type, "XAM", sizeof(token_type));
+ fl = 1;
+ stamp_len = 0x0c - (data_buf[5] >> 4);
+ } else {
+ switch (data_buf[5] & 0x7f) {
+ case 0x00 ... 0x2f:
+ strncpy(token_type, "IAM", sizeof(token_type));
+ fl = (0x2f - (data_buf[5] & 0x7f)) + 1;
+ break;
+ case 0x30 ... 0x6f:
+ strncpy(token_type, "SAM", sizeof(token_type));
+ fl = (0x6f - (data_buf[5] & 0x7f)) + 1;
+ break;
+ case 0x70 ... 0x7f:
+ strncpy(token_type, "GAM", sizeof(token_type));
+ fl = (0x7f - (data_buf[5] & 0x7f)) + 1;
+ break;
+ }
+
+ stamp_len = 0xfc - data_buf[6];
+ }
+
+ PrintAndLog("DCF: %d (%02x %02x), Token Type=%s (OLE=%01u), OL=%02u, FL=%02u",
+ dcf,
+ data_buf[5],
+ data_buf[6],
+ token_type,
+ (data_buf[5] & 0x80 )>> 7,
+ stamp_len,
+ fl
+ );
+
+ } else { // Is IM(-S) type of card...
+
+ if(data_buf[7] == 0x9F && data_buf[8] == 0xFF) {
+ bIsSegmented = 1;
+ strncpy(token_type, "IM-S", sizeof(token_type));
+ } else {
+ strncpy(token_type, "IM", sizeof(token_type));
+ }