From 20f7b2f3ec77a287943cf527dc24228dfe1f25bb Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Mon, 13 May 2019 12:25:11 +0200 Subject: [PATCH] Remove support for old in MifareChkKeys, not needed anymore --- armsrc/appmain.c | 2 +- armsrc/apps.h | 2 +- armsrc/mifarecmd.c | 26 +++++++------------------- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index bb87705a0..13c2e6489 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -1029,7 +1029,7 @@ static void PacketReceived(PacketCommandNG *packet) { MifareNested(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2], packet->data.asBytes); break; case CMD_MIFARE_CHKKEYS: { - MifareChkKeys(packet->oldarg[0], packet->oldarg[1], packet->oldarg[2], packet->data.asBytes, packet->ng); + MifareChkKeys(packet->data.asBytes); break; } case CMD_MIFARE_CHKKEYS_FAST: { diff --git a/armsrc/apps.h b/armsrc/apps.h index d2fdf5bac..ce37c3373 100644 --- a/armsrc/apps.h +++ b/armsrc/apps.h @@ -153,7 +153,7 @@ void MifareUWriteBlock(uint8_t arg0, uint8_t arg1, uint8_t *datain); void MifareNested(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain); void MifareAcquireEncryptedNonces(uint32_t arg0, uint32_t arg1, uint32_t flags, uint8_t *datain); void MifareAcquireNonces(uint32_t arg0, uint32_t arg1, uint32_t flags, uint8_t *datain); -void MifareChkKeys(uint16_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain, bool ng); +void MifareChkKeys(uint8_t *datain); void MifareChkKeys_fast(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain); void MifareSetDbgLvl(uint16_t arg0); void MifareEMemClr(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain); diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index 1c6d0b589..0f391522d 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -1516,7 +1516,7 @@ OUT: } } -void MifareChkKeys(uint16_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain, bool ng) { +void MifareChkKeys(uint8_t *datain) { FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF); @@ -1538,18 +1538,11 @@ void MifareChkKeys(uint16_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain, b uint8_t blockNo, keyType, keyCount; bool clearTrace, have_uid = false; - if (ng) { - keyType = datain[0]; - blockNo = datain[1]; - clearTrace = datain[2]; - keyCount = datain[3]; - datain += 4; - } else { - blockNo = arg0 & 0xFF; - keyType = (arg0 >> 8) & 0xFF; - clearTrace = arg1; - keyCount = arg2; - } + keyType = datain[0]; + blockNo = datain[1]; + clearTrace = datain[2]; + keyCount = datain[3]; + datain += 4; LEDsoff(); LED_A_ON(); @@ -1607,12 +1600,7 @@ void MifareChkKeys(uint16_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain, b LED_B_ON(); - if (ng) { - reply_ng(CMD_MIFARE_CHKKEYS, PM3_SUCCESS, (uint8_t *)&keyresult, sizeof(keyresult)); - } else { - reply_mix(CMD_ACK, keyresult.found, 0, 0, (uint8_t *)&keyresult.key, sizeof(keyresult.key)); - } -// reply_old(CMD_ACK, keyresult.found, 0, 0, (uint8_t*)&keyresult.key, sizeof(keyresult.key)); + reply_ng(CMD_MIFARE_CHKKEYS, PM3_SUCCESS, (uint8_t *)&keyresult, sizeof(keyresult)); FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF); LEDsoff();