uint8_t* mifare_get_bigbufptr(void) {\r
return (((uint8_t *)BigBuf) + 3560); // was 3560 - tied to other size changes\r
}\r
uint8_t* mifare_get_bigbufptr(void) {\r
return (((uint8_t *)BigBuf) + 3560); // was 3560 - tied to other size changes\r
}\r
\r
// Transmit MIFARE_CLASSIC_AUTH\r
len = mifare_sendcmd_short(pcs, isNested, 0x60 + (keyType & 0x01), blockNo, receivedAnswer);\r
\r
// Transmit MIFARE_CLASSIC_AUTH\r
len = mifare_sendcmd_short(pcs, isNested, 0x60 + (keyType & 0x01), blockNo, receivedAnswer);\r
ntpp = prng_successor(nt, 32) ^ crypto1_word(pcs, 0,0);\r
\r
if (ntpp != bytes_to_num(tmp4, 4)) {\r
ntpp = prng_successor(nt, 32) ^ crypto1_word(pcs, 0,0);\r
\r
if (ntpp != bytes_to_num(tmp4, 4)) {\r
// command MIFARE_CLASSIC_READBLOCK\r
len = mifare_sendcmd_short(pcs, 1, 0x30, blockNo, receivedAnswer);\r
if (len == 1) {\r
// command MIFARE_CLASSIC_READBLOCK\r
len = mifare_sendcmd_short(pcs, 1, 0x30, blockNo, receivedAnswer);\r
if (len == 1) {\r
return 2;\r
}\r
\r
memcpy(bt, receivedAnswer + 16, 2);\r
AppendCrc14443a(receivedAnswer, 16);\r
if (bt[0] != receivedAnswer[16] || bt[1] != receivedAnswer[17]) {\r
return 2;\r
}\r
\r
memcpy(bt, receivedAnswer + 16, 2);\r
AppendCrc14443a(receivedAnswer, 16);\r
if (bt[0] != receivedAnswer[16] || bt[1] != receivedAnswer[17]) {\r
len = mifare_sendcmd_short(pcs, 1, 0xA0, blockNo, receivedAnswer);\r
\r
if ((len != 1) || (receivedAnswer[0] != 0x0A)) { // 0x0a - ACK\r
len = mifare_sendcmd_short(pcs, 1, 0xA0, blockNo, receivedAnswer);\r
\r
if ((len != 1) || (receivedAnswer[0] != 0x0A)) { // 0x0a - ACK\r
res |= (crypto1_bit(pcs, 0, 0) ^ BIT(receivedAnswer[0], i)) << i;\r
\r
if ((len != 1) || (res != 0x0A)) {\r
res |= (crypto1_bit(pcs, 0, 0) ^ BIT(receivedAnswer[0], i)) << i;\r
\r
if ((len != 1) || (res != 0x0A)) {\r
\r
len = mifare_sendcmd_short(pcs, 1, 0x50, 0x00, receivedAnswer);\r
if (len != 0) {\r
\r
len = mifare_sendcmd_short(pcs, 1, 0x50, 0x00, receivedAnswer);\r
if (len != 0) {\r