#include "mifarehost.h"\r
#include "proxmark3.h"\r
\r
-#define llx PRIx64\r
-\r
// MIFARE\r
int compar_int(const void * a, const void * b) {\r
// didn't work: (the result is truncated to 32 bits)\r
struct Crypto1State *p1, *p2, *p3, *p4;\r
\r
// flush queue\r
- WaitForResponseTimeout(CMD_ACK,NULL,100);\r
\r
UsbCommand c = {CMD_MIFARE_NESTED, {blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, calibrate}};\r
memcpy(c.d.asBytes, key, 6);\r
+ clearCommandBuffer();\r
SendCommand(&c);\r
\r
- if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {\r
- return -1;\r
- }\r
+ if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) return -1;\r
\r
- if (resp.arg[0]) {\r
- return resp.arg[0]; // error during nested\r
- }\r
- \r
+ // error during nested\r
+ if (resp.arg[0]) return resp.arg[0];\r
+ \r
memcpy(&uid, resp.d.asBytes, 4);\r
- PrintAndLog("uid:%08x trgbl=%d trgkey=%x", uid, (uint16_t)resp.arg[2] & 0xff, (uint16_t)resp.arg[2] >> 8);\r
+ PrintAndLog("UID: %08x Block:%d Key: %c", uid, (uint16_t)resp.arg[2] & 0xff, (resp.arg[2] >> 8) ?'A':'B' );\r
\r
for (i = 0; i < 2; i++) {\r
statelists[i].blockNo = resp.arg[2] & 0xff;\r