From 50c59fb6b25be124e271ad56e058896584b70990 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 15 May 2019 07:03:19 -0400 Subject: [PATCH] chg: cident - uses NG --- armsrc/mifarecmd.c | 5 ++++- client/mifare/mifarehost.c | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index 43b06593b..52e08f83e 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -1945,6 +1945,7 @@ void MifareCIdent() { uint8_t *buf = BigBuf_malloc(PM3_CMD_DATA_SIZE); uint8_t *uid = BigBuf_malloc(10); uint32_t cuid = 0; + uint8_t data[1] = {0x00}; iso14443a_setup(FPGA_HF_ISO14443A_READER_LISTEN); @@ -1982,7 +1983,9 @@ TEST2: }; OUT: - reply_old(CMD_ACK, isGen, 0, 0, 0, 0); + + data[0] = isGen; + reply_ng(CMD_MIFARE_CIDENT, PM3_SUCCESS, data, sizeof(data)); // turns off OnSuccessMagic(); BigBuf_free(); diff --git a/client/mifare/mifarehost.c b/client/mifare/mifarehost.c index d1ae6a595..078eb467a 100644 --- a/client/mifare/mifarehost.c +++ b/client/mifare/mifarehost.c @@ -974,8 +974,10 @@ void detect_classic_magic(void) { PacketResponseNG resp; clearCommandBuffer(); SendCommandNG(CMD_MIFARE_CIDENT, NULL, 0); - if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) - isGeneration = resp.oldarg[0] & 0xff; + if (WaitForResponseTimeout(CMD_MIFARE_CIDENT, &resp, 1500)) { + if ( resp.status == PM3_SUCCESS ) + isGeneration = resp.data.asBytes[0]; + } switch (isGeneration) { case 1: