diff --git a/client/cmddata.c b/client/cmddata.c index e0fd2fa5c..0b63b043d 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -876,7 +876,7 @@ static int CmdBuffClear(const char *Cmd) { if (cmdp == 'h') return usage_data_buffclear(); clearCommandBuffer(); - SendCommandMIX(CMD_BUFF_CLEAR, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_BUFF_CLEAR, NULL, 0); ClearGraph(true); return 0; } @@ -1530,7 +1530,7 @@ int CmdTuneSamples(const char *Cmd) { PrintAndLogEx(INFO, "\nMeasuring antenna characteristics, please wait..."); clearCommandBuffer(); - SendCommandOLD(CMD_MEASURE_ANTENNA_TUNING, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_MEASURE_ANTENNA_TUNING, NULL, 0); PacketResponseNG resp; while (!WaitForResponseTimeout(CMD_MEASURED_ANTENNA_TUNING, &resp, 2000)) { timeout++; diff --git a/client/cmdflashmem.c b/client/cmdflashmem.c index 884e33ead..ebc78994e 100644 --- a/client/cmdflashmem.c +++ b/client/cmdflashmem.c @@ -457,7 +457,7 @@ static int CmdFlashMemInfo(const char *Cmd) { } clearCommandBuffer(); - SendCommandMIX(CMD_FLASHMEM_INFO, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_FLASHMEM_INFO, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { PrintAndLogEx(WARNING, "timeout while waiting for reply."); diff --git a/client/cmdhf.c b/client/cmdhf.c index 24d30d40c..65dbaaef1 100644 --- a/client/cmdhf.c +++ b/client/cmdhf.c @@ -104,7 +104,7 @@ int CmdHFSniff(const char *Cmd) { int skiptriggers = param_get32ex(Cmd, 1, 0, 10); clearCommandBuffer(); - SendCommandOLD(CMD_HF_SNIFFER, skippairs, skiptriggers, 0, NULL, 0); + SendCommandMIX(CMD_HF_SNIFFER, skippairs, skiptriggers, 0, NULL, 0); return 0; } diff --git a/client/cmdhf14a.c b/client/cmdhf14a.c index 0fdece610..45f4224e5 100644 --- a/client/cmdhf14a.c +++ b/client/cmdhf14a.c @@ -228,7 +228,7 @@ static int CmdHF14AList(const char *Cmd) { } int Hf14443_4aGetCardData(iso14a_card_select_t *card) { - SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_CONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT, 0, 0, NULL, 0); PacketResponseNG resp; WaitForResponse(CMD_ACK, &resp); @@ -298,7 +298,7 @@ static int CmdHF14AReader(const char *Cmd) { cm |= ISO14A_NO_DISCONNECT; clearCommandBuffer(); - SendCommandOLD(CMD_READER_ISO_14443a, cm, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ISO_14443a, cm, 0, 0, NULL, 0); if (ISO14A_CONNECT & cm) { PacketResponseNG resp; @@ -383,7 +383,7 @@ static int CmdHF14ACUIDs(const char *Cmd) { } // execute anticollision procedure - SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0); PacketResponseNG resp; WaitForResponse(CMD_ACK, &resp); @@ -508,7 +508,7 @@ int CmdHF14ASniff(const char *Cmd) { if (ctmp == 'r') param |= 0x02; } clearCommandBuffer(); - SendCommandOLD(CMD_SNIFF_ISO_14443a, param, 0, 0, NULL, 0); + SendCommandMIX(CMD_SNIFF_ISO_14443a, param, 0, 0, NULL, 0); return 0; } @@ -522,7 +522,7 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav PacketResponseNG resp; // Anticollision + SELECT card - SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) { PrintAndLogEx(ERR, "Proxmark3 connection timeout."); return 1; @@ -616,7 +616,7 @@ static int SelectCard14443_4(bool disconnect, iso14a_card_select_t *card) { DropField(); // Anticollision + SELECT card - SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) { PrintAndLogEx(ERR, "Proxmark3 connection timeout."); return 1; @@ -693,7 +693,7 @@ static int CmdExchangeAPDU(bool chainingin, uint8_t *datain, int datainlen, bool if (datain) SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_APDU | ISO14A_NO_DISCONNECT | cmdc, (datainlen & 0xFFFF), 0, datain, datainlen & 0xFFFF); else - SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_APDU | ISO14A_NO_DISCONNECT | cmdc, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_APDU | ISO14A_NO_DISCONNECT | cmdc, 0, 0, NULL, 0); uint8_t *recv; PacketResponseNG resp; @@ -1142,7 +1142,7 @@ int CmdHF14A(const char *Cmd) { int infoHF14A(bool verbose, bool do_nack_test) { clearCommandBuffer(); - SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (verbose) PrintAndLogEx(WARNING, "iso14443a card select failed"); @@ -1194,7 +1194,7 @@ int infoHF14A(bool verbose, bool do_nack_test) { // reconnect for further tests clearCommandBuffer(); - SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0); WaitForResponse(CMD_ACK, &resp); memcpy(&card, (iso14a_card_select_t *)resp.data.asBytes, sizeof(iso14a_card_select_t)); diff --git a/client/cmdhf14b.c b/client/cmdhf14b.c index 89126d618..94a89a2bc 100644 --- a/client/cmdhf14b.c +++ b/client/cmdhf14b.c @@ -109,13 +109,13 @@ static int usage_hf_14b_dump(void) { /* static void switch_on_field_14b(void) { clearCommandBuffer(); - SendCommandOLD(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT, 0, 0, NULL, 0); } */ static int switch_off_field_14b(void) { clearCommandBuffer(); - SendCommandOLD(CMD_ISO_14443B_COMMAND, ISO14B_DISCONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_DISCONNECT, 0, 0, NULL, 0); return 0; } @@ -170,7 +170,7 @@ static int CmdHF14BSim(const char *Cmd) { } clearCommandBuffer(); - SendCommandOLD(CMD_SIMULATE_TAG_ISO_14443B, pupi, 0, 0, NULL, 0); + SendCommandMIX(CMD_SIMULATE_TAG_ISO_14443B, pupi, 0, 0, NULL, 0); return 0; } @@ -180,7 +180,7 @@ static int CmdHF14BSniff(const char *Cmd) { if (cmdp == 'h') return usage_hf_14b_sniff(); clearCommandBuffer(); - SendCommandOLD(CMD_SNIFF_ISO_14443B, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_SNIFF_ISO_14443B, NULL, 0); return 0; } @@ -301,7 +301,7 @@ static bool get_14b_UID(iso14b_card_select_t *card) { while (retry--) { clearCommandBuffer(); - SendCommandOLD(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0, NULL, 0); if (WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) { uint8_t status = resp.oldarg[0]; @@ -317,7 +317,7 @@ static bool get_14b_UID(iso14b_card_select_t *card) { while (retry--) { clearCommandBuffer(); - SendCommandOLD(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0, NULL, 0); if (WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) { uint8_t status = resp.oldarg[0]; @@ -501,7 +501,7 @@ static bool HF14B_Std_Info(bool verbose) { // 14b get and print UID only (general info) clearCommandBuffer(); - SendCommandOLD(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) { @@ -541,7 +541,7 @@ static bool HF14B_Std_Info(bool verbose) { static bool HF14B_ST_Info(bool verbose) { clearCommandBuffer(); - SendCommandOLD(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) { @@ -597,7 +597,7 @@ static bool HF14B_ST_Reader(bool verbose) { // SRx get and print general info about SRx chip from UID clearCommandBuffer(); - SendCommandOLD(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) { if (verbose) PrintAndLogEx(WARNING, "command execution timeout"); @@ -636,7 +636,7 @@ static bool HF14B_Std_Reader(bool verbose) { // 14b get and print UID only (general info) clearCommandBuffer(); - SendCommandOLD(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) { @@ -745,7 +745,7 @@ static int CmdHF14BReadSri(const char *Cmd) { uint8_t blocks = (tagtype == 1) ? 0x7F : 0x0F; clearCommandBuffer(); - SendCommandOLD(CMD_READ_SRI_TAG, blocks, 0, 0, NULL, 0); + SendCommandMIX(CMD_READ_SRI_TAG, blocks, 0, 0, NULL, 0); return 0; } // New command to write a SRI512/SRIX4K tag. @@ -884,7 +884,7 @@ static int CmdHF14BDump(const char *Cmd) { PacketResponseNG resp; clearCommandBuffer(); - SendCommandOLD(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR, 0, 0, NULL, 0); + SendCommandMIX(CMD_ISO_14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR, 0, 0, NULL, 0); //select if (WaitForResponseTimeout(CMD_ACK, &resp, 2000)) { diff --git a/client/cmdhf15.c b/client/cmdhf15.c index 65bb963d5..72d456e2e 100644 --- a/client/cmdhf15.c +++ b/client/cmdhf15.c @@ -575,7 +575,7 @@ static int CmdHF15Samples(const char *Cmd) { if (cmdp == 'h') return usage_15_samples(); clearCommandBuffer(); - SendCommandOLD(CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693, NULL, 0); getSamples(0, false); return 0; @@ -672,7 +672,7 @@ static int CmdHF15Record(const char *Cmd) { if (cmdp == 'h') return usage_15_record(); clearCommandBuffer(); - SendCommandOLD(CMD_RECORD_RAW_ADC_SAMPLES_ISO_15693, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_RECORD_RAW_ADC_SAMPLES_ISO_15693, NULL, 0); return 0; } @@ -713,7 +713,7 @@ static int CmdHF15Afi(const char *Cmd) { PrintAndLogEx(SUCCESS, "press pm3-button to cancel"); clearCommandBuffer(); - SendCommandOLD(CMD_ISO_15693_FIND_AFI, strtol(Cmd, NULL, 0), 0, 0, NULL, 0); + SendCommandMIX(CMD_ISO_15693_FIND_AFI, strtol(Cmd, NULL, 0), 0, 0, NULL, 0); return 0; } diff --git a/client/cmdhfepa.c b/client/cmdhfepa.c index c2dbc0163..f0d06cda4 100644 --- a/client/cmdhfepa.c +++ b/client/cmdhfepa.c @@ -32,7 +32,7 @@ static int CmdHFEPACollectPACENonces(const char *Cmd) { for (uint32_t i = 0; i < n; i++) { // execute PACE clearCommandBuffer(); - SendCommandOLD(CMD_EPA_PACE_COLLECT_NONCE, (int)m, 0, 0, NULL, 0); + SendCommandMIX(CMD_EPA_PACE_COLLECT_NONCE, (int)m, 0, 0, NULL, 0); PacketResponseNG resp; WaitForResponse(CMD_ACK, &resp); @@ -135,7 +135,7 @@ static int CmdHFEPAPACEReplay(const char *Cmd) { // now perform the replay clearCommandBuffer(); - SendCommandOLD(CMD_EPA_PACE_REPLAY, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_EPA_PACE_REPLAY, NULL, 0); WaitForResponse(CMD_ACK, &resp); if (resp.oldarg[0] != 0) { PrintAndLogEx(NORMAL, "\nPACE replay failed in step %u!", (uint32_t)resp.oldarg[0]); diff --git a/client/cmdhffelica.c b/client/cmdhffelica.c index 65559e1a8..888b49607 100644 --- a/client/cmdhffelica.c +++ b/client/cmdhffelica.c @@ -173,7 +173,7 @@ static int CmdHFFelicaSniff(const char *Cmd) { if (errors || cmdp == 0) return usage_hf_felica_sniff(); clearCommandBuffer(); - SendCommandOLD(CMD_FELICA_SNIFF, samples2skip, triggers2skip, 0, NULL, 0); + SendCommandMIX(CMD_FELICA_SNIFF, samples2skip, triggers2skip, 0, NULL, 0); return 0; } @@ -186,7 +186,7 @@ static int CmdHFFelicaSimLite(const char *Cmd) { return usage_hf_felica_simlite(); clearCommandBuffer(); - SendCommandOLD(CMD_FELICA_LITE_SIM, uid, 0, 0, NULL, 0); + SendCommandMIX(CMD_FELICA_LITE_SIM, uid, 0, 0, NULL, 0); return 0; } @@ -349,7 +349,7 @@ static int CmdHFFelicaDumpLite(const char *Cmd) { PrintAndLogEx(SUCCESS, "FeliCa lite - dump started"); PrintAndLogEx(SUCCESS, "press pm3-button to cancel"); clearCommandBuffer(); - SendCommandOLD(CMD_FELICA_LITE_DUMP, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_FELICA_LITE_DUMP, NULL, 0); PacketResponseNG resp; uint8_t timeout = 0; @@ -560,11 +560,11 @@ int CmdHFFelica(const char *Cmd) { int readFelicaUid(bool verbose) { clearCommandBuffer(); - SendCommandOLD(CMD_FELICA_COMMAND, FELICA_CONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_FELICA_COMMAND, FELICA_CONNECT, 0, 0, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (verbose) PrintAndLogEx(WARNING, "FeliCa card select failed"); - //SendCommandOLD(CMD_FELICA_COMMAND, 0, 0, 0, NULL, 0); + //SendCommandNG(CMD_FELICA_COMMAND, NULL, 0); return 0; } diff --git a/client/cmdhficlass.c b/client/cmdhficlass.c index 54195c155..023cf9107 100644 --- a/client/cmdhficlass.c +++ b/client/cmdhficlass.c @@ -281,7 +281,7 @@ static int CmdHFiClassList(const char *Cmd) { static int CmdHFiClassSniff(const char *Cmd) { char cmdp = tolower(param_getchar(Cmd, 0)); if (cmdp == 'h') return usage_hf_iclass_sniff(); - SendCommandMIX(CMD_SNIFF_ICLASS, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_SNIFF_ICLASS, NULL, 0); return 0; } @@ -605,7 +605,7 @@ static int CmdHFiClassELoad(const char *Cmd) { // Disable fast mode and send a dummy command to make it effective conn.block_after_ACK = false; - SendCommandMIX(CMD_PING, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_PING, NULL, 0); WaitForResponseTimeout(CMD_ACK, NULL, 1000); PrintAndLogEx(SUCCESS, "sent %d bytes of data to device emulator memory", bytes_sent); @@ -771,7 +771,7 @@ static bool select_only(uint8_t *CSN, uint8_t *CCNR, bool use_credit_key, bool v flags |= FLAG_ICLASS_READER_CEDITKEY; clearCommandBuffer(); - SendCommandOLD(CMD_READER_ICLASS, flags, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ICLASS, flags, 0, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, 4000)) { PrintAndLogEx(WARNING, "command execute timeout"); return false; @@ -937,7 +937,7 @@ static int CmdHFiClassReader_Dump(const char *Cmd) { uint8_t tag_data[255 * 8]; clearCommandBuffer(); - SendCommandOLD(CMD_READER_ICLASS, flags, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ICLASS, flags, 0, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, 4500)) { PrintAndLogEx(WARNING, "command execute timeout"); DropField(); @@ -975,7 +975,7 @@ static int CmdHFiClassReader_Dump(const char *Cmd) { // begin dump clearCommandBuffer(); - SendCommandOLD(CMD_ICLASS_DUMP, blockno, numblks - blockno + 1, 0, NULL, 0); + SendCommandMIX(CMD_ICLASS_DUMP, blockno, numblks - blockno + 1, 0, NULL, 0); while (true) { printf("."); fflush(stdout); @@ -1031,7 +1031,7 @@ static int CmdHFiClassReader_Dump(const char *Cmd) { if (maxBlk > blockno + numblks + 1) { // setup dump and start clearCommandBuffer(); - SendCommandOLD(CMD_ICLASS_DUMP, blockno + blocksRead, maxBlk - (blockno + blocksRead), 0, NULL, 0); + SendCommandMIX(CMD_ICLASS_DUMP, blockno + blocksRead, maxBlk - (blockno + blocksRead), 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, 4500)) { PrintAndLogEx(WARNING, "command execute timeout 2"); return 0; @@ -1359,7 +1359,7 @@ static int ReadBlock(uint8_t *KEY, uint8_t blockno, uint8_t keyType, bool elite, PacketResponseNG resp; clearCommandBuffer(); - SendCommandOLD(CMD_ICLASS_READBLOCK, blockno, 0, 0, NULL, 0); + SendCommandMIX(CMD_ICLASS_READBLOCK, blockno, 0, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, 4500)) { PrintAndLogEx(WARNING, "Command execute timeout"); return 0; @@ -2037,7 +2037,7 @@ out: // Disable fast mode and send a dummy command to make it effective conn.block_after_ACK = false; - SendCommandMIX(CMD_PING, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_PING, NULL, 0); WaitForResponseTimeout(CMD_ACK, NULL, 1000); DropField(); @@ -2464,7 +2464,7 @@ int readIclass(bool loop, bool verbose) { while (!ukbhit()) { clearCommandBuffer(); - SendCommandOLD(CMD_READER_ICLASS, flags, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ICLASS, flags, 0, 0, NULL, 0); if (WaitForResponseTimeout(CMD_ACK, &resp, 4500)) { uint8_t readStatus = resp.oldarg[0] & 0xff; uint8_t *data = resp.data.asBytes; diff --git a/client/cmdhflegic.c b/client/cmdhflegic.c index 88e96155e..57a123964 100644 --- a/client/cmdhflegic.c +++ b/client/cmdhflegic.c @@ -527,7 +527,7 @@ static int CmdLegicRfSim(const char *Cmd) { uint64_t id = 1; sscanf(Cmd, " %" SCNi64, &id); clearCommandBuffer(); - SendCommandOLD(CMD_SIMULATE_TAG_LEGIC_RF, id, 0, 0, NULL, 0); + SendCommandMIX(CMD_SIMULATE_TAG_LEGIC_RF, id, 0, 0, NULL, 0); return 0; } @@ -755,7 +755,7 @@ int legic_read_mem(uint32_t offset, uint32_t len, uint32_t iv, uint8_t *out, uin legic_chk_iv(&iv); clearCommandBuffer(); - SendCommandOLD(CMD_READER_LEGIC_RF, offset, len, iv, NULL, 0); + SendCommandMIX(CMD_READER_LEGIC_RF, offset, len, iv, NULL, 0); PacketResponseNG resp; uint8_t timeout = 0; @@ -808,7 +808,7 @@ int legic_get_type(legic_card_select_t *card) { if (card == NULL) return 1; clearCommandBuffer(); - SendCommandMIX(CMD_LEGIC_INFO, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_LEGIC_INFO, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) return 2; @@ -893,7 +893,7 @@ static int CmdLegicDump(const char *Cmd) { PrintAndLogEx(SUCCESS, "Reading tag memory %d b...", dumplen); clearCommandBuffer(); - SendCommandOLD(CMD_READER_LEGIC_RF, 0x00, dumplen, 0x55, NULL, 0); + SendCommandMIX(CMD_READER_LEGIC_RF, 0x00, dumplen, 0x55, NULL, 0); PacketResponseNG resp; uint8_t timeout = 0; diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 51de727c9..82eb6c208 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -411,7 +411,7 @@ static int usage_hf14_nack(void) { static int GetHFMF14AUID(uint8_t *uid, int *uidlen) { clearCommandBuffer(); - SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_CONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT, 0, 0, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { PrintAndLogEx(WARNING, "iso14443a card select failed"); @@ -2026,7 +2026,7 @@ out: // Disable fast mode and send a dummy command to make it effective conn.block_after_ACK = false; - SendCommandMIX(CMD_PING, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_PING, NULL, 0); WaitForResponseTimeout(CMD_ACK, NULL, 1000); @@ -2291,7 +2291,7 @@ static int CmdHF14AMfSniff(const char *Cmd) { PrintAndLogEx(NORMAL, "-------------------------------------------------------------------------\n"); clearCommandBuffer(); - SendCommandMIX(CMD_MIFARE_SNIFFER, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_MIFARE_SNIFFER, NULL, 0); PacketResponseNG resp; @@ -2506,7 +2506,7 @@ static int CmdHF14AMfEClear(const char *Cmd) { if (c == 'h') return usage_hf14_eclr(); clearCommandBuffer(); - SendCommandOLD(CMD_MIFARE_EML_MEMCLR, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_MIFARE_EML_MEMCLR, NULL, 0); return 0; } @@ -2711,7 +2711,7 @@ static int CmdHF14AMfECFill(const char *Cmd) { PrintAndLogEx(NORMAL, "--params: numSectors: %d, keyType: %c\n", numSectors, (keyType == 0) ? 'A' : 'B'); clearCommandBuffer(); - SendCommandOLD(CMD_MIFARE_EML_CARDLOAD, numSectors, keyType, 0, NULL, 0); + SendCommandMIX(CMD_MIFARE_EML_CARDLOAD, numSectors, keyType, 0, NULL, 0); return 0; } @@ -3276,7 +3276,7 @@ static int CmdHF14AMfice(const char *Cmd) { flags |= initialize ? 0x0001 : 0; flags |= slow ? 0x0002 : 0; clearCommandBuffer(); - SendCommandOLD(CMD_MIFARE_ACQUIRE_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, flags, NULL, 0); + SendCommandMIX(CMD_MIFARE_ACQUIRE_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, flags, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, 3000)) goto out; if (resp.oldarg[0]) goto out; @@ -3308,7 +3308,7 @@ out: } clearCommandBuffer(); - SendCommandOLD(CMD_MIFARE_ACQUIRE_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, 4, NULL, 0); + SendCommandMIX(CMD_MIFARE_ACQUIRE_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, 4, NULL, 0); return 0; } diff --git a/client/cmdhfmfdes.c b/client/cmdhfmfdes.c index f5218ebb1..daadf0cab 100644 --- a/client/cmdhfmfdes.c +++ b/client/cmdhfmfdes.c @@ -111,7 +111,7 @@ static int CmdHF14ADesRb(const char *Cmd) { static int CmdHF14ADesInfo(const char *Cmd) { (void)Cmd; // Cmd is not used so far - SendCommandOLD(CMD_MIFARE_DESFIRE_INFO, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_MIFARE_DESFIRE_INFO, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) { diff --git a/client/cmdhfmfdesfire.c b/client/cmdhfmfdesfire.c index b93edd02a..d09a56eea 100644 --- a/client/cmdhfmfdesfire.c +++ b/client/cmdhfmfdesfire.c @@ -58,7 +58,7 @@ static int CmdHF14AMfDESAuth(const char *Cmd) { //DES_set_key((DES_cblock *)key2,&ks2); //Auth1 - SendCommandOLD(CMD_MIFARE_DES_AUTH1, blockNo, 0, 0, NULL, 0); + SendCommandMIX(CMD_MIFARE_DES_AUTH1, blockNo, 0, 0, NULL, 0); PacketResponseNG resp; if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) { uint8_t isOK = resp.oldarg[0] & 0xff; @@ -155,7 +155,7 @@ static int CmdHF14AMfAESAuth(const char *Cmd) { AES_set_decrypt_key(key, 128, &key_d); //Auth1 - SendCommandOLD(CMD_MIFARE_DES_AUTH1, blockNo, 0, 0, NULL, 0); + SendCommandMIX(CMD_MIFARE_DES_AUTH1, blockNo, 0, 0, NULL, 0); PacketResponseNG resp; if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) { uint8_t isOK = resp.oldarg[0] & 0xff; diff --git a/client/cmdhfmfhard.c b/client/cmdhfmfhard.c index 038a2bd4c..cdbd092d8 100644 --- a/client/cmdhfmfhard.c +++ b/client/cmdhfmfhard.c @@ -1393,7 +1393,7 @@ static int acquire_nonces(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_ if (!WaitForResponseTimeout(CMD_ACK, &resp, 3000)) { //strange second call (iceman) clearCommandBuffer(); - SendCommandOLD(CMD_MIFARE_ACQUIRE_ENCRYPTED_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, 4, NULL, 0); + SendCommandMIX(CMD_MIFARE_ACQUIRE_ENCRYPTED_NONCES, blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, 4, NULL, 0); return 1; } if (resp.oldarg[0]) return resp.oldarg[0]; // error during nested_hard diff --git a/client/cmdhfmfp.c b/client/cmdhfmfp.c index e9bff0128..e69410e38 100644 --- a/client/cmdhfmfp.c +++ b/client/cmdhfmfp.c @@ -42,7 +42,7 @@ static int CmdHFMFPInfo(const char *cmd) { infoHF14A(false, false); // Mifare Plus info - SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0); PacketResponseNG resp; WaitForResponse(CMD_ACK, &resp); diff --git a/client/cmdhfmfu.c b/client/cmdhfmfu.c index c38d8355b..4f31f89bb 100644 --- a/client/cmdhfmfu.c +++ b/client/cmdhfmfu.c @@ -459,7 +459,7 @@ static char *getUlev1CardSizeStr(uint8_t fsize) { static void ul_switch_on_field(void) { clearCommandBuffer(); - SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_DISCONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0); } static int ul_send_cmd_raw(uint8_t *cmd, uint8_t cmdlen, uint8_t *response, uint16_t responseLength) { @@ -2485,7 +2485,7 @@ static int CmdHF14AMfUCSetUid(const char *Cmd) { // read block2. clearCommandBuffer(); - SendCommandOLD(CMD_MIFAREU_READBL, 2, 0, 0, NULL, 0); + SendCommandMIX(CMD_MIFAREU_READBL, 2, 0, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) { PrintAndLogEx(WARNING, "Command execute timeout"); return 2; @@ -2543,7 +2543,7 @@ static int CmdHF14AMfUGenDiverseKeys(const char *Cmd) { if (cmdp == 'r') { // read uid from tag clearCommandBuffer(); - SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0); PacketResponseNG resp; WaitForResponse(CMD_ACK, &resp); iso14a_card_select_t card; @@ -2657,7 +2657,7 @@ static int CmdHF14AMfUPwdGen(const char *Cmd) { if (cmdp == 'r') { // read uid from tag clearCommandBuffer(); - SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0, NULL, 0); PacketResponseNG resp; WaitForResponse(CMD_ACK, &resp); iso14a_card_select_t card; diff --git a/client/cmdhftopaz.c b/client/cmdhftopaz.c index 284cdc1f9..dc5064359 100644 --- a/client/cmdhftopaz.c +++ b/client/cmdhftopaz.c @@ -31,11 +31,11 @@ static struct { } topaz_tag; static void topaz_switch_on_field(void) { - SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_SELECT | ISO14A_NO_DISCONNECT | ISO14A_TOPAZMODE | ISO14A_NO_RATS, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_ISO_14443a, ISO14A_CONNECT | ISO14A_NO_SELECT | ISO14A_NO_DISCONNECT | ISO14A_TOPAZMODE | ISO14A_NO_RATS, 0, 0, NULL, 0); } static void topaz_switch_off_field(void) { - SendCommandOLD(CMD_READER_ISO_14443a, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_READER_ISO_14443a, NULL, 0); } // send a raw topaz command, returns the length of the response (0 in case of error) diff --git a/client/cmdhw.c b/client/cmdhw.c index f086b4c99..7a8906cd3 100644 --- a/client/cmdhw.c +++ b/client/cmdhw.c @@ -362,7 +362,7 @@ static int CmdDetectReader(const char *Cmd) { } clearCommandBuffer(); - SendCommandOLD(CMD_LISTEN_READER_FIELD, arg, 0, 0, NULL, 0); + SendCommandMIX(CMD_LISTEN_READER_FIELD, arg, 0, 0, NULL, 0); return PM3_SUCCESS; } @@ -370,7 +370,7 @@ static int CmdDetectReader(const char *Cmd) { static int CmdFPGAOff(const char *Cmd) { (void)Cmd; // Cmd is not used so far clearCommandBuffer(); - SendCommandMIX(CMD_FPGA_MAJOR_MODE_OFF, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_FPGA_MAJOR_MODE_OFF, NULL, 0); return PM3_SUCCESS; } @@ -379,27 +379,27 @@ static int CmdLCD(const char *Cmd) { sscanf(Cmd, "%x %d", &i, &j); while (j--) { clearCommandBuffer(); - SendCommandOLD(CMD_LCD, i & 0x1ff, 0, 0, NULL, 0); + SendCommandMIX(CMD_LCD, i & 0x1ff, 0, 0, NULL, 0); } return PM3_SUCCESS; } static int CmdLCDReset(const char *Cmd) { clearCommandBuffer(); - SendCommandOLD(CMD_LCD_RESET, strtol(Cmd, NULL, 0), 0, 0, NULL, 0); + SendCommandMIX(CMD_LCD_RESET, strtol(Cmd, NULL, 0), 0, 0, NULL, 0); return PM3_SUCCESS; } static int CmdReadmem(const char *Cmd) { clearCommandBuffer(); - SendCommandOLD(CMD_READ_MEM, strtol(Cmd, NULL, 0), 0, 0, NULL, 0); + SendCommandMIX(CMD_READ_MEM, strtol(Cmd, NULL, 0), 0, 0, NULL, 0); return PM3_SUCCESS; } static int CmdReset(const char *Cmd) { (void)Cmd; // Cmd is not used so far clearCommandBuffer(); - SendCommandMIX(CMD_HARDWARE_RESET, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_HARDWARE_RESET, NULL, 0); return PM3_SUCCESS; } @@ -416,7 +416,7 @@ static int CmdSetDivisor(const char *Cmd) { } // 12 000 000 (12Mhz) clearCommandBuffer(); - SendCommandOLD(CMD_SET_LF_DIVISOR, arg, 0, 0, NULL, 0); + SendCommandMIX(CMD_SET_LF_DIVISOR, arg, 0, 0, NULL, 0); PrintAndLogEx(SUCCESS, "Divisor set, expected %.1f KHz", ((double)12000 / (arg + 1))); return PM3_SUCCESS; } @@ -440,7 +440,7 @@ static int CmdSetMux(const char *Cmd) { return PM3_EINVARG; } clearCommandBuffer(); - SendCommandOLD(CMD_SET_ADC_MUX, arg, 0, 0, NULL, 0); + SendCommandMIX(CMD_SET_ADC_MUX, arg, 0, 0, NULL, 0); return PM3_SUCCESS; } @@ -458,7 +458,7 @@ static int CmdStatus(const char *Cmd) { (void)Cmd; // Cmd is not used so far clearCommandBuffer(); PacketResponseNG resp; - SendCommandMIX(CMD_STATUS, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_STATUS, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) PrintAndLogEx(WARNING, "Status command failed. Communication speed test timed out"); return PM3_SUCCESS; @@ -468,7 +468,7 @@ static int CmdPing(const char *Cmd) { (void)Cmd; // Cmd is not used so far clearCommandBuffer(); PacketResponseNG resp; - SendCommandMIX(CMD_PING, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_PING, NULL, 0); if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) PrintAndLogEx(SUCCESS, "Ping " _GREEN_("successful")); else @@ -568,7 +568,7 @@ void pm3_version(bool verbose) { PacketResponseNG resp; clearCommandBuffer(); - SendCommandMIX(CMD_VERSION, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_VERSION, NULL, 0); if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) { PrintAndLogEx(NORMAL, "\n" _BLUE_(" [ Proxmark3 RFID instrument ]") "\n"); diff --git a/client/cmdlf.c b/client/cmdlf.c index 163d9e4b7..85f876d27 100644 --- a/client/cmdlf.c +++ b/client/cmdlf.c @@ -335,7 +335,7 @@ int CmdLFSetConfig(const char *Cmd) { bool lf_read(bool silent, uint32_t samples) { if (!session.pm3_present) return false; clearCommandBuffer(); - SendCommandOLD(CMD_ACQUIRE_RAW_ADC_SAMPLES_125K, silent, samples, 0, NULL, 0); + SendCommandMIX(CMD_ACQUIRE_RAW_ADC_SAMPLES_125K, silent, samples, 0, NULL, 0); PacketResponseNG resp; if (g_lf_threshold_set) { @@ -390,7 +390,7 @@ int CmdLFSniff(const char *Cmd) { if (cmdp == 'h') return usage_lf_sniff(); clearCommandBuffer(); - SendCommandMIX(CMD_LF_SNIFF_RAW_ADC_SAMPLES, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_LF_SNIFF_RAW_ADC_SAMPLES, NULL, 0); WaitForResponse(CMD_ACK, NULL); getSamples(0, false); return 0; @@ -438,7 +438,7 @@ int CmdLFSim(const char *Cmd) { PrintAndLogEx(NORMAL, "Simulating"); clearCommandBuffer(); - SendCommandOLD(CMD_SIMULATE_TAG_125K, GraphTraceLen, gap, 0, NULL, 0); + SendCommandMIX(CMD_SIMULATE_TAG_125K, GraphTraceLen, gap, 0, NULL, 0); return 0; } @@ -722,7 +722,7 @@ int CmdLFSimBidir(const char *Cmd) { // Set ADC to twice the carrier for a slight supersampling // HACK: not implemented in ARMSRC. PrintAndLogEx(INFO, "Not implemented yet."); - SendCommandOLD(CMD_LF_SIMULATE_BIDIR, 47, 384, 0, NULL, 0); + SendCommandMIX(CMD_LF_SIMULATE_BIDIR, 47, 384, 0, NULL, 0); return 0; } diff --git a/client/cmdlfawid.c b/client/cmdlfawid.c index 046df1ce9..8e29e77bf 100644 --- a/client/cmdlfawid.c +++ b/client/cmdlfawid.c @@ -87,9 +87,9 @@ static int usage_lf_awid_brute(void) { } static bool sendPing(void) { - SendCommandOLD(CMD_PING, 1, 2, 3, NULL, 0); - SendCommandOLD(CMD_PING, 1, 2, 3, NULL, 0); - SendCommandOLD(CMD_PING, 1, 2, 3, NULL, 0); + SendCommandMIX(CMD_PING, 1, 2, 3, NULL, 0); + SendCommandMIX(CMD_PING, 1, 2, 3, NULL, 0); + SendCommandMIX(CMD_PING, 1, 2, 3, NULL, 0); clearCommandBuffer(); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)) @@ -167,7 +167,7 @@ static int CmdAWIDRead_device(const char *Cmd) { if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_awid_read(); uint8_t findone = (Cmd[0] == '1') ? 1 : 0; clearCommandBuffer(); - SendCommandOLD(CMD_AWID_DEMOD_FSK, findone, 0, 0, NULL, 0); + SendCommandMIX(CMD_AWID_DEMOD_FSK, findone, 0, 0, NULL, 0); return 0; } */ @@ -385,7 +385,7 @@ static int CmdAWIDClone(const char *Cmd) { for (uint8_t i = 0; i < 4; i++) { clearCommandBuffer(); - SendCommandOLD(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); + SendCommandMIX(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) { PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); return -1; diff --git a/client/cmdlfcotag.c b/client/cmdlfcotag.c index 9875d969f..45de81aff 100644 --- a/client/cmdlfcotag.c +++ b/client/cmdlfcotag.c @@ -75,7 +75,7 @@ static int CmdCOTAGRead(const char *Cmd) { sscanf(Cmd, "%u", &rawsignal); clearCommandBuffer(); - SendCommandOLD(CMD_COTAG, rawsignal, 0, 0, NULL, 0); + SendCommandMIX(CMD_COTAG, rawsignal, 0, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, NULL, 7000)) { PrintAndLogEx(WARNING, "command execution time out"); return -1; diff --git a/client/cmdlfem4x.c b/client/cmdlfem4x.c index dc06f02d5..35d486fc8 100644 --- a/client/cmdlfem4x.c +++ b/client/cmdlfem4x.c @@ -389,7 +389,7 @@ int AskEm410xDemod(const char *Cmd, uint32_t *hi, uint64_t *lo, bool verbose) { static int CmdEM410xRead_device(const char *Cmd) { char cmdp = tolower(param_getchar(Cmd, 0)); uint8_t findone = (cmdp == '1') ? 1 : 0; - SendCommandOLD(CMD_EM410X_DEMOD, findone, 0, 0, NULL, 0); + SendCommandMIX(CMD_EM410X_DEMOD, findone, 0, 0, NULL, 0); return 0; } */ @@ -647,7 +647,7 @@ static int CmdEM410xWrite(const char *Cmd) { return 0; } - SendCommandOLD(CMD_EM410X_WRITE_TAG, card, (uint32_t)(id >> 32), (uint32_t)id, NULL, 0); + SendCommandMIX(CMD_EM410X_WRITE_TAG, card, (uint32_t)(id >> 32), (uint32_t)id, NULL, 0); return 0; } @@ -1126,7 +1126,7 @@ static bool demodEM4x05resp(uint32_t *word) { //////////////// 4205 / 4305 commands static int EM4x05ReadWord_ext(uint8_t addr, uint32_t pwd, bool usePwd, uint32_t *word) { clearCommandBuffer(); - SendCommandOLD(CMD_EM4X_READ_WORD, addr, pwd, usePwd, NULL, 0); + SendCommandMIX(CMD_EM4X_READ_WORD, addr, pwd, usePwd, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { PrintAndLogEx(DEBUG, "timeout while waiting for reply."); @@ -1228,7 +1228,7 @@ static int CmdEM4x05Write(const char *Cmd) { uint16_t flag = (addr << 8) | (usePwd); clearCommandBuffer(); - SendCommandOLD(CMD_EM4X_WRITE_WORD, flag, data, pwd, NULL, 0); + SendCommandMIX(CMD_EM4X_WRITE_WORD, flag, data, pwd, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) { PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); diff --git a/client/cmdlffdx.c b/client/cmdlffdx.c index 6ad487888..d652673e8 100644 --- a/client/cmdlffdx.c +++ b/client/cmdlffdx.c @@ -285,7 +285,7 @@ static int CmdFdxClone(const char *Cmd) { for (int i = 4; i >= 0; --i) { clearCommandBuffer(); - SendCommandOLD(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); + SendCommandMIX(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) { PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); return -1; diff --git a/client/cmdlfguard.c b/client/cmdlfguard.c index 420398b66..a01b6dbaa 100644 --- a/client/cmdlfguard.c +++ b/client/cmdlfguard.c @@ -175,7 +175,7 @@ static int CmdGuardClone(const char *Cmd) { for (i = 0; i < 4; ++i) { clearCommandBuffer(); - SendCommandOLD(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); + SendCommandMIX(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) { PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); return -1; diff --git a/client/cmdlfhid.c b/client/cmdlfhid.c index 13ab591fa..fc9decced 100644 --- a/client/cmdlfhid.c +++ b/client/cmdlfhid.c @@ -93,9 +93,9 @@ static int usage_lf_hid_brute(void) { // sending three times. Didn't seem to break the previous sim? static bool sendPing(void) { - SendCommandOLD(CMD_PING, 1, 2, 3, NULL, 0); - SendCommandOLD(CMD_PING, 1, 2, 3, NULL, 0); - SendCommandOLD(CMD_PING, 1, 2, 3, NULL, 0); + SendCommandMIX(CMD_PING, 1, 2, 3, NULL, 0); + SendCommandMIX(CMD_PING, 1, 2, 3, NULL, 0); + SendCommandMIX(CMD_PING, 1, 2, 3, NULL, 0); clearCommandBuffer(); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)) @@ -111,7 +111,7 @@ static bool sendTry(uint8_t fmtlen, uint32_t fc, uint32_t cn, uint32_t delay, ui calcWiegand(fmtlen, fc, cn, bits, 0); clearCommandBuffer(); - SendCommandOLD(CMD_HID_SIM_TAG, bytebits_to_byte(bits, 32), bytebits_to_byte(bits + 32, 32), 0, NULL, 0); + SendCommandMIX(CMD_HID_SIM_TAG, bytebits_to_byte(bits, 32), bytebits_to_byte(bits + 32, 32), 0, NULL, 0); msleep(delay); sendPing(); @@ -239,7 +239,7 @@ static int CmdHIDRead_device(const char *Cmd) { if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_hid_read(); uint8_t findone = (Cmd[0] == '1') ? 1 : 0; clearCommandBuffer(); - SendCommandOLD(CMD_HID_DEMOD_FSK, findone, 0, 0, NULL, 0); + SendCommandMIX(CMD_HID_DEMOD_FSK, findone, 0, 0, NULL, 0); return 0; } */ @@ -259,7 +259,7 @@ static int CmdHIDSim(const char *Cmd) { PrintAndLogEx(SUCCESS, "Press pm3-button to abort simulation"); clearCommandBuffer(); - SendCommandOLD(CMD_HID_SIM_TAG, hi, lo, 0, NULL, 0); + SendCommandMIX(CMD_HID_SIM_TAG, hi, lo, 0, NULL, 0); return 0; } diff --git a/client/cmdlfhitag.c b/client/cmdlfhitag.c index 86eb3930a..0c48b22de 100644 --- a/client/cmdlfhitag.c +++ b/client/cmdlfhitag.c @@ -261,7 +261,7 @@ static int CmdLFHitagSniff(const char *Cmd) { if (ctmp == 'h') return usage_hitag_sniff(); clearCommandBuffer(); - SendCommandOLD(CMD_SNIFF_HITAG, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_SNIFF_HITAG, NULL, 0); return 0; } @@ -339,7 +339,7 @@ static int CmdLFHitagSim(const char *Cmd) { if (tag_mem_supplied) { SendCommandOLD(cmd, 1, 0, 0, data, datalen); } else { - SendCommandOLD(cmd, 0, 0, 0, NULL, 0); + SendCommandNG(cmd, NULL, 0); } free(data); @@ -457,7 +457,7 @@ static void printHitagConfiguration(uint8_t config) { static bool getHitagUid(uint32_t *uid) { clearCommandBuffer(); - SendCommandOLD(CMD_READER_HITAG, RHT2F_UID_ONLY, 0, 0, NULL, 0); + SendCommandMIX(CMD_READER_HITAG, RHT2F_UID_ONLY, 0, 0, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { PrintAndLogEx(WARNING, "timeout while waiting for reply."); @@ -632,7 +632,7 @@ static int CmdLFHitagCheckChallenges(const char *Cmd) { if (file_given) SendCommandOLD(CMD_TEST_HITAGS_TRACES, 1, 0, 0, data, datalen); else - SendCommandOLD(CMD_TEST_HITAGS_TRACES, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_TEST_HITAGS_TRACES, NULL, 0); free(data); return 0; diff --git a/client/cmdlfio.c b/client/cmdlfio.c index 16214052b..50e0ae9d8 100644 --- a/client/cmdlfio.c +++ b/client/cmdlfio.c @@ -67,7 +67,7 @@ static int CmdIOProxRead_device(const char *Cmd) { if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_io_read(); int findone = (Cmd[0] == '1') ? 1 : 0; clearCommandBuffer(); - SendCommandOLD(CMD_IO_DEMOD_FSK, findone, 0, 0, NULL, 0); + SendCommandMIX(CMD_IO_DEMOD_FSK, findone, 0, 0, NULL, 0); return 0; } */ @@ -252,7 +252,7 @@ static int CmdIOProxClone(const char *Cmd) { print_blocks(blocks, 3); clearCommandBuffer(); - SendCommandOLD(CMD_IO_CLONE_TAG, blocks[1], blocks[2], 0, NULL, 0); + SendCommandMIX(CMD_IO_CLONE_TAG, blocks[1], blocks[2], 0, NULL, 0); return 0; } diff --git a/client/cmdlfjablotron.c b/client/cmdlfjablotron.c index c31923510..4fea2b1b9 100644 --- a/client/cmdlfjablotron.c +++ b/client/cmdlfjablotron.c @@ -159,7 +159,7 @@ static int CmdJablotronClone(const char *Cmd) { for (uint8_t i = 0; i < 3; i++) { clearCommandBuffer(); - SendCommandOLD(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); + SendCommandMIX(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) { PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); return -1; diff --git a/client/cmdlfkeri.c b/client/cmdlfkeri.c index 8d0111914..f722837ba 100644 --- a/client/cmdlfkeri.c +++ b/client/cmdlfkeri.c @@ -150,7 +150,7 @@ static int CmdKeriClone(const char *Cmd) { for (uint8_t i = 0; i < 3; i++) { clearCommandBuffer(); - SendCommandOLD(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); + SendCommandMIX(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) { PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); return -1; diff --git a/client/cmdlfnedap.c b/client/cmdlfnedap.c index e4a09ad34..ff5800322 100644 --- a/client/cmdlfnedap.c +++ b/client/cmdlfnedap.c @@ -206,7 +206,7 @@ static int CmdLFNedapClone(const char *Cmd) { for (uint8_t i = 0; i<5; ++i ) { clearCommandBuffer(); - SendCommandOLD(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); + SendCommandMIX(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)){ PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); return -1; diff --git a/client/cmdlfnoralsy.c b/client/cmdlfnoralsy.c index 417ac534f..9455ce916 100644 --- a/client/cmdlfnoralsy.c +++ b/client/cmdlfnoralsy.c @@ -158,7 +158,7 @@ static int CmdNoralsyClone(const char *Cmd) { for (uint8_t i = 0; i < 4; i++) { clearCommandBuffer(); - SendCommandOLD(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); + SendCommandMIX(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) { PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); return -1; diff --git a/client/cmdlfpcf7931.c b/client/cmdlfpcf7931.c index 1574cd033..c9f5711ef 100644 --- a/client/cmdlfpcf7931.c +++ b/client/cmdlfpcf7931.c @@ -101,7 +101,7 @@ static int CmdLFPCF7931Read(const char *Cmd) { PacketResponseNG resp; clearCommandBuffer(); - SendCommandOLD(CMD_PCF7931_READ, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_PCF7931_READ, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { PrintAndLogEx(WARNING, "command execution time out"); return 1; diff --git a/client/cmdlfpresco.c b/client/cmdlfpresco.c index e81a436fa..8222bb0be 100644 --- a/client/cmdlfpresco.c +++ b/client/cmdlfpresco.c @@ -124,7 +124,7 @@ static int CmdPrescoClone(const char *Cmd) { for (uint8_t i = 0; i < 5; i++) { clearCommandBuffer(); - SendCommandOLD(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); + SendCommandMIX(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) { PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); return -1; diff --git a/client/cmdlfpyramid.c b/client/cmdlfpyramid.c index 351299204..0823abb77 100644 --- a/client/cmdlfpyramid.c +++ b/client/cmdlfpyramid.c @@ -236,7 +236,7 @@ static int CmdPyramidClone(const char *Cmd) { for (uint8_t i = 0; i < 5; ++i) { clearCommandBuffer(); - SendCommandOLD(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); + SendCommandMIX(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) { PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); return -1; diff --git a/client/cmdlft55xx.c b/client/cmdlft55xx.c index cb21ef215..12cb5846a 100644 --- a/client/cmdlft55xx.c +++ b/client/cmdlft55xx.c @@ -1019,7 +1019,7 @@ static int CmdT55xxWakeUp(const char *Cmd) { if (errors) return usage_t55xx_wakup(); clearCommandBuffer(); - SendCommandOLD(CMD_T55XX_WAKEUP, password, 0, 0, NULL, 0); + SendCommandMIX(CMD_T55XX_WAKEUP, password, 0, 0, NULL, 0); PrintAndLogEx(SUCCESS, "Wake up command sent. Try read now"); return 0; } @@ -1516,7 +1516,7 @@ bool AquireData(uint8_t page, uint8_t block, bool pwdmode, uint32_t password) { // arg2: password uint8_t arg0 = (page << 1 | (pwdmode)); clearCommandBuffer(); - SendCommandOLD(CMD_T55XX_READ_BLOCK, arg0, block, password, NULL, 0); + SendCommandMIX(CMD_T55XX_READ_BLOCK, arg0, block, password, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, NULL, 2500)) { PrintAndLogEx(WARNING, "command execution time out"); return false; @@ -1775,7 +1775,7 @@ static void t55x7_create_config_block(int tagtype) { static int CmdResetRead(const char *Cmd) { (void)Cmd; // Cmd is not used so far clearCommandBuffer(); - SendCommandOLD(CMD_T55XX_RESET_READ, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_T55XX_RESET_READ, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, NULL, 2500)) { PrintAndLogEx(WARNING, "command execution time out"); return 0; @@ -1855,7 +1855,7 @@ static int CmdT55xxChkPwds(const char *Cmd) { if (cmdp == 'm') { clearCommandBuffer(); - SendCommandOLD(CMD_T55XX_CHKPWDS, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_T55XX_CHKPWDS, NULL, 0); PacketResponseNG resp; while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) { diff --git a/client/cmdlfti.c b/client/cmdlfti.c index 3c6b22ed1..03017f949 100644 --- a/client/cmdlfti.c +++ b/client/cmdlfti.c @@ -276,7 +276,7 @@ out: static int CmdTIRead(const char *Cmd) { (void)Cmd; // Cmd is not used so far clearCommandBuffer(); - SendCommandOLD(CMD_READ_TI_TYPE, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_READ_TI_TYPE, NULL, 0); return 0; } @@ -294,7 +294,7 @@ static int CmdTIWrite(const char *Cmd) { return 1; } clearCommandBuffer(); - SendCommandOLD(CMD_WRITE_TI_TYPE, arg0, arg1, arg2, NULL, 0); + SendCommandMIX(CMD_WRITE_TI_TYPE, arg0, arg1, arg2, NULL, 0); return 0; } diff --git a/client/cmdlfviking.c b/client/cmdlfviking.c index d21c30076..75b84bed4 100644 --- a/client/cmdlfviking.c +++ b/client/cmdlfviking.c @@ -89,7 +89,7 @@ static int CmdVikingClone(const char *Cmd) { PrintAndLogEx(INFO, "Preparing to clone Viking tag - ID: %08X, Raw: %08X%08X", id, (uint32_t)(rawID >> 32), (uint32_t)(rawID & 0xFFFFFFFF)); clearCommandBuffer(); - SendCommandOLD(CMD_VIKING_CLONE_TAG, rawID >> 32, rawID & 0xFFFFFFFF, Q5, NULL, 0); + SendCommandMIX(CMD_VIKING_CLONE_TAG, rawID >> 32, rawID & 0xFFFFFFFF, Q5, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) { PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); diff --git a/client/cmdlfvisa2000.c b/client/cmdlfvisa2000.c index f0b7c7c13..2980b0a5c 100644 --- a/client/cmdlfvisa2000.c +++ b/client/cmdlfvisa2000.c @@ -170,7 +170,7 @@ static int CmdVisa2kClone(const char *Cmd) { for (uint8_t i = 0; i < 4; i++) { clearCommandBuffer(); - SendCommandOLD(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); + SendCommandMIX(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, NULL, 0); if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) { PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); return -1; diff --git a/client/cmdsmartcard.c b/client/cmdsmartcard.c index 342aa67f4..973dc29a6 100644 --- a/client/cmdsmartcard.c +++ b/client/cmdsmartcard.c @@ -664,7 +664,7 @@ static int CmdSmartUpgrade(const char *Cmd) { // trigger the firmware upgrade clearCommandBuffer(); - SendCommandOLD(CMD_SMART_UPGRADE, firmware_size, 0, 0, NULL, 0); + SendCommandMIX(CMD_SMART_UPGRADE, firmware_size, 0, 0, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { PrintAndLogEx(WARNING, "timeout while waiting for reply."); @@ -702,7 +702,7 @@ static int CmdSmartInfo(const char *Cmd) { if (errors) return usage_sm_info(); clearCommandBuffer(); - SendCommandOLD(CMD_SMART_ATR, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_SMART_ATR, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (!silent) PrintAndLogEx(WARNING, "smart card select failed"); @@ -776,7 +776,7 @@ static int CmdSmartReader(const char *Cmd) { if (errors) return usage_sm_reader(); clearCommandBuffer(); - SendCommandOLD(CMD_SMART_ATR, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_SMART_ATR, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (!silent) PrintAndLogEx(WARNING, "smart card select failed"); @@ -821,7 +821,7 @@ static int CmdSmartSetClock(const char *Cmd) { if (errors || cmdp == 0) return usage_sm_setclock(); clearCommandBuffer(); - SendCommandOLD(CMD_SMART_SETCLOCK, clock1, 0, 0, NULL, 0); + SendCommandMIX(CMD_SMART_SETCLOCK, clock1, 0, 0, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { PrintAndLogEx(WARNING, "smart card select failed"); @@ -1185,7 +1185,7 @@ bool smart_select(bool silent, smart_card_atr_t *atr) { memset(atr, 0, sizeof(smart_card_atr_t)); clearCommandBuffer(); - SendCommandOLD(CMD_SMART_ATR, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_SMART_ATR, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (!silent) PrintAndLogEx(WARNING, "smart card select failed"); diff --git a/client/deprecated-hid-flasher/flasher/flash.c b/client/deprecated-hid-flasher/flasher/flash.c index e7a7a774e..9091cc12f 100644 --- a/client/deprecated-hid-flasher/flasher/flash.c +++ b/client/deprecated-hid-flasher/flasher/flash.c @@ -260,7 +260,7 @@ fail: // Get the state of the proxmark, backwards compatible static int get_proxmark_state(uint32_t *state) { - SendCommandOLD(CMD_DEVICE_INFO, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_DEVICE_INFO, NULL, 0); PacketResponseOLD resp; ReceiveCommand(&resp); @@ -307,11 +307,11 @@ static int enter_bootloader(void) { && (state & DEVICE_INFO_FLAG_OSIMAGE_PRESENT)) { // New style handover: Send CMD_START_FLASH, which will reset the board // and enter the bootrom on the next boot. - SendCommandOLD(CMD_START_FLASH, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_START_FLASH, NULL, 0); fprintf(stderr, "(Press and release the button only to abort)\n"); } else { // Old style handover: Ask the user to press the button, then reset the board - SendCommandOLD(CMD_HARDWARE_RESET, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_HARDWARE_RESET, NULL, 0); fprintf(stderr, "Press and hold down button NOW if your bootloader requires it.\n"); } fprintf(stderr, "Waiting for Proxmark3 to reappear on USB..."); @@ -356,9 +356,9 @@ int flash_start_flashing(int enable_bl_writes) { // This command is stupid. Why the heck does it care which area we're // flashing, as long as it's not the bootloader area? The mind boggles. if (enable_bl_writes) { - SendCommandOLD(CMD_START_FLASH, FLASH_START, FLASH_END, START_FLASH_MAGIC, NULL, 0); + SendCommandMIX(CMD_START_FLASH, FLASH_START, FLASH_END, START_FLASH_MAGIC, NULL, 0); } else { - SendCommandOLD(CMD_START_FLASH, BOOTLOADER_END, FLASH_END, 0, NULL, 0); + SendCommandMIX(CMD_START_FLASH, BOOTLOADER_END, FLASH_END, 0, NULL, 0); } return wait_for_ack(); } else { @@ -440,7 +440,7 @@ void flash_free(flash_file_t *ctx) { // just reset the unit int flash_stop_flashing(void) { - SendCommandOLD(CMD_HARDWARE_RESET, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_HARDWARE_RESET, NULL, 0); msleep(100); return 0; } diff --git a/client/flash.c b/client/flash.c index 322fc3e49..b3ad88859 100644 --- a/client/flash.c +++ b/client/flash.c @@ -259,7 +259,7 @@ fail: // Get the state of the proxmark, backwards compatible static int get_proxmark_state(uint32_t *state) { - SendCommandOLD(CMD_DEVICE_INFO, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_DEVICE_INFO, NULL, 0); PacketResponseNG resp; WaitForResponse(CMD_UNKNOWN, &resp); // wait for any response. No timeout. @@ -304,11 +304,11 @@ static int enter_bootloader(char *serial_port_name) { && (state & DEVICE_INFO_FLAG_OSIMAGE_PRESENT)) { // New style handover: Send CMD_START_FLASH, which will reset the board // and enter the bootrom on the next boot. - SendCommandOLD(CMD_START_FLASH, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_START_FLASH, NULL, 0); PrintAndLogEx(SUCCESS, "(Press and release the button only to " _YELLOW_("abort") ")"); } else { // Old style handover: Ask the user to press the button, then reset the board - SendCommandOLD(CMD_HARDWARE_RESET, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_HARDWARE_RESET, NULL, 0); PrintAndLogEx(SUCCESS, "Press and hold down button NOW if your bootloader requires it."); } msleep(100); @@ -359,9 +359,9 @@ int flash_start_flashing(int enable_bl_writes, char *serial_port_name) { PacketResponseNG resp; if (enable_bl_writes) { - SendCommandOLD(CMD_START_FLASH, FLASH_START, FLASH_END, START_FLASH_MAGIC, NULL, 0); + SendCommandMIX(CMD_START_FLASH, FLASH_START, FLASH_END, START_FLASH_MAGIC, NULL, 0); } else { - SendCommandOLD(CMD_START_FLASH, BOOTLOADER_END, FLASH_END, 0, NULL, 0); + SendCommandMIX(CMD_START_FLASH, BOOTLOADER_END, FLASH_END, 0, NULL, 0); } return wait_for_ack(&resp); } else { @@ -445,7 +445,7 @@ void flash_free(flash_file_t *ctx) { // just reset the unit int flash_stop_flashing(void) { - SendCommandOLD(CMD_HARDWARE_RESET, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_HARDWARE_RESET, NULL, 0); msleep(100); return 0; } diff --git a/client/mifare/mifarehost.c b/client/mifare/mifarehost.c index e071e5a7d..b64f07105 100644 --- a/client/mifare/mifarehost.c +++ b/client/mifare/mifarehost.c @@ -25,7 +25,7 @@ int mfDarkside(uint8_t blockno, uint8_t key_type, uint64_t *key) { while (true) { clearCommandBuffer(); - SendCommandOLD(CMD_READER_MIFARE, arg0, blockno, key_type, NULL, 0); + SendCommandMIX(CMD_READER_MIFARE, arg0, blockno, key_type, NULL, 0); //flush queue while (ukbhit()) { @@ -446,7 +446,7 @@ int mfReadSector(uint8_t sectorNo, uint8_t keyType, uint8_t *key, uint8_t *data) // EMULATOR int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount) { clearCommandBuffer(); - SendCommandOLD(CMD_MIFARE_EML_MEMGET, blockNum, blocksCount, 0, NULL, 0); + SendCommandMIX(CMD_MIFARE_EML_MEMGET, blockNum, blocksCount, 0, NULL, 0); PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) return PM3_ETIMEOUT; memcpy(data, resp.data.asBytes, blocksCount * 16); @@ -517,7 +517,7 @@ int mfCSetBlock(uint8_t blockNo, uint8_t *data, uint8_t *uid, uint8_t params) { int mfCGetBlock(uint8_t blockNo, uint8_t *data, uint8_t params) { clearCommandBuffer(); - SendCommandOLD(CMD_MIFARE_CGETBLOCK, params, blockNo, 0, NULL, 0); + SendCommandMIX(CMD_MIFARE_CGETBLOCK, params, blockNo, 0, NULL, 0); PacketResponseNG resp; if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) { uint8_t isOK = resp.oldarg[0] & 0xff; @@ -906,7 +906,7 @@ returns: int detect_classic_nackbug(bool verbose) { clearCommandBuffer(); - SendCommandMIX(CMD_MIFARE_NACK_DETECT, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_MIFARE_NACK_DETECT, NULL, 0); PacketResponseNG resp; if (verbose) @@ -991,7 +991,7 @@ void detect_classic_magic(void) { uint8_t isGeneration = 0; PacketResponseNG resp; clearCommandBuffer(); - SendCommandMIX(CMD_MIFARE_CIDENT, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_MIFARE_CIDENT, NULL, 0); if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) isGeneration = resp.oldarg[0] & 0xff; diff --git a/client/scripting.c b/client/scripting.c index 468c63cfa..c8fa2f163 100644 --- a/client/scripting.c +++ b/client/scripting.c @@ -45,7 +45,7 @@ static int l_fast_push_mode(lua_State *L) { // Disable fast mode and send a dummy command to make it effective if (enable == false) { - SendCommandMIX(CMD_PING, 0, 0, 0, NULL, 0); + SendCommandNG(CMD_PING, NULL, 0); WaitForResponseTimeout(CMD_ACK, NULL, 1000); } @@ -86,7 +86,7 @@ static int l_SendCommand(lua_State *L) { * @return */ static int l_SendCommandOLD(lua_State *L) { -// SendCommandOLD(CMD_HF_SNIFFER, skippairs, skiptriggers, 0, NULL, 0); +// SendCommandMIX(CMD_HF_SNIFFER, skippairs, skiptriggers, 0, NULL, 0); // (uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *data, size_t len) uint64_t cmd, arg0, arg1, arg2;