diff --git a/armsrc/mifareutil.c b/armsrc/mifareutil.c index 37c3d1e69..ce6083f89 100644 --- a/armsrc/mifareutil.c +++ b/armsrc/mifareutil.c @@ -95,9 +95,13 @@ uint16_t mifare_sendcmd(uint8_t cmd, uint8_t *data, uint8_t data_size, uint8_t * if (data_size > 0) { memcpy(dcmd + 1, data, data_size); } + data_size ++; - AddCrc14A(dcmd, data_size + 1); - ReaderTransmit(dcmd, sizeof(dcmd), timing); + AddCrc14A(dcmd, data_size); + + data_size += 2; + + ReaderTransmit(dcmd, data_size, timing); if (tearoff_hook() == PM3_ETEAROFF) { // tearoff occurred return 0; } @@ -374,8 +378,9 @@ int mifare_ul_ev1_auth(uint8_t *keybytes, uint8_t *pack) { uint8_t key[4] = {0x00, 0x00, 0x00, 0x00}; memcpy(key, keybytes, 4); - if (g_dbglevel >= DBG_EXTENDED) + if (g_dbglevel >= DBG_EXTENDED) { Dbprintf("EV1 Auth : %02x%02x%02x%02x", key[0], key[1], key[2], key[3]); + } len = mifare_sendcmd(MIFARE_ULEV1_AUTH, key, sizeof(key), resp, sizeof(resp), respPar, NULL);