\r
// wait cycle\r
while (true) {\r
- printf(".");\r
+ printf(".");\r
fflush(stdout);\r
if (ukbhit()) {\r
tmpchar = getchar();\r
}\r
\r
UsbCommand resp;\r
- if (WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {\r
+ if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {\r
isOK = resp.arg[0];\r
+ printf("\n\n");\r
switch (isOK) {\r
case -1 : PrintAndLog("Button pressed. Aborted.\n"); break;\r
case -2 : PrintAndLog("Card is not vulnerable to Darkside attack (doesn't send NACK on authentication requests).\n"); break;\r
case -3 : PrintAndLog("Card is not vulnerable to Darkside attack (its random number generator is not predictable).\n"); break;\r
case -4 : PrintAndLog("Card is not vulnerable to Darkside attack (its random number generator seems to be based on the wellknown");\r
- PrintAndLog("generating polynomial with 16 effective bits only, but shows unexpected behaviour.\n"); break;\r
+ PrintAndLog("generating polynomial with 16 effective bits only, but shows unexpected behaviour.\n"); break;\r
default: ;\r
}\r
- uid = (uint32_t)bytes_to_num(resp.d.asBytes, 4);\r
+ uid = (uint32_t)bytes_to_num(resp.d.asBytes + 0, 4);\r
nt = (uint32_t)bytes_to_num(resp.d.asBytes + 4, 4);\r
par_list = bytes_to_num(resp.d.asBytes + 8, 8);\r
ks_list = bytes_to_num(resp.d.asBytes + 16, 8);\r
\r
// nested sectors\r
iterations = 0;\r
+ PrintAndLog("enter nested...");\r
bool calibrate = true;\r
\r
for (i = 0; i < NESTED_SECTOR_RETRY; i++) {\r
case -5 :\r
calibrate = false;\r
iterations++;\r
- e_sector[sectorNo].foundKey[trgKeyType] = TRUE;\r
+ e_sector[sectorNo].foundKey[trgKeyType] = 1;\r
e_sector[sectorNo].Key[trgKeyType] = bytes_to_num(keyBlock, 6);\r
continue;\r
\r
SendCommand(&c);\r
\r
UsbCommand resp;\r
- if ( !WaitForResponseTimeout(CMD_ACK, &resp, 1500)) continue;\r
+ if ( !WaitForResponseTimeout(CMD_ACK,&resp,1500)) continue;\r
\r
uint8_t isOK = resp.arg[0] & 0xff;\r
if (!isOK) continue;\r
// skip already found keys.\r
if (e_sector[i].foundKey[trgKeyType]) continue;\r
\r
+ \r
for (uint32_t c = 0; c < keycnt; c += max_keys) {\r
\r
uint32_t size = keycnt-c > max_keys ? max_keys : keycnt-c;\r