Automated upgrades SendCommandOLD/MIX 0,0,0,NULL,0 -> NG and SendCommandOLD ....,NULL,0 -> MIX

This commit is contained in:
Philippe Teuwen 2019-05-07 19:51:33 +02:00
parent 39272ba1fb
commit 290f2b625b
43 changed files with 144 additions and 144 deletions

View file

@ -876,7 +876,7 @@ static int CmdBuffClear(const char *Cmd) {
if (cmdp == 'h') return usage_data_buffclear(); if (cmdp == 'h') return usage_data_buffclear();
clearCommandBuffer(); clearCommandBuffer();
SendCommandMIX(CMD_BUFF_CLEAR, 0, 0, 0, NULL, 0); SendCommandNG(CMD_BUFF_CLEAR, NULL, 0);
ClearGraph(true); ClearGraph(true);
return 0; return 0;
} }
@ -1530,7 +1530,7 @@ int CmdTuneSamples(const char *Cmd) {
PrintAndLogEx(INFO, "\nMeasuring antenna characteristics, please wait..."); PrintAndLogEx(INFO, "\nMeasuring antenna characteristics, please wait...");
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_MEASURE_ANTENNA_TUNING, 0, 0, 0, NULL, 0); SendCommandNG(CMD_MEASURE_ANTENNA_TUNING, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
while (!WaitForResponseTimeout(CMD_MEASURED_ANTENNA_TUNING, &resp, 2000)) { while (!WaitForResponseTimeout(CMD_MEASURED_ANTENNA_TUNING, &resp, 2000)) {
timeout++; timeout++;

View file

@ -457,7 +457,7 @@ static int CmdFlashMemInfo(const char *Cmd) {
} }
clearCommandBuffer(); clearCommandBuffer();
SendCommandMIX(CMD_FLASHMEM_INFO, 0, 0, 0, NULL, 0); SendCommandNG(CMD_FLASHMEM_INFO, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
PrintAndLogEx(WARNING, "timeout while waiting for reply."); PrintAndLogEx(WARNING, "timeout while waiting for reply.");

View file

@ -104,7 +104,7 @@ int CmdHFSniff(const char *Cmd) {
int skiptriggers = param_get32ex(Cmd, 1, 0, 10); int skiptriggers = param_get32ex(Cmd, 1, 0, 10);
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_HF_SNIFFER, skippairs, skiptriggers, 0, NULL, 0); SendCommandMIX(CMD_HF_SNIFFER, skippairs, skiptriggers, 0, NULL, 0);
return 0; return 0;
} }

View file

@ -228,7 +228,7 @@ static int CmdHF14AList(const char *Cmd) {
} }
int Hf14443_4aGetCardData(iso14a_card_select_t *card) { 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; PacketResponseNG resp;
WaitForResponse(CMD_ACK, &resp); WaitForResponse(CMD_ACK, &resp);
@ -298,7 +298,7 @@ static int CmdHF14AReader(const char *Cmd) {
cm |= ISO14A_NO_DISCONNECT; cm |= ISO14A_NO_DISCONNECT;
clearCommandBuffer(); 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) { if (ISO14A_CONNECT & cm) {
PacketResponseNG resp; PacketResponseNG resp;
@ -383,7 +383,7 @@ static int CmdHF14ACUIDs(const char *Cmd) {
} }
// execute anticollision procedure // 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; PacketResponseNG resp;
WaitForResponse(CMD_ACK, &resp); WaitForResponse(CMD_ACK, &resp);
@ -508,7 +508,7 @@ int CmdHF14ASniff(const char *Cmd) {
if (ctmp == 'r') param |= 0x02; if (ctmp == 'r') param |= 0x02;
} }
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_SNIFF_ISO_14443a, param, 0, 0, NULL, 0); SendCommandMIX(CMD_SNIFF_ISO_14443a, param, 0, 0, NULL, 0);
return 0; return 0;
} }
@ -522,7 +522,7 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
PacketResponseNG resp; PacketResponseNG resp;
// Anticollision + SELECT card // 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
PrintAndLogEx(ERR, "Proxmark3 connection timeout."); PrintAndLogEx(ERR, "Proxmark3 connection timeout.");
return 1; return 1;
@ -616,7 +616,7 @@ static int SelectCard14443_4(bool disconnect, iso14a_card_select_t *card) {
DropField(); DropField();
// Anticollision + SELECT card // 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
PrintAndLogEx(ERR, "Proxmark3 connection timeout."); PrintAndLogEx(ERR, "Proxmark3 connection timeout.");
return 1; return 1;
@ -693,7 +693,7 @@ static int CmdExchangeAPDU(bool chainingin, uint8_t *datain, int datainlen, bool
if (datain) if (datain)
SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_APDU | ISO14A_NO_DISCONNECT | cmdc, (datainlen & 0xFFFF), 0, datain, datainlen & 0xFFFF); SendCommandOLD(CMD_READER_ISO_14443a, ISO14A_APDU | ISO14A_NO_DISCONNECT | cmdc, (datainlen & 0xFFFF), 0, datain, datainlen & 0xFFFF);
else 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; uint8_t *recv;
PacketResponseNG resp; PacketResponseNG resp;
@ -1142,7 +1142,7 @@ int CmdHF14A(const char *Cmd) {
int infoHF14A(bool verbose, bool do_nack_test) { int infoHF14A(bool verbose, bool do_nack_test) {
clearCommandBuffer(); 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; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
if (verbose) PrintAndLogEx(WARNING, "iso14443a card select failed"); if (verbose) PrintAndLogEx(WARNING, "iso14443a card select failed");
@ -1194,7 +1194,7 @@ int infoHF14A(bool verbose, bool do_nack_test) {
// reconnect for further tests // reconnect for further tests
clearCommandBuffer(); 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); WaitForResponse(CMD_ACK, &resp);
memcpy(&card, (iso14a_card_select_t *)resp.data.asBytes, sizeof(iso14a_card_select_t)); memcpy(&card, (iso14a_card_select_t *)resp.data.asBytes, sizeof(iso14a_card_select_t));

View file

@ -109,13 +109,13 @@ static int usage_hf_14b_dump(void) {
/* /*
static void switch_on_field_14b(void) { static void switch_on_field_14b(void) {
clearCommandBuffer(); 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) { static int switch_off_field_14b(void) {
clearCommandBuffer(); 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; return 0;
} }
@ -170,7 +170,7 @@ static int CmdHF14BSim(const char *Cmd) {
} }
clearCommandBuffer(); 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; return 0;
} }
@ -180,7 +180,7 @@ static int CmdHF14BSniff(const char *Cmd) {
if (cmdp == 'h') return usage_hf_14b_sniff(); if (cmdp == 'h') return usage_hf_14b_sniff();
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_SNIFF_ISO_14443B, 0, 0, 0, NULL, 0); SendCommandNG(CMD_SNIFF_ISO_14443B, NULL, 0);
return 0; return 0;
} }
@ -301,7 +301,7 @@ static bool get_14b_UID(iso14b_card_select_t *card) {
while (retry--) { while (retry--) {
clearCommandBuffer(); 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)) { if (WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) {
uint8_t status = resp.oldarg[0]; uint8_t status = resp.oldarg[0];
@ -317,7 +317,7 @@ static bool get_14b_UID(iso14b_card_select_t *card) {
while (retry--) { while (retry--) {
clearCommandBuffer(); 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)) { if (WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) {
uint8_t status = resp.oldarg[0]; 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) // 14b get and print UID only (general info)
clearCommandBuffer(); 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; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) {
@ -541,7 +541,7 @@ static bool HF14B_Std_Info(bool verbose) {
static bool HF14B_ST_Info(bool verbose) { static bool HF14B_ST_Info(bool verbose) {
clearCommandBuffer(); 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; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) { 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 // SRx get and print general info about SRx chip from UID
clearCommandBuffer(); 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; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) {
if (verbose) PrintAndLogEx(WARNING, "command execution 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) // 14b get and print UID only (general info)
clearCommandBuffer(); 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; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) {
@ -745,7 +745,7 @@ static int CmdHF14BReadSri(const char *Cmd) {
uint8_t blocks = (tagtype == 1) ? 0x7F : 0x0F; uint8_t blocks = (tagtype == 1) ? 0x7F : 0x0F;
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_READ_SRI_TAG, blocks, 0, 0, NULL, 0); SendCommandMIX(CMD_READ_SRI_TAG, blocks, 0, 0, NULL, 0);
return 0; return 0;
} }
// New command to write a SRI512/SRIX4K tag. // New command to write a SRI512/SRIX4K tag.
@ -884,7 +884,7 @@ static int CmdHF14BDump(const char *Cmd) {
PacketResponseNG resp; PacketResponseNG resp;
clearCommandBuffer(); 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 //select
if (WaitForResponseTimeout(CMD_ACK, &resp, 2000)) { if (WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {

View file

@ -575,7 +575,7 @@ static int CmdHF15Samples(const char *Cmd) {
if (cmdp == 'h') return usage_15_samples(); if (cmdp == 'h') return usage_15_samples();
clearCommandBuffer(); 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); getSamples(0, false);
return 0; return 0;
@ -672,7 +672,7 @@ static int CmdHF15Record(const char *Cmd) {
if (cmdp == 'h') return usage_15_record(); if (cmdp == 'h') return usage_15_record();
clearCommandBuffer(); 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; return 0;
} }
@ -713,7 +713,7 @@ static int CmdHF15Afi(const char *Cmd) {
PrintAndLogEx(SUCCESS, "press pm3-button to cancel"); PrintAndLogEx(SUCCESS, "press pm3-button to cancel");
clearCommandBuffer(); 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; return 0;
} }

View file

@ -32,7 +32,7 @@ static int CmdHFEPACollectPACENonces(const char *Cmd) {
for (uint32_t i = 0; i < n; i++) { for (uint32_t i = 0; i < n; i++) {
// execute PACE // execute PACE
clearCommandBuffer(); 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; PacketResponseNG resp;
WaitForResponse(CMD_ACK, &resp); WaitForResponse(CMD_ACK, &resp);
@ -135,7 +135,7 @@ static int CmdHFEPAPACEReplay(const char *Cmd) {
// now perform the replay // now perform the replay
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_EPA_PACE_REPLAY, 0, 0, 0, NULL, 0); SendCommandNG(CMD_EPA_PACE_REPLAY, NULL, 0);
WaitForResponse(CMD_ACK, &resp); WaitForResponse(CMD_ACK, &resp);
if (resp.oldarg[0] != 0) { if (resp.oldarg[0] != 0) {
PrintAndLogEx(NORMAL, "\nPACE replay failed in step %u!", (uint32_t)resp.oldarg[0]); PrintAndLogEx(NORMAL, "\nPACE replay failed in step %u!", (uint32_t)resp.oldarg[0]);

View file

@ -173,7 +173,7 @@ static int CmdHFFelicaSniff(const char *Cmd) {
if (errors || cmdp == 0) return usage_hf_felica_sniff(); if (errors || cmdp == 0) return usage_hf_felica_sniff();
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_FELICA_SNIFF, samples2skip, triggers2skip, 0, NULL, 0); SendCommandMIX(CMD_FELICA_SNIFF, samples2skip, triggers2skip, 0, NULL, 0);
return 0; return 0;
} }
@ -186,7 +186,7 @@ static int CmdHFFelicaSimLite(const char *Cmd) {
return usage_hf_felica_simlite(); return usage_hf_felica_simlite();
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_FELICA_LITE_SIM, uid, 0, 0, NULL, 0); SendCommandMIX(CMD_FELICA_LITE_SIM, uid, 0, 0, NULL, 0);
return 0; return 0;
} }
@ -349,7 +349,7 @@ static int CmdHFFelicaDumpLite(const char *Cmd) {
PrintAndLogEx(SUCCESS, "FeliCa lite - dump started"); PrintAndLogEx(SUCCESS, "FeliCa lite - dump started");
PrintAndLogEx(SUCCESS, "press pm3-button to cancel"); PrintAndLogEx(SUCCESS, "press pm3-button to cancel");
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_FELICA_LITE_DUMP, 0, 0, 0, NULL, 0); SendCommandNG(CMD_FELICA_LITE_DUMP, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
uint8_t timeout = 0; uint8_t timeout = 0;
@ -560,11 +560,11 @@ int CmdHFFelica(const char *Cmd) {
int readFelicaUid(bool verbose) { int readFelicaUid(bool verbose) {
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_FELICA_COMMAND, FELICA_CONNECT, 0, 0, NULL, 0); SendCommandMIX(CMD_FELICA_COMMAND, FELICA_CONNECT, 0, 0, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
if (verbose) PrintAndLogEx(WARNING, "FeliCa card select failed"); 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; return 0;
} }

View file

@ -281,7 +281,7 @@ static int CmdHFiClassList(const char *Cmd) {
static int CmdHFiClassSniff(const char *Cmd) { static int CmdHFiClassSniff(const char *Cmd) {
char cmdp = tolower(param_getchar(Cmd, 0)); char cmdp = tolower(param_getchar(Cmd, 0));
if (cmdp == 'h') return usage_hf_iclass_sniff(); 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; return 0;
} }
@ -605,7 +605,7 @@ static int CmdHFiClassELoad(const char *Cmd) {
// Disable fast mode and send a dummy command to make it effective // Disable fast mode and send a dummy command to make it effective
conn.block_after_ACK = false; conn.block_after_ACK = false;
SendCommandMIX(CMD_PING, 0, 0, 0, NULL, 0); SendCommandNG(CMD_PING, NULL, 0);
WaitForResponseTimeout(CMD_ACK, NULL, 1000); WaitForResponseTimeout(CMD_ACK, NULL, 1000);
PrintAndLogEx(SUCCESS, "sent %d bytes of data to device emulator memory", bytes_sent); 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; flags |= FLAG_ICLASS_READER_CEDITKEY;
clearCommandBuffer(); 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 4000)) {
PrintAndLogEx(WARNING, "command execute timeout"); PrintAndLogEx(WARNING, "command execute timeout");
return false; return false;
@ -937,7 +937,7 @@ static int CmdHFiClassReader_Dump(const char *Cmd) {
uint8_t tag_data[255 * 8]; uint8_t tag_data[255 * 8];
clearCommandBuffer(); 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 4500)) {
PrintAndLogEx(WARNING, "command execute timeout"); PrintAndLogEx(WARNING, "command execute timeout");
DropField(); DropField();
@ -975,7 +975,7 @@ static int CmdHFiClassReader_Dump(const char *Cmd) {
// begin dump // begin dump
clearCommandBuffer(); 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) { while (true) {
printf("."); printf(".");
fflush(stdout); fflush(stdout);
@ -1031,7 +1031,7 @@ static int CmdHFiClassReader_Dump(const char *Cmd) {
if (maxBlk > blockno + numblks + 1) { if (maxBlk > blockno + numblks + 1) {
// setup dump and start // setup dump and start
clearCommandBuffer(); 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 4500)) {
PrintAndLogEx(WARNING, "command execute timeout 2"); PrintAndLogEx(WARNING, "command execute timeout 2");
return 0; return 0;
@ -1359,7 +1359,7 @@ static int ReadBlock(uint8_t *KEY, uint8_t blockno, uint8_t keyType, bool elite,
PacketResponseNG resp; PacketResponseNG resp;
clearCommandBuffer(); 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 4500)) {
PrintAndLogEx(WARNING, "Command execute timeout"); PrintAndLogEx(WARNING, "Command execute timeout");
return 0; return 0;
@ -2037,7 +2037,7 @@ out:
// Disable fast mode and send a dummy command to make it effective // Disable fast mode and send a dummy command to make it effective
conn.block_after_ACK = false; conn.block_after_ACK = false;
SendCommandMIX(CMD_PING, 0, 0, 0, NULL, 0); SendCommandNG(CMD_PING, NULL, 0);
WaitForResponseTimeout(CMD_ACK, NULL, 1000); WaitForResponseTimeout(CMD_ACK, NULL, 1000);
DropField(); DropField();
@ -2464,7 +2464,7 @@ int readIclass(bool loop, bool verbose) {
while (!ukbhit()) { while (!ukbhit()) {
clearCommandBuffer(); 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)) { if (WaitForResponseTimeout(CMD_ACK, &resp, 4500)) {
uint8_t readStatus = resp.oldarg[0] & 0xff; uint8_t readStatus = resp.oldarg[0] & 0xff;
uint8_t *data = resp.data.asBytes; uint8_t *data = resp.data.asBytes;

View file

@ -527,7 +527,7 @@ static int CmdLegicRfSim(const char *Cmd) {
uint64_t id = 1; uint64_t id = 1;
sscanf(Cmd, " %" SCNi64, &id); sscanf(Cmd, " %" SCNi64, &id);
clearCommandBuffer(); 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; 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); legic_chk_iv(&iv);
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_READER_LEGIC_RF, offset, len, iv, NULL, 0); SendCommandMIX(CMD_READER_LEGIC_RF, offset, len, iv, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
uint8_t timeout = 0; uint8_t timeout = 0;
@ -808,7 +808,7 @@ int legic_get_type(legic_card_select_t *card) {
if (card == NULL) return 1; if (card == NULL) return 1;
clearCommandBuffer(); clearCommandBuffer();
SendCommandMIX(CMD_LEGIC_INFO, 0, 0, 0, NULL, 0); SendCommandNG(CMD_LEGIC_INFO, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500))
return 2; return 2;
@ -893,7 +893,7 @@ static int CmdLegicDump(const char *Cmd) {
PrintAndLogEx(SUCCESS, "Reading tag memory %d b...", dumplen); PrintAndLogEx(SUCCESS, "Reading tag memory %d b...", dumplen);
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_READER_LEGIC_RF, 0x00, dumplen, 0x55, NULL, 0); SendCommandMIX(CMD_READER_LEGIC_RF, 0x00, dumplen, 0x55, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
uint8_t timeout = 0; uint8_t timeout = 0;

View file

@ -411,7 +411,7 @@ static int usage_hf14_nack(void) {
static int GetHFMF14AUID(uint8_t *uid, int *uidlen) { static int GetHFMF14AUID(uint8_t *uid, int *uidlen) {
clearCommandBuffer(); 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; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
PrintAndLogEx(WARNING, "iso14443a card select failed"); PrintAndLogEx(WARNING, "iso14443a card select failed");
@ -2026,7 +2026,7 @@ out:
// Disable fast mode and send a dummy command to make it effective // Disable fast mode and send a dummy command to make it effective
conn.block_after_ACK = false; conn.block_after_ACK = false;
SendCommandMIX(CMD_PING, 0, 0, 0, NULL, 0); SendCommandNG(CMD_PING, NULL, 0);
WaitForResponseTimeout(CMD_ACK, NULL, 1000); WaitForResponseTimeout(CMD_ACK, NULL, 1000);
@ -2291,7 +2291,7 @@ static int CmdHF14AMfSniff(const char *Cmd) {
PrintAndLogEx(NORMAL, "-------------------------------------------------------------------------\n"); PrintAndLogEx(NORMAL, "-------------------------------------------------------------------------\n");
clearCommandBuffer(); clearCommandBuffer();
SendCommandMIX(CMD_MIFARE_SNIFFER, 0, 0, 0, NULL, 0); SendCommandNG(CMD_MIFARE_SNIFFER, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
@ -2506,7 +2506,7 @@ static int CmdHF14AMfEClear(const char *Cmd) {
if (c == 'h') return usage_hf14_eclr(); if (c == 'h') return usage_hf14_eclr();
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_MIFARE_EML_MEMCLR, 0, 0, 0, NULL, 0); SendCommandNG(CMD_MIFARE_EML_MEMCLR, NULL, 0);
return 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'); PrintAndLogEx(NORMAL, "--params: numSectors: %d, keyType: %c\n", numSectors, (keyType == 0) ? 'A' : 'B');
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_MIFARE_EML_CARDLOAD, numSectors, keyType, 0, NULL, 0); SendCommandMIX(CMD_MIFARE_EML_CARDLOAD, numSectors, keyType, 0, NULL, 0);
return 0; return 0;
} }
@ -3276,7 +3276,7 @@ static int CmdHF14AMfice(const char *Cmd) {
flags |= initialize ? 0x0001 : 0; flags |= initialize ? 0x0001 : 0;
flags |= slow ? 0x0002 : 0; flags |= slow ? 0x0002 : 0;
clearCommandBuffer(); 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 (!WaitForResponseTimeout(CMD_ACK, &resp, 3000)) goto out;
if (resp.oldarg[0]) goto out; if (resp.oldarg[0]) goto out;
@ -3308,7 +3308,7 @@ out:
} }
clearCommandBuffer(); 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; return 0;
} }

View file

@ -111,7 +111,7 @@ static int CmdHF14ADesRb(const char *Cmd) {
static int CmdHF14ADesInfo(const char *Cmd) { static int CmdHF14ADesInfo(const char *Cmd) {
(void)Cmd; // Cmd is not used so far (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; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {

View file

@ -58,7 +58,7 @@ static int CmdHF14AMfDESAuth(const char *Cmd) {
//DES_set_key((DES_cblock *)key2,&ks2); //DES_set_key((DES_cblock *)key2,&ks2);
//Auth1 //Auth1
SendCommandOLD(CMD_MIFARE_DES_AUTH1, blockNo, 0, 0, NULL, 0); SendCommandMIX(CMD_MIFARE_DES_AUTH1, blockNo, 0, 0, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) { if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
uint8_t isOK = resp.oldarg[0] & 0xff; 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); AES_set_decrypt_key(key, 128, &key_d);
//Auth1 //Auth1
SendCommandOLD(CMD_MIFARE_DES_AUTH1, blockNo, 0, 0, NULL, 0); SendCommandMIX(CMD_MIFARE_DES_AUTH1, blockNo, 0, 0, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) { if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
uint8_t isOK = resp.oldarg[0] & 0xff; uint8_t isOK = resp.oldarg[0] & 0xff;

View file

@ -1393,7 +1393,7 @@ static int acquire_nonces(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_
if (!WaitForResponseTimeout(CMD_ACK, &resp, 3000)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 3000)) {
//strange second call (iceman) //strange second call (iceman)
clearCommandBuffer(); 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; return 1;
} }
if (resp.oldarg[0]) return resp.oldarg[0]; // error during nested_hard if (resp.oldarg[0]) return resp.oldarg[0]; // error during nested_hard

View file

@ -42,7 +42,7 @@ static int CmdHFMFPInfo(const char *cmd) {
infoHF14A(false, false); infoHF14A(false, false);
// Mifare Plus info // 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; PacketResponseNG resp;
WaitForResponse(CMD_ACK, &resp); WaitForResponse(CMD_ACK, &resp);

View file

@ -459,7 +459,7 @@ static char *getUlev1CardSizeStr(uint8_t fsize) {
static void ul_switch_on_field(void) { static void ul_switch_on_field(void) {
clearCommandBuffer(); 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) { 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. // read block2.
clearCommandBuffer(); 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
PrintAndLogEx(WARNING, "Command execute timeout"); PrintAndLogEx(WARNING, "Command execute timeout");
return 2; return 2;
@ -2543,7 +2543,7 @@ static int CmdHF14AMfUGenDiverseKeys(const char *Cmd) {
if (cmdp == 'r') { if (cmdp == 'r') {
// read uid from tag // read uid from tag
clearCommandBuffer(); 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; PacketResponseNG resp;
WaitForResponse(CMD_ACK, &resp); WaitForResponse(CMD_ACK, &resp);
iso14a_card_select_t card; iso14a_card_select_t card;
@ -2657,7 +2657,7 @@ static int CmdHF14AMfUPwdGen(const char *Cmd) {
if (cmdp == 'r') { if (cmdp == 'r') {
// read uid from tag // read uid from tag
clearCommandBuffer(); 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; PacketResponseNG resp;
WaitForResponse(CMD_ACK, &resp); WaitForResponse(CMD_ACK, &resp);
iso14a_card_select_t card; iso14a_card_select_t card;

View file

@ -31,11 +31,11 @@ static struct {
} topaz_tag; } topaz_tag;
static void topaz_switch_on_field(void) { 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) { 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) // send a raw topaz command, returns the length of the response (0 in case of error)

View file

@ -362,7 +362,7 @@ static int CmdDetectReader(const char *Cmd) {
} }
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_LISTEN_READER_FIELD, arg, 0, 0, NULL, 0); SendCommandMIX(CMD_LISTEN_READER_FIELD, arg, 0, 0, NULL, 0);
return PM3_SUCCESS; return PM3_SUCCESS;
} }
@ -370,7 +370,7 @@ static int CmdDetectReader(const char *Cmd) {
static int CmdFPGAOff(const char *Cmd) { static int CmdFPGAOff(const char *Cmd) {
(void)Cmd; // Cmd is not used so far (void)Cmd; // Cmd is not used so far
clearCommandBuffer(); clearCommandBuffer();
SendCommandMIX(CMD_FPGA_MAJOR_MODE_OFF, 0, 0, 0, NULL, 0); SendCommandNG(CMD_FPGA_MAJOR_MODE_OFF, NULL, 0);
return PM3_SUCCESS; return PM3_SUCCESS;
} }
@ -379,27 +379,27 @@ static int CmdLCD(const char *Cmd) {
sscanf(Cmd, "%x %d", &i, &j); sscanf(Cmd, "%x %d", &i, &j);
while (j--) { while (j--) {
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_LCD, i & 0x1ff, 0, 0, NULL, 0); SendCommandMIX(CMD_LCD, i & 0x1ff, 0, 0, NULL, 0);
} }
return PM3_SUCCESS; return PM3_SUCCESS;
} }
static int CmdLCDReset(const char *Cmd) { static int CmdLCDReset(const char *Cmd) {
clearCommandBuffer(); 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; return PM3_SUCCESS;
} }
static int CmdReadmem(const char *Cmd) { static int CmdReadmem(const char *Cmd) {
clearCommandBuffer(); 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; return PM3_SUCCESS;
} }
static int CmdReset(const char *Cmd) { static int CmdReset(const char *Cmd) {
(void)Cmd; // Cmd is not used so far (void)Cmd; // Cmd is not used so far
clearCommandBuffer(); clearCommandBuffer();
SendCommandMIX(CMD_HARDWARE_RESET, 0, 0, 0, NULL, 0); SendCommandNG(CMD_HARDWARE_RESET, NULL, 0);
return PM3_SUCCESS; return PM3_SUCCESS;
} }
@ -416,7 +416,7 @@ static int CmdSetDivisor(const char *Cmd) {
} }
// 12 000 000 (12Mhz) // 12 000 000 (12Mhz)
clearCommandBuffer(); 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))); PrintAndLogEx(SUCCESS, "Divisor set, expected %.1f KHz", ((double)12000 / (arg + 1)));
return PM3_SUCCESS; return PM3_SUCCESS;
} }
@ -440,7 +440,7 @@ static int CmdSetMux(const char *Cmd) {
return PM3_EINVARG; return PM3_EINVARG;
} }
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_SET_ADC_MUX, arg, 0, 0, NULL, 0); SendCommandMIX(CMD_SET_ADC_MUX, arg, 0, 0, NULL, 0);
return PM3_SUCCESS; return PM3_SUCCESS;
} }
@ -458,7 +458,7 @@ static int CmdStatus(const char *Cmd) {
(void)Cmd; // Cmd is not used so far (void)Cmd; // Cmd is not used so far
clearCommandBuffer(); clearCommandBuffer();
PacketResponseNG resp; PacketResponseNG resp;
SendCommandMIX(CMD_STATUS, 0, 0, 0, NULL, 0); SendCommandNG(CMD_STATUS, NULL, 0);
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) if (!WaitForResponseTimeout(CMD_ACK, &resp, 2000))
PrintAndLogEx(WARNING, "Status command failed. Communication speed test timed out"); PrintAndLogEx(WARNING, "Status command failed. Communication speed test timed out");
return PM3_SUCCESS; return PM3_SUCCESS;
@ -468,7 +468,7 @@ static int CmdPing(const char *Cmd) {
(void)Cmd; // Cmd is not used so far (void)Cmd; // Cmd is not used so far
clearCommandBuffer(); clearCommandBuffer();
PacketResponseNG resp; PacketResponseNG resp;
SendCommandMIX(CMD_PING, 0, 0, 0, NULL, 0); SendCommandNG(CMD_PING, NULL, 0);
if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) if (WaitForResponseTimeout(CMD_ACK, &resp, 1000))
PrintAndLogEx(SUCCESS, "Ping " _GREEN_("successful")); PrintAndLogEx(SUCCESS, "Ping " _GREEN_("successful"));
else else
@ -568,7 +568,7 @@ void pm3_version(bool verbose) {
PacketResponseNG resp; PacketResponseNG resp;
clearCommandBuffer(); clearCommandBuffer();
SendCommandMIX(CMD_VERSION, 0, 0, 0, NULL, 0); SendCommandNG(CMD_VERSION, NULL, 0);
if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) { if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {
PrintAndLogEx(NORMAL, "\n" _BLUE_(" [ Proxmark3 RFID instrument ]") "\n"); PrintAndLogEx(NORMAL, "\n" _BLUE_(" [ Proxmark3 RFID instrument ]") "\n");

View file

@ -335,7 +335,7 @@ int CmdLFSetConfig(const char *Cmd) {
bool lf_read(bool silent, uint32_t samples) { bool lf_read(bool silent, uint32_t samples) {
if (!session.pm3_present) return false; if (!session.pm3_present) return false;
clearCommandBuffer(); 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; PacketResponseNG resp;
if (g_lf_threshold_set) { if (g_lf_threshold_set) {
@ -390,7 +390,7 @@ int CmdLFSniff(const char *Cmd) {
if (cmdp == 'h') return usage_lf_sniff(); if (cmdp == 'h') return usage_lf_sniff();
clearCommandBuffer(); 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); WaitForResponse(CMD_ACK, NULL);
getSamples(0, false); getSamples(0, false);
return 0; return 0;
@ -438,7 +438,7 @@ int CmdLFSim(const char *Cmd) {
PrintAndLogEx(NORMAL, "Simulating"); PrintAndLogEx(NORMAL, "Simulating");
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_SIMULATE_TAG_125K, GraphTraceLen, gap, 0, NULL, 0); SendCommandMIX(CMD_SIMULATE_TAG_125K, GraphTraceLen, gap, 0, NULL, 0);
return 0; return 0;
} }
@ -722,7 +722,7 @@ int CmdLFSimBidir(const char *Cmd) {
// Set ADC to twice the carrier for a slight supersampling // Set ADC to twice the carrier for a slight supersampling
// HACK: not implemented in ARMSRC. // HACK: not implemented in ARMSRC.
PrintAndLogEx(INFO, "Not implemented yet."); 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; return 0;
} }

View file

@ -87,9 +87,9 @@ static int usage_lf_awid_brute(void) {
} }
static bool sendPing(void) { static bool sendPing(void) {
SendCommandOLD(CMD_PING, 1, 2, 3, NULL, 0); SendCommandMIX(CMD_PING, 1, 2, 3, NULL, 0);
SendCommandOLD(CMD_PING, 1, 2, 3, NULL, 0); SendCommandMIX(CMD_PING, 1, 2, 3, NULL, 0);
SendCommandOLD(CMD_PING, 1, 2, 3, NULL, 0); SendCommandMIX(CMD_PING, 1, 2, 3, NULL, 0);
clearCommandBuffer(); clearCommandBuffer();
PacketResponseNG resp; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)) 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(); if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_awid_read();
uint8_t findone = (Cmd[0] == '1') ? 1 : 0; uint8_t findone = (Cmd[0] == '1') ? 1 : 0;
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_AWID_DEMOD_FSK, findone, 0, 0, NULL, 0); SendCommandMIX(CMD_AWID_DEMOD_FSK, findone, 0, 0, NULL, 0);
return 0; return 0;
} }
*/ */
@ -385,7 +385,7 @@ static int CmdAWIDClone(const char *Cmd) {
for (uint8_t i = 0; i < 4; i++) { for (uint8_t i = 0; i < 4; i++) {
clearCommandBuffer(); 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) {
PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation.");
return -1; return -1;

View file

@ -75,7 +75,7 @@ static int CmdCOTAGRead(const char *Cmd) {
sscanf(Cmd, "%u", &rawsignal); sscanf(Cmd, "%u", &rawsignal);
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_COTAG, rawsignal, 0, 0, NULL, 0); SendCommandMIX(CMD_COTAG, rawsignal, 0, 0, NULL, 0);
if (!WaitForResponseTimeout(CMD_ACK, NULL, 7000)) { if (!WaitForResponseTimeout(CMD_ACK, NULL, 7000)) {
PrintAndLogEx(WARNING, "command execution time out"); PrintAndLogEx(WARNING, "command execution time out");
return -1; return -1;

View file

@ -389,7 +389,7 @@ int AskEm410xDemod(const char *Cmd, uint32_t *hi, uint64_t *lo, bool verbose) {
static int CmdEM410xRead_device(const char *Cmd) { static int CmdEM410xRead_device(const char *Cmd) {
char cmdp = tolower(param_getchar(Cmd, 0)); char cmdp = tolower(param_getchar(Cmd, 0));
uint8_t findone = (cmdp == '1') ? 1 : 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; return 0;
} }
*/ */
@ -647,7 +647,7 @@ static int CmdEM410xWrite(const char *Cmd) {
return 0; 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; return 0;
} }
@ -1126,7 +1126,7 @@ static bool demodEM4x05resp(uint32_t *word) {
//////////////// 4205 / 4305 commands //////////////// 4205 / 4305 commands
static int EM4x05ReadWord_ext(uint8_t addr, uint32_t pwd, bool usePwd, uint32_t *word) { static int EM4x05ReadWord_ext(uint8_t addr, uint32_t pwd, bool usePwd, uint32_t *word) {
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_EM4X_READ_WORD, addr, pwd, usePwd, NULL, 0); SendCommandMIX(CMD_EM4X_READ_WORD, addr, pwd, usePwd, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
PrintAndLogEx(DEBUG, "timeout while waiting for reply."); PrintAndLogEx(DEBUG, "timeout while waiting for reply.");
@ -1228,7 +1228,7 @@ static int CmdEM4x05Write(const char *Cmd) {
uint16_t flag = (addr << 8) | (usePwd); uint16_t flag = (addr << 8) | (usePwd);
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_EM4X_WRITE_WORD, flag, data, pwd, NULL, 0); SendCommandMIX(CMD_EM4X_WRITE_WORD, flag, data, pwd, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation.");

View file

@ -285,7 +285,7 @@ static int CmdFdxClone(const char *Cmd) {
for (int i = 4; i >= 0; --i) { for (int i = 4; i >= 0; --i) {
clearCommandBuffer(); 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) {
PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation.");
return -1; return -1;

View file

@ -175,7 +175,7 @@ static int CmdGuardClone(const char *Cmd) {
for (i = 0; i < 4; ++i) { for (i = 0; i < 4; ++i) {
clearCommandBuffer(); 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) {
PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation.");
return -1; return -1;

View file

@ -93,9 +93,9 @@ static int usage_lf_hid_brute(void) {
// sending three times. Didn't seem to break the previous sim? // sending three times. Didn't seem to break the previous sim?
static bool sendPing(void) { static bool sendPing(void) {
SendCommandOLD(CMD_PING, 1, 2, 3, NULL, 0); SendCommandMIX(CMD_PING, 1, 2, 3, NULL, 0);
SendCommandOLD(CMD_PING, 1, 2, 3, NULL, 0); SendCommandMIX(CMD_PING, 1, 2, 3, NULL, 0);
SendCommandOLD(CMD_PING, 1, 2, 3, NULL, 0); SendCommandMIX(CMD_PING, 1, 2, 3, NULL, 0);
clearCommandBuffer(); clearCommandBuffer();
PacketResponseNG resp; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)) 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); calcWiegand(fmtlen, fc, cn, bits, 0);
clearCommandBuffer(); 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); msleep(delay);
sendPing(); sendPing();
@ -239,7 +239,7 @@ static int CmdHIDRead_device(const char *Cmd) {
if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_hid_read(); if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_hid_read();
uint8_t findone = (Cmd[0] == '1') ? 1 : 0; uint8_t findone = (Cmd[0] == '1') ? 1 : 0;
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_HID_DEMOD_FSK, findone, 0, 0, NULL, 0); SendCommandMIX(CMD_HID_DEMOD_FSK, findone, 0, 0, NULL, 0);
return 0; return 0;
} }
*/ */
@ -259,7 +259,7 @@ static int CmdHIDSim(const char *Cmd) {
PrintAndLogEx(SUCCESS, "Press pm3-button to abort simulation"); PrintAndLogEx(SUCCESS, "Press pm3-button to abort simulation");
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_HID_SIM_TAG, hi, lo, 0, NULL, 0); SendCommandMIX(CMD_HID_SIM_TAG, hi, lo, 0, NULL, 0);
return 0; return 0;
} }

View file

@ -261,7 +261,7 @@ static int CmdLFHitagSniff(const char *Cmd) {
if (ctmp == 'h') return usage_hitag_sniff(); if (ctmp == 'h') return usage_hitag_sniff();
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_SNIFF_HITAG, 0, 0, 0, NULL, 0); SendCommandNG(CMD_SNIFF_HITAG, NULL, 0);
return 0; return 0;
} }
@ -339,7 +339,7 @@ static int CmdLFHitagSim(const char *Cmd) {
if (tag_mem_supplied) { if (tag_mem_supplied) {
SendCommandOLD(cmd, 1, 0, 0, data, datalen); SendCommandOLD(cmd, 1, 0, 0, data, datalen);
} else { } else {
SendCommandOLD(cmd, 0, 0, 0, NULL, 0); SendCommandNG(cmd, NULL, 0);
} }
free(data); free(data);
@ -457,7 +457,7 @@ static void printHitagConfiguration(uint8_t config) {
static bool getHitagUid(uint32_t *uid) { static bool getHitagUid(uint32_t *uid) {
clearCommandBuffer(); 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; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
PrintAndLogEx(WARNING, "timeout while waiting for reply."); PrintAndLogEx(WARNING, "timeout while waiting for reply.");
@ -632,7 +632,7 @@ static int CmdLFHitagCheckChallenges(const char *Cmd) {
if (file_given) if (file_given)
SendCommandOLD(CMD_TEST_HITAGS_TRACES, 1, 0, 0, data, datalen); SendCommandOLD(CMD_TEST_HITAGS_TRACES, 1, 0, 0, data, datalen);
else else
SendCommandOLD(CMD_TEST_HITAGS_TRACES, 0, 0, 0, NULL, 0); SendCommandNG(CMD_TEST_HITAGS_TRACES, NULL, 0);
free(data); free(data);
return 0; return 0;

View file

@ -67,7 +67,7 @@ static int CmdIOProxRead_device(const char *Cmd) {
if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_io_read(); if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_io_read();
int findone = (Cmd[0] == '1') ? 1 : 0; int findone = (Cmd[0] == '1') ? 1 : 0;
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_IO_DEMOD_FSK, findone, 0, 0, NULL, 0); SendCommandMIX(CMD_IO_DEMOD_FSK, findone, 0, 0, NULL, 0);
return 0; return 0;
} }
*/ */
@ -252,7 +252,7 @@ static int CmdIOProxClone(const char *Cmd) {
print_blocks(blocks, 3); print_blocks(blocks, 3);
clearCommandBuffer(); 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; return 0;
} }

View file

@ -159,7 +159,7 @@ static int CmdJablotronClone(const char *Cmd) {
for (uint8_t i = 0; i < 3; i++) { for (uint8_t i = 0; i < 3; i++) {
clearCommandBuffer(); 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) {
PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation.");
return -1; return -1;

View file

@ -150,7 +150,7 @@ static int CmdKeriClone(const char *Cmd) {
for (uint8_t i = 0; i < 3; i++) { for (uint8_t i = 0; i < 3; i++) {
clearCommandBuffer(); 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) {
PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation.");
return -1; return -1;

View file

@ -206,7 +206,7 @@ static int CmdLFNedapClone(const char *Cmd) {
for (uint8_t i = 0; i<5; ++i ) { for (uint8_t i = 0; i<5; ++i ) {
clearCommandBuffer(); 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)){ if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)){
PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation.");
return -1; return -1;

View file

@ -158,7 +158,7 @@ static int CmdNoralsyClone(const char *Cmd) {
for (uint8_t i = 0; i < 4; i++) { for (uint8_t i = 0; i < 4; i++) {
clearCommandBuffer(); 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) {
PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation.");
return -1; return -1;

View file

@ -101,7 +101,7 @@ static int CmdLFPCF7931Read(const char *Cmd) {
PacketResponseNG resp; PacketResponseNG resp;
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_PCF7931_READ, 0, 0, 0, NULL, 0); SendCommandNG(CMD_PCF7931_READ, NULL, 0);
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
PrintAndLogEx(WARNING, "command execution time out"); PrintAndLogEx(WARNING, "command execution time out");
return 1; return 1;

View file

@ -124,7 +124,7 @@ static int CmdPrescoClone(const char *Cmd) {
for (uint8_t i = 0; i < 5; i++) { for (uint8_t i = 0; i < 5; i++) {
clearCommandBuffer(); 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) {
PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation.");
return -1; return -1;

View file

@ -236,7 +236,7 @@ static int CmdPyramidClone(const char *Cmd) {
for (uint8_t i = 0; i < 5; ++i) { for (uint8_t i = 0; i < 5; ++i) {
clearCommandBuffer(); 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) {
PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation.");
return -1; return -1;

View file

@ -1019,7 +1019,7 @@ static int CmdT55xxWakeUp(const char *Cmd) {
if (errors) return usage_t55xx_wakup(); if (errors) return usage_t55xx_wakup();
clearCommandBuffer(); 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"); PrintAndLogEx(SUCCESS, "Wake up command sent. Try read now");
return 0; return 0;
} }
@ -1516,7 +1516,7 @@ bool AquireData(uint8_t page, uint8_t block, bool pwdmode, uint32_t password) {
// arg2: password // arg2: password
uint8_t arg0 = (page << 1 | (pwdmode)); uint8_t arg0 = (page << 1 | (pwdmode));
clearCommandBuffer(); 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)) { if (!WaitForResponseTimeout(CMD_ACK, NULL, 2500)) {
PrintAndLogEx(WARNING, "command execution time out"); PrintAndLogEx(WARNING, "command execution time out");
return false; return false;
@ -1775,7 +1775,7 @@ static void t55x7_create_config_block(int tagtype) {
static int CmdResetRead(const char *Cmd) { static int CmdResetRead(const char *Cmd) {
(void)Cmd; // Cmd is not used so far (void)Cmd; // Cmd is not used so far
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_T55XX_RESET_READ, 0, 0, 0, NULL, 0); SendCommandNG(CMD_T55XX_RESET_READ, NULL, 0);
if (!WaitForResponseTimeout(CMD_ACK, NULL, 2500)) { if (!WaitForResponseTimeout(CMD_ACK, NULL, 2500)) {
PrintAndLogEx(WARNING, "command execution time out"); PrintAndLogEx(WARNING, "command execution time out");
return 0; return 0;
@ -1855,7 +1855,7 @@ static int CmdT55xxChkPwds(const char *Cmd) {
if (cmdp == 'm') { if (cmdp == 'm') {
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_T55XX_CHKPWDS, 0, 0, 0, NULL, 0); SendCommandNG(CMD_T55XX_CHKPWDS, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) { while (!WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {

View file

@ -276,7 +276,7 @@ out:
static int CmdTIRead(const char *Cmd) { static int CmdTIRead(const char *Cmd) {
(void)Cmd; // Cmd is not used so far (void)Cmd; // Cmd is not used so far
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_READ_TI_TYPE, 0, 0, 0, NULL, 0); SendCommandNG(CMD_READ_TI_TYPE, NULL, 0);
return 0; return 0;
} }
@ -294,7 +294,7 @@ static int CmdTIWrite(const char *Cmd) {
return 1; return 1;
} }
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_WRITE_TI_TYPE, arg0, arg1, arg2, NULL, 0); SendCommandMIX(CMD_WRITE_TI_TYPE, arg0, arg1, arg2, NULL, 0);
return 0; return 0;
} }

View file

@ -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)); PrintAndLogEx(INFO, "Preparing to clone Viking tag - ID: %08X, Raw: %08X%08X", id, (uint32_t)(rawID >> 32), (uint32_t)(rawID & 0xFFFFFFFF));
clearCommandBuffer(); 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; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) {
PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation.");

View file

@ -170,7 +170,7 @@ static int CmdVisa2kClone(const char *Cmd) {
for (uint8_t i = 0; i < 4; i++) { for (uint8_t i = 0; i < 4; i++) {
clearCommandBuffer(); 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)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) {
PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation."); PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation.");
return -1; return -1;

View file

@ -664,7 +664,7 @@ static int CmdSmartUpgrade(const char *Cmd) {
// trigger the firmware upgrade // trigger the firmware upgrade
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_SMART_UPGRADE, firmware_size, 0, 0, NULL, 0); SendCommandMIX(CMD_SMART_UPGRADE, firmware_size, 0, 0, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
PrintAndLogEx(WARNING, "timeout while waiting for reply."); PrintAndLogEx(WARNING, "timeout while waiting for reply.");
@ -702,7 +702,7 @@ static int CmdSmartInfo(const char *Cmd) {
if (errors) return usage_sm_info(); if (errors) return usage_sm_info();
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_SMART_ATR, 0, 0, 0, NULL, 0); SendCommandNG(CMD_SMART_ATR, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
if (!silent) PrintAndLogEx(WARNING, "smart card select failed"); if (!silent) PrintAndLogEx(WARNING, "smart card select failed");
@ -776,7 +776,7 @@ static int CmdSmartReader(const char *Cmd) {
if (errors) return usage_sm_reader(); if (errors) return usage_sm_reader();
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_SMART_ATR, 0, 0, 0, NULL, 0); SendCommandNG(CMD_SMART_ATR, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
if (!silent) PrintAndLogEx(WARNING, "smart card select failed"); 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(); if (errors || cmdp == 0) return usage_sm_setclock();
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_SMART_SETCLOCK, clock1, 0, 0, NULL, 0); SendCommandMIX(CMD_SMART_SETCLOCK, clock1, 0, 0, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
PrintAndLogEx(WARNING, "smart card select failed"); 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)); memset(atr, 0, sizeof(smart_card_atr_t));
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_SMART_ATR, 0, 0, 0, NULL, 0); SendCommandNG(CMD_SMART_ATR, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
if (!silent) PrintAndLogEx(WARNING, "smart card select failed"); if (!silent) PrintAndLogEx(WARNING, "smart card select failed");

View file

@ -260,7 +260,7 @@ fail:
// Get the state of the proxmark, backwards compatible // Get the state of the proxmark, backwards compatible
static int get_proxmark_state(uint32_t *state) { 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; PacketResponseOLD resp;
ReceiveCommand(&resp); ReceiveCommand(&resp);
@ -307,11 +307,11 @@ static int enter_bootloader(void) {
&& (state & DEVICE_INFO_FLAG_OSIMAGE_PRESENT)) { && (state & DEVICE_INFO_FLAG_OSIMAGE_PRESENT)) {
// New style handover: Send CMD_START_FLASH, which will reset the board // New style handover: Send CMD_START_FLASH, which will reset the board
// and enter the bootrom on the next boot. // 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"); fprintf(stderr, "(Press and release the button only to abort)\n");
} else { } else {
// Old style handover: Ask the user to press the button, then reset the board // 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, "Press and hold down button NOW if your bootloader requires it.\n");
} }
fprintf(stderr, "Waiting for Proxmark3 to reappear on USB..."); 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 // 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. // flashing, as long as it's not the bootloader area? The mind boggles.
if (enable_bl_writes) { 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 { } 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(); return wait_for_ack();
} else { } else {
@ -440,7 +440,7 @@ void flash_free(flash_file_t *ctx) {
// just reset the unit // just reset the unit
int flash_stop_flashing(void) { int flash_stop_flashing(void) {
SendCommandOLD(CMD_HARDWARE_RESET, 0, 0, 0, NULL, 0); SendCommandNG(CMD_HARDWARE_RESET, NULL, 0);
msleep(100); msleep(100);
return 0; return 0;
} }

View file

@ -259,7 +259,7 @@ fail:
// Get the state of the proxmark, backwards compatible // Get the state of the proxmark, backwards compatible
static int get_proxmark_state(uint32_t *state) { 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; PacketResponseNG resp;
WaitForResponse(CMD_UNKNOWN, &resp); // wait for any response. No timeout. 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)) { && (state & DEVICE_INFO_FLAG_OSIMAGE_PRESENT)) {
// New style handover: Send CMD_START_FLASH, which will reset the board // New style handover: Send CMD_START_FLASH, which will reset the board
// and enter the bootrom on the next boot. // 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") ")"); PrintAndLogEx(SUCCESS, "(Press and release the button only to " _YELLOW_("abort") ")");
} else { } else {
// Old style handover: Ask the user to press the button, then reset the board // 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."); PrintAndLogEx(SUCCESS, "Press and hold down button NOW if your bootloader requires it.");
} }
msleep(100); msleep(100);
@ -359,9 +359,9 @@ int flash_start_flashing(int enable_bl_writes, char *serial_port_name) {
PacketResponseNG resp; PacketResponseNG resp;
if (enable_bl_writes) { 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 { } 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); return wait_for_ack(&resp);
} else { } else {
@ -445,7 +445,7 @@ void flash_free(flash_file_t *ctx) {
// just reset the unit // just reset the unit
int flash_stop_flashing(void) { int flash_stop_flashing(void) {
SendCommandOLD(CMD_HARDWARE_RESET, 0, 0, 0, NULL, 0); SendCommandNG(CMD_HARDWARE_RESET, NULL, 0);
msleep(100); msleep(100);
return 0; return 0;
} }

View file

@ -25,7 +25,7 @@ int mfDarkside(uint8_t blockno, uint8_t key_type, uint64_t *key) {
while (true) { while (true) {
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_READER_MIFARE, arg0, blockno, key_type, NULL, 0); SendCommandMIX(CMD_READER_MIFARE, arg0, blockno, key_type, NULL, 0);
//flush queue //flush queue
while (ukbhit()) { while (ukbhit()) {
@ -446,7 +446,7 @@ int mfReadSector(uint8_t sectorNo, uint8_t keyType, uint8_t *key, uint8_t *data)
// EMULATOR // EMULATOR
int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount) { int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount) {
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_MIFARE_EML_MEMGET, blockNum, blocksCount, 0, NULL, 0); SendCommandMIX(CMD_MIFARE_EML_MEMGET, blockNum, blocksCount, 0, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) return PM3_ETIMEOUT; if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) return PM3_ETIMEOUT;
memcpy(data, resp.data.asBytes, blocksCount * 16); 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) { int mfCGetBlock(uint8_t blockNo, uint8_t *data, uint8_t params) {
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_MIFARE_CGETBLOCK, params, blockNo, 0, NULL, 0); SendCommandMIX(CMD_MIFARE_CGETBLOCK, params, blockNo, 0, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) { if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
uint8_t isOK = resp.oldarg[0] & 0xff; uint8_t isOK = resp.oldarg[0] & 0xff;
@ -906,7 +906,7 @@ returns:
int detect_classic_nackbug(bool verbose) { int detect_classic_nackbug(bool verbose) {
clearCommandBuffer(); clearCommandBuffer();
SendCommandMIX(CMD_MIFARE_NACK_DETECT, 0, 0, 0, NULL, 0); SendCommandNG(CMD_MIFARE_NACK_DETECT, NULL, 0);
PacketResponseNG resp; PacketResponseNG resp;
if (verbose) if (verbose)
@ -991,7 +991,7 @@ void detect_classic_magic(void) {
uint8_t isGeneration = 0; uint8_t isGeneration = 0;
PacketResponseNG resp; PacketResponseNG resp;
clearCommandBuffer(); clearCommandBuffer();
SendCommandMIX(CMD_MIFARE_CIDENT, 0, 0, 0, NULL, 0); SendCommandNG(CMD_MIFARE_CIDENT, NULL, 0);
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500)) if (WaitForResponseTimeout(CMD_ACK, &resp, 1500))
isGeneration = resp.oldarg[0] & 0xff; isGeneration = resp.oldarg[0] & 0xff;

View file

@ -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 // Disable fast mode and send a dummy command to make it effective
if (enable == false) { if (enable == false) {
SendCommandMIX(CMD_PING, 0, 0, 0, NULL, 0); SendCommandNG(CMD_PING, NULL, 0);
WaitForResponseTimeout(CMD_ACK, NULL, 1000); WaitForResponseTimeout(CMD_ACK, NULL, 1000);
} }
@ -86,7 +86,7 @@ static int l_SendCommand(lua_State *L) {
* @return * @return
*/ */
static int l_SendCommandOLD(lua_State *L) { 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, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *data, size_t len)
uint64_t cmd, arg0, arg1, arg2; uint64_t cmd, arg0, arg1, arg2;