- UsbCommand resp;\r
- if (WaitForResponseTimeout(CMD_ACK,&resp,1500)) {\r
- isOK = resp.arg[0] & 0xff;\r
- data = resp.d.asBytes;\r
-\r
- PrintAndLog("isOk:%02x", isOK);\r
- if (isOK) \r
- for (i = 0; i < 16; i++) {\r
- switch(i){\r
- case 2:\r
- //process lock bytes\r
- lockbytes_t=data+(i*4);\r
- lockbytes[0]=lockbytes_t[2];\r
- lockbytes[1]=lockbytes_t[3];\r
- for(int j=0; j<16; j++){\r
- bit[j]=lockbytes[j/8] & ( 1 <<(7-j%8));\r
- }\r
- //PrintAndLog("LB %02x %02x", lockbytes[0],lockbytes[1]);\r
- //PrintAndLog("LB2b %02x %02x %02x %02x %02x %02x %02x %02x",bit[8],bit[9],bit[10],bit[11],bit[12],bit[13],bit[14],bit[15]); \r
- PrintAndLog("Block %02x:%s ", i,sprint_hex(data + i * 4, 4));\r
- break;\r
- case 3: \r
- PrintAndLog("Block %02x:%s [%d]", i,sprint_hex(data + i * 4, 4),bit[4]);\r
- break;\r
- case 4:\r
- PrintAndLog("Block %02x:%s [%d]", i,sprint_hex(data + i * 4, 4),bit[3]);\r
- break;\r
- case 5:\r
- PrintAndLog("Block %02x:%s [%d]", i,sprint_hex(data + i * 4, 4),bit[2]);\r
- break;\r
- case 6:\r
- PrintAndLog("Block %02x:%s [%d]", i,sprint_hex(data + i * 4, 4),bit[1]);\r
- break;\r
- case 7:\r
- PrintAndLog("Block %02x:%s [%d]", i,sprint_hex(data + i * 4, 4),bit[0]);\r
- break;\r
- case 8:\r
- PrintAndLog("Block %02x:%s [%d]", i,sprint_hex(data + i * 4, 4),bit[15]);\r
- break;\r
- case 9:\r
- PrintAndLog("Block %02x:%s [%d]", i,sprint_hex(data + i * 4, 4),bit[14]);\r
- break;\r
- case 10:\r
- PrintAndLog("Block %02x:%s [%d]", i,sprint_hex(data + i * 4, 4),bit[13]);\r
- break;\r
- case 11:\r
- PrintAndLog("Block %02x:%s [%d]", i,sprint_hex(data + i * 4, 4),bit[12]);\r
- break;\r
- case 12:\r
- PrintAndLog("Block %02x:%s [%d]", i,sprint_hex(data + i * 4, 4),bit[11]);\r
- break;\r
- case 13:\r
- PrintAndLog("Block %02x:%s [%d]", i,sprint_hex(data + i * 4, 4),bit[10]);\r
- break;\r
- case 14:\r
- PrintAndLog("Block %02x:%s [%d]", i,sprint_hex(data + i * 4, 4),bit[9]);\r
- break;\r
- case 15:\r
- PrintAndLog("Block %02x:%s [%d]", i,sprint_hex(data + i * 4, 4),bit[8]);\r
- break;\r
- default:\r
- PrintAndLog("Block %02x:%s ", i,sprint_hex(data + i * 4, 4));\r
- break;\r
+ UsbCommand resp;\r
+ if (WaitForResponseTimeout(CMD_ACK,&resp,1500)) {\r
+ isOK = resp.arg[0] & 0xff;\r
+ data = resp.d.asBytes;\r
+\r
+ PrintAndLog("isOk:%02x", isOK);\r
+ if (isOK) \r
+ { // bit 0 and 1\r
+ PrintAndLog("Block %3d:%s ", 0,sprint_hex(data + 0 * 4, 4));\r
+ PrintAndLog("Block %3d:%s ", 1,sprint_hex(data + 1 * 4, 4));\r
+ // bit 2\r
+ //process lock bytes\r
+ lockbytes_t=data+(2*4);\r
+ lockbytes[0]=lockbytes_t[2];\r
+ lockbytes[1]=lockbytes_t[3];\r
+ for(int j=0; j<16; j++){\r
+ bit[j]=lockbytes[j/8] & ( 1 <<(7-j%8));\r