- PrintAndLog("read UL-C Configuration bytes at page 42,43");
- //PrintAndLog(" Lock : %s - %s", sprint_hex(datatemp, 2), printBits( 2, &datatemp) );
- PrintAndLog(" Lock [42]: %s", sprint_hex(ulc_conf, 4) );
- PrintAndLog("Config [43]: %s", sprint_hex(ulc_conf+4, 4) );
+ PrintAndLog("--- UL-C Configuration");
+ PrintAndLog(" Higher Lockbits [40/0x28]: %s %s", sprint_hex(ulc_conf, 4), printBits(2, ulc_conf));
+ PrintAndLog(" Counter [41/0x29]: %s %s", sprint_hex(ulc_conf+4, 4), printBits(2, ulc_conf+4));
+
+ bool validAuth = (ulc_conf[8] >= 0x03 && ulc_conf[8] <= 0x30);
+ if ( validAuth )
+ PrintAndLog(" Auth0 [42/0x2A]: %s - Pages above %d needs authentication", sprint_hex(ulc_conf+8, 4), ulc_conf[8] );
+ else{
+ if ( ulc_conf[8] == 0){
+ PrintAndLog(" Auth0 [42/0x2A]: %s - default", sprint_hex(ulc_conf+8, 4) );
+ } else {
+ PrintAndLog(" Auth0 [42/0x2A]: %s - auth byte is out-of-range", sprint_hex(ulc_conf+8, 4) );
+ }
+ }
+ PrintAndLog(" Auth1 [43/0x2B]: %s - %s",
+ sprint_hex(ulc_conf+12, 4),
+ (ulc_conf[12] & 1) ? "write access restricted": "read and write access restricted"
+ );