PrintAndLog("data : %s", sprint_hex(data + i * 16, 16));\r
}\r
PrintAndLog("trailer: %s", sprint_hex(data + (sectorNo<32?3:15) * 16, 16));\r
+ \r
+ PrintAndLogEx(NORMAL, "Trailer decoded:");\r
+ int bln = mfFirstBlockOfSector(sectorNo);\r
+ int blinc = (mfNumBlocksPerSector(sectorNo) > 4) ? 5 : 1;\r
+ for (i = 0; i < 4; i++) {\r
+ PrintAndLogEx(NORMAL, "Access block %d%s: %s", bln, ((blinc > 1) && (i < 3) ? "+" : "") , mfGetAccessConditionsDesc(i, &(data + (sectorNo<32?3:15) * 16)[6]));\r
+ bln += blinc;\r
+ }\r
+ PrintAndLogEx(NORMAL, "UserData: %s", sprint_hex_inrow(&(data + (sectorNo<32?3:15) * 16)[9], 1));\r
}\r
} else {\r
PrintAndLog("Command execute timeout");\r
}\r
\r
PrintAndLog("block %3d data:%s", baseblock + i, sprint_hex(memBlock, 16));\r
+ \r
+ if (mfIsSectorTrailer(baseblock + i)) {\r
+ PrintAndLogEx(NORMAL, "Trailer decoded:");\r
+ PrintAndLogEx(NORMAL, "Key A: %s", sprint_hex_inrow(memBlock, 6));\r
+ PrintAndLogEx(NORMAL, "Key B: %s", sprint_hex_inrow(&memBlock[10], 6));\r
+ int bln = baseblock;\r
+ int blinc = (mfNumBlocksPerSector(sectorNo) > 4) ? 5 : 1;\r
+ for (int i = 0; i < 4; i++) {\r
+ PrintAndLogEx(NORMAL, "Access block %d%s: %s", bln, ((blinc > 1) && (i < 3) ? "+" : "") , mfGetAccessConditionsDesc(i, &memBlock[6]));\r
+ bln += blinc;\r
+ }\r
+ PrintAndLogEx(NORMAL, "UserData: %s", sprint_hex_inrow(&memBlock[9], 1));\r
+ }\r
}\r
return 0;\r
}\r