Merge branch 'master' into mifareplus-only

This commit is contained in:
Dom 2018-05-11 10:16:44 +01:00
commit 6fd30efcff
40 changed files with 208 additions and 203 deletions

View file

@ -20,6 +20,7 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac
### Fixed ### Fixed
- Changed start sequence in Qt mode (fix: short commands hangs main Qt thread) (Merlok) - Changed start sequence in Qt mode (fix: short commands hangs main Qt thread) (Merlok)
- Changed driver file proxmark3.inf to support both old and new Product/Vendor IDs (piwi)
### Added ### Added
- Added a bitbang mode to `lf cmdread` if delay is 0 the cmd bits turn off and on the antenna with 0 and 1 respectively (marshmellow) - Added a bitbang mode to `lf cmdread` if delay is 0 the cmd bits turn off and on the antenna with 0 and 1 respectively (marshmellow)
@ -64,7 +65,7 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac
- Added lf hitag write 24, the command writes a block to hitag2 tags in crypto mode (henjo) - Added lf hitag write 24, the command writes a block to hitag2 tags in crypto mode (henjo)
### Added ### Added
- Added hf mf hardnested, an attack working for hardened Mifare cards (EV1, Mifare Plus SL1) where hf mf nested fails - Added hf mf hardnested, an attack working for hardened Mifare cards (EV1, Mifare Plus SL1) where hf mf nested fails (piwi)
- Added experimental testmode write option for t55xx (danger) (marshmellow) - Added experimental testmode write option for t55xx (danger) (marshmellow)
- Added t55xx p1detect to `lf search` chip detections (marshmellow) - Added t55xx p1detect to `lf search` chip detections (marshmellow)
- Added lf t55xx p1detect, detect page 1 of a t55xx tag based on E015 mfg code (marshmellow) - Added lf t55xx p1detect, detect page 1 of a t55xx tag based on E015 mfg code (marshmellow)

View file

@ -31,7 +31,7 @@
#endif #endif
// Craig Young - 14a stand-alone code // Craig Young - 14a stand-alone code
#ifdef WITH_ISO14443a_StandAlone #ifdef WITH_ISO14443a
#include "iso14443a.h" #include "iso14443a.h"
#endif #endif

View file

@ -985,39 +985,39 @@ void SimulateHitagSTag(bool tag_mem_supplied, byte_t* data) {
tag.max_page=0; tag.max_page=0;
//con1 //con1
tag.auth=0; tag.auth=0;
if((tag.pages[1][2]&0x80)==1) if (tag.pages[1][2]&0x80)
tag.auth=1; tag.auth=1;
tag.LCON=0; tag.LCON=0;
if((tag.pages[1][2]&0x2)==1) if (tag.pages[1][2]&0x2)
tag.LCON=1; tag.LCON=1;
tag.LKP=0; tag.LKP=0;
if((tag.pages[1][2]&0x1)==1) if (tag.pages[1][2]&0x1)
tag.LKP=1; tag.LKP=1;
//con2 //con2
//0=read write 1=read only //0=read write 1=read only
tag.LCK7=0; tag.LCK7=0;
if((tag.pages[1][1]&0x80)==1) if (tag.pages[1][1]&0x80)
tag.LCK7=1; tag.LCK7=1;
tag.LCK6=0; tag.LCK6=0;
if((tag.pages[1][1]&0x40)==1) if (tag.pages[1][1]&0x40)
tag.LCK6=1; tag.LCK6=1;
tag.LCK5=0; tag.LCK5=0;
if((tag.pages[1][1]&0x20)==1) if (tag.pages[1][1]&0x20)
tag.LCK5=1; tag.LCK5=1;
tag.LCK4=0; tag.LCK4=0;
if((tag.pages[1][1]&0x10)==1) if (tag.pages[1][1]&0x10)
tag.LCK4=1; tag.LCK4=1;
tag.LCK3=0; tag.LCK3=0;
if((tag.pages[1][1]&0x8)==1) if (tag.pages[1][1]&0x8)
tag.LCK3=1; tag.LCK3=1;
tag.LCK2=0; tag.LCK2=0;
if((tag.pages[1][1]&0x4)==1) if (tag.pages[1][1]&0x4)
tag.LCK2=1; tag.LCK2=1;
tag.LCK1=0; tag.LCK1=0;
if((tag.pages[1][1]&0x2)==1) if (tag.pages[1][1]&0x2)
tag.LCK1=1; tag.LCK1=1;
tag.LCK0=0; tag.LCK0=0;
if((tag.pages[1][1]&0x1)==1) if (tag.pages[1][1]&0x1)
tag.LCK0=1; tag.LCK0=1;
// Set up simulator mode, frequency divisor which will drive the FPGA // Set up simulator mode, frequency divisor which will drive the FPGA

View file

@ -105,7 +105,6 @@ CMDSRCS = crapto1/crapto1.c\
crc64.c \ crc64.c \
iso14443crc.c \ iso14443crc.c \
iso15693tools.c \ iso15693tools.c \
data.c \
graph.c \ graph.c \
ui.c \ ui.c \
cmddata.c \ cmddata.c \

View file

@ -12,7 +12,6 @@
#include <string.h> // also included in util.h #include <string.h> // also included in util.h
#include <inttypes.h> #include <inttypes.h>
#include <limits.h> // for CmdNorm INT_MIN && INT_MAX #include <limits.h> // for CmdNorm INT_MIN && INT_MAX
#include "data.h" // also included in util.h
#include "cmddata.h" #include "cmddata.h"
#include "util.h" #include "util.h"
#include "cmdmain.h" #include "cmdmain.h"
@ -591,8 +590,7 @@ int CmdBitsamples(const char *Cmd)
int cnt = 0; int cnt = 0;
uint8_t got[12288]; uint8_t got[12288];
GetFromBigBuf(got,sizeof(got),0); GetFromBigBuf(got, sizeof(got), 0 , NULL, -1, false);
WaitForResponse(CMD_ACK,NULL);
for (int j = 0; j < sizeof(got); j++) { for (int j = 0; j < sizeof(got); j++) {
for (int k = 0; k < 8; k++) { for (int k = 0; k < 8; k++) {
@ -1131,8 +1129,7 @@ int CmdHexsamples(const char *Cmd)
return 0; return 0;
} }
GetFromBigBuf(got,requested,offset); GetFromBigBuf(got, requested, offset, NULL, -1, false);
WaitForResponse(CMD_ACK,NULL);
i = 0; i = 0;
for (j = 0; j < requested; j++) { for (j = 0; j < requested; j++) {
@ -1200,10 +1197,9 @@ int getSamples(int n, bool silent)
n = sizeof(got); n = sizeof(got);
if (!silent) PrintAndLog("Reading %d bytes from device memory\n", n); if (!silent) PrintAndLog("Reading %d bytes from device memory\n", n);
GetFromBigBuf(got,n,0);
if (!silent) PrintAndLog("Data fetched");
UsbCommand response; UsbCommand response;
WaitForResponse(CMD_ACK, &response); GetFromBigBuf(got, n, 0, &response, -1, false);
if (!silent) PrintAndLog("Data fetched");
uint8_t bits_per_sample = 8; uint8_t bits_per_sample = 8;
//Old devices without this feature would send 0 at arg[0] //Old devices without this feature would send 0 at arg[0]

View file

@ -14,7 +14,6 @@
#include <string.h> #include <string.h>
#include "proxmark3.h" #include "proxmark3.h"
#include "util.h" #include "util.h"
#include "data.h"
#include "ui.h" #include "ui.h"
#include "iso14443crc.h" #include "iso14443crc.h"
#include "parity.h" #include "parity.h"
@ -497,8 +496,7 @@ int CmdHFList(const char *Cmd)
trace = malloc(USB_CMD_DATA_SIZE); trace = malloc(USB_CMD_DATA_SIZE);
// Query for the size of the trace // Query for the size of the trace
UsbCommand response; UsbCommand response;
GetFromBigBuf(trace, USB_CMD_DATA_SIZE, 0); GetFromBigBuf(trace, USB_CMD_DATA_SIZE, 0, &response, -1, false);
WaitForResponse(CMD_ACK, &response);
traceLen = response.arg[2]; traceLen = response.arg[2];
if (traceLen > USB_CMD_DATA_SIZE) { if (traceLen > USB_CMD_DATA_SIZE) {
uint8_t *p = realloc(trace, traceLen); uint8_t *p = realloc(trace, traceLen);
@ -508,8 +506,7 @@ int CmdHFList(const char *Cmd)
return 2; return 2;
} }
trace = p; trace = p;
GetFromBigBuf(trace, traceLen, 0); GetFromBigBuf(trace, traceLen, 0, NULL, -1, false);
WaitForResponse(CMD_ACK, NULL);
} }
} }

View file

@ -20,7 +20,6 @@
#include "util.h" #include "util.h"
#include "util_posix.h" #include "util_posix.h"
#include "iso14443crc.h" #include "iso14443crc.h"
#include "data.h"
#include "proxmark3.h" #include "proxmark3.h"
#include "ui.h" #include "ui.h"
#include "cmdparser.h" #include "cmdparser.h"

View file

@ -15,7 +15,6 @@
#include <stdint.h> #include <stdint.h>
#include "iso14443crc.h" #include "iso14443crc.h"
#include "proxmark3.h" #include "proxmark3.h"
#include "data.h"
#include "graph.h" #include "graph.h"
#include "util.h" #include "util.h"
#include "ui.h" #include "ui.h"

View file

@ -28,7 +28,6 @@
#include <stdint.h> #include <stdint.h>
#include "proxmark3.h" #include "proxmark3.h"
#include "data.h"
#include "graph.h" #include "graph.h"
#include "ui.h" #include "ui.h"
#include "util.h" #include "util.h"

View file

@ -16,7 +16,6 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <ctype.h> #include <ctype.h>
#include "iso14443crc.h" // Can also be used for iClass, using 0xE012 as CRC-type #include "iso14443crc.h" // Can also be used for iClass, using 0xE012 as CRC-type
#include "data.h"
#include "proxmark3.h" #include "proxmark3.h"
#include "ui.h" #include "ui.h"
#include "cmdparser.h" #include "cmdparser.h"
@ -750,8 +749,7 @@ int CmdHFiClassReader_Dump(const char *Cmd) {
blocksRead = (sizeof(tag_data)/8) - blockno; blocksRead = (sizeof(tag_data)/8) - blockno;
} }
// response ok - now get bigbuf content of the dump // response ok - now get bigbuf content of the dump
GetFromBigBuf(tag_data+(blockno*8), blocksRead*8, startindex); GetFromBigBuf(tag_data+(blockno*8), blocksRead*8, startindex, NULL, -1, false);
WaitForResponse(CMD_ACK,NULL);
size_t gotBytes = blocksRead*8 + blockno*8; size_t gotBytes = blocksRead*8 + blockno*8;
// try AA2 // try AA2
@ -793,8 +791,7 @@ int CmdHFiClassReader_Dump(const char *Cmd) {
blocksRead = (sizeof(tag_data) - gotBytes)/8; blocksRead = (sizeof(tag_data) - gotBytes)/8;
} }
// get dumped data from bigbuf // get dumped data from bigbuf
GetFromBigBuf(tag_data+gotBytes, blocksRead*8, startindex); GetFromBigBuf(tag_data+gotBytes, blocksRead*8, startindex, NULL, -1, false);
WaitForResponse(CMD_ACK,NULL);
gotBytes += blocksRead*8; gotBytes += blocksRead*8;
} else { //field is still on - turn it off... } else { //field is still on - turn it off...

View file

@ -12,7 +12,6 @@
#include <string.h> #include <string.h>
#include <inttypes.h> #include <inttypes.h>
#include "proxmark3.h" #include "proxmark3.h"
#include "data.h"
#include "ui.h" #include "ui.h"
#include "cmdparser.h" #include "cmdparser.h"
#include "cmdhflegic.h" #include "cmdhflegic.h"
@ -64,8 +63,7 @@ int CmdLegicDecode(const char *Cmd)
char token_type[4]; char token_type[4];
// copy data from proxmark into buffer // copy data from proxmark into buffer
GetFromBigBuf(data_buf,sizeof(data_buf),0); GetFromBigBuf(data_buf, sizeof(data_buf), 0, NULL, -1, false);
WaitForResponse(CMD_ACK,NULL);
// Output CDF System area (9 bytes) plus remaining header area (12 bytes) // Output CDF System area (9 bytes) plus remaining header area (12 bytes)
@ -294,8 +292,7 @@ int CmdLegicSave(const char *Cmd)
return -1; return -1;
} }
GetFromBigBuf(got,requested,offset); GetFromBigBuf(got, requested, offset, NULL, -1, false);
WaitForResponse(CMD_ACK,NULL);
for (int j = 0; j < requested; j += 8) { for (int j = 0; j < requested; j += 8) {
fprintf(f, "%02x %02x %02x %02x %02x %02x %02x %02x\n", fprintf(f, "%02x %02x %02x %02x %02x %02x %02x %02x\n",

View file

@ -16,7 +16,6 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "util.h" #include "util.h"
#include "data.h"
#include "ui.h" #include "ui.h"
#include "iso14443crc.h" #include "iso14443crc.h"
#include "parity.h" #include "parity.h"

View file

@ -22,7 +22,6 @@
#include "mifare.h" #include "mifare.h"
#include "util.h" #include "util.h"
#include "protocols.h" #include "protocols.h"
#include "data.h"
#define MAX_UL_BLOCKS 0x0f #define MAX_UL_BLOCKS 0x0f
#define MAX_ULC_BLOCKS 0x2b #define MAX_ULC_BLOCKS 0x2b
@ -1325,8 +1324,7 @@ int CmdHF14AMfUDump(const char *Cmd){
PrintAndLog("Data exceeded Buffer size!"); PrintAndLog("Data exceeded Buffer size!");
bufferSize = sizeof(data); bufferSize = sizeof(data);
} }
GetFromBigBuf(data, bufferSize, startindex); GetFromBigBuf(data, bufferSize, startindex, NULL, -1, false);
WaitForResponse(CMD_ACK,NULL);
Pages = bufferSize/4; Pages = bufferSize/4;
// Load lock bytes. // Load lock bytes.

View file

@ -18,7 +18,6 @@
#include "cmdhw.h" #include "cmdhw.h"
#include "cmdmain.h" #include "cmdmain.h"
#include "cmddata.h" #include "cmddata.h"
#include "data.h"
/* low-level hardware control */ /* low-level hardware control */
@ -429,9 +428,6 @@ int CmdVersion(const char *Cmd)
int CmdStatus(const char *Cmd) int CmdStatus(const char *Cmd)
{ {
uint8_t speed_test_buffer[USB_CMD_DATA_SIZE];
sample_buf = speed_test_buffer;
clearCommandBuffer(); clearCommandBuffer();
UsbCommand c = {CMD_STATUS}; UsbCommand c = {CMD_STATUS};
SendCommand(&c); SendCommand(&c);

View file

@ -22,7 +22,6 @@
#include "graph.h" // for graph data #include "graph.h" // for graph data
#include "cmdparser.h" // for getting cli commands included in cmdmain.h #include "cmdparser.h" // for getting cli commands included in cmdmain.h
#include "cmdmain.h" // for sending cmds to device #include "cmdmain.h" // for sending cmds to device
#include "data.h" // for GetFromBigBuf
#include "cmddata.h" // for `lf search` #include "cmddata.h" // for `lf search`
#include "cmdlfawid.h" // for awid menu #include "cmdlfawid.h" // for awid menu
#include "cmdlfem4x.h" // for em4x menu #include "cmdlfem4x.h" // for em4x menu
@ -327,7 +326,7 @@ int CmdLFSetConfig(const char *Cmd)
} }
bool lf_read(bool silent, uint32_t samples) { bool lf_read(bool silent, uint32_t samples) {
if (offline) return false; if (IsOffline()) return false;
UsbCommand c = {CMD_ACQUIRE_RAW_ADC_SAMPLES_125K, {silent,samples,0}}; UsbCommand c = {CMD_ACQUIRE_RAW_ADC_SAMPLES_125K, {silent,samples,0}};
clearCommandBuffer(); clearCommandBuffer();
//And ship it to device //And ship it to device
@ -870,7 +869,7 @@ int CmdVchDemod(const char *Cmd)
int CheckChipType(char cmdp) { int CheckChipType(char cmdp) {
uint32_t wordData = 0; uint32_t wordData = 0;
if (offline || cmdp == '1') return 0; if (IsOffline() || cmdp == '1') return 0;
save_restoreGB(GRAPH_SAVE); save_restoreGB(GRAPH_SAVE);
save_restoreDB(GRAPH_SAVE); save_restoreDB(GRAPH_SAVE);
@ -915,7 +914,7 @@ int CmdLFfind(const char *Cmd)
return 0; return 0;
} }
if (!offline && (cmdp != '1')) { if (!IsOffline() && (cmdp != '1')) {
lf_read(true, 30000); lf_read(true, 30000);
} else if (GraphTraceLen < minLength) { } else if (GraphTraceLen < minLength) {
PrintAndLog("Data in Graphbuffer was too small."); PrintAndLog("Data in Graphbuffer was too small.");
@ -931,7 +930,7 @@ int CmdLFfind(const char *Cmd)
// only run if graphbuffer is just noise as it should be for hitag/cotag // only run if graphbuffer is just noise as it should be for hitag/cotag
if (graphJustNoise(GraphBuffer, testLen)) { if (graphJustNoise(GraphBuffer, testLen)) {
// only run these tests if we are in online mode // only run these tests if we are in online mode
if (!offline && (cmdp != '1')) { if (!IsOffline() && (cmdp != '1')) {
// test for em4x05 in reader talk first mode. // test for em4x05 in reader talk first mode.
if (EM4x05Block0Test(&wordData)) { if (EM4x05Block0Test(&wordData)) {
PrintAndLog("\nValid EM4x05/EM4x69 Chip Found\nUse lf em 4x05readword/dump commands to read\n"); PrintAndLog("\nValid EM4x05/EM4x69 Chip Found\nUse lf em 4x05readword/dump commands to read\n");
@ -947,6 +946,7 @@ int CmdLFfind(const char *Cmd)
return 1; return 1;
} }
} }
PrintAndLog("\nNo Data Found! - maybe not an LF tag?\n");
return 0; return 0;
} }

View file

@ -13,7 +13,6 @@
#include "proxmark3.h" #include "proxmark3.h"
#include "ui.h" #include "ui.h"
#include "cmddata.h" #include "cmddata.h"
#include "data.h"
#include "cmdlfcotag.h" #include "cmdlfcotag.h"
#include "lfdemod.h" #include "lfdemod.h"
#include "usb_cmd.h" #include "usb_cmd.h"
@ -99,10 +98,9 @@ int CmdCOTAGRead(const char *Cmd) {
getSamples(0, true); break; getSamples(0, true); break;
} }
case 1: { case 1: {
GetFromBigBuf(DemodBuffer, COTAG_BITS, 0);
DemodBufferLen = COTAG_BITS;
UsbCommand response; UsbCommand response;
if ( !WaitForResponseTimeout(CMD_ACK, &response, 1000) ) { DemodBufferLen = COTAG_BITS;
if (!GetFromBigBuf(DemodBuffer, COTAG_BITS, 0, &response, 1000, true)) {
PrintAndLog("timeout while waiting for reply."); PrintAndLog("timeout while waiting for reply.");
return -1; return -1;
} }

View file

@ -15,7 +15,6 @@
#include "proxmark3.h" #include "proxmark3.h"
#include "ui.h" #include "ui.h"
#include "util.h" #include "util.h"
#include "data.h"
#include "graph.h" #include "graph.h"
#include "cmdparser.h" #include "cmdparser.h"
#include "cmddata.h" #include "cmddata.h"
@ -804,8 +803,7 @@ int usage_lf_em_read(void) {
bool downloadSamplesEM() { bool downloadSamplesEM() {
// 8 bit preamble + 32 bit word response (max clock (128) * 40bits = 5120 samples) // 8 bit preamble + 32 bit word response (max clock (128) * 40bits = 5120 samples)
uint8_t got[6000]; uint8_t got[6000];
GetFromBigBuf(got, sizeof(got), 0); if (!GetFromBigBuf(got, sizeof(got), 0, NULL, 4000, true)) {
if ( !WaitForResponseTimeout(CMD_ACK, NULL, 4000) ) {
PrintAndLog("command execution time out"); PrintAndLog("command execution time out");
return false; return false;
} }

View file

@ -11,7 +11,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "data.h"
#include "proxmark3.h" #include "proxmark3.h"
#include "ui.h" #include "ui.h"
#include "cmdparser.h" #include "cmdparser.h"
@ -34,8 +33,7 @@ int CmdLFHitagList(const char *Cmd)
// Query for the actual size of the trace // Query for the actual size of the trace
UsbCommand response; UsbCommand response;
GetFromBigBuf(got, USB_CMD_DATA_SIZE, 0); GetFromBigBuf(got, USB_CMD_DATA_SIZE, 0, &response, -1, false);
WaitForResponse(CMD_ACK, &response);
uint16_t traceLen = response.arg[2]; uint16_t traceLen = response.arg[2];
if (traceLen > USB_CMD_DATA_SIZE) { if (traceLen > USB_CMD_DATA_SIZE) {
uint8_t *p = realloc(got, traceLen); uint8_t *p = realloc(got, traceLen);
@ -45,8 +43,7 @@ int CmdLFHitagList(const char *Cmd)
return 2; return 2;
} }
got = p; got = p;
GetFromBigBuf(got, traceLen, 0); GetFromBigBuf(got, traceLen, 0, NULL, -1, false);
WaitForResponse(CMD_ACK,NULL);
} }
PrintAndLog("recorded activity (TraceLen = %d bytes):"); PrintAndLog("recorded activity (TraceLen = %d bytes):");

View file

@ -15,7 +15,6 @@
#include <limits.h> #include <limits.h>
#include "cmdlfio.h" #include "cmdlfio.h"
#include "proxmark3.h" #include "proxmark3.h"
#include "data.h"
#include "graph.h" #include "graph.h"
#include "ui.h" #include "ui.h"
#include "cmdparser.h" #include "cmdparser.h"

View file

@ -21,7 +21,6 @@
#include "cmdlf.h" #include "cmdlf.h"
#include "cmdlft55xx.h" #include "cmdlft55xx.h"
#include "util.h" #include "util.h"
#include "data.h"
#include "lfdemod.h" #include "lfdemod.h"
#include "cmdhf14a.h" //for getTagInfo #include "cmdhf14a.h" //for getTagInfo
#include "protocols.h" #include "protocols.h"
@ -1355,8 +1354,7 @@ int CmdResetRead(const char *Cmd) {
} }
uint8_t got[BIGBUF_SIZE-1]; uint8_t got[BIGBUF_SIZE-1];
GetFromBigBuf(got,sizeof(got),0); GetFromBigBuf(got, sizeof(got), 0, NULL, -1 , 0);
WaitForResponse(CMD_ACK,NULL);
setGraphBuf(got, sizeof(got)); setGraphBuf(got, sizeof(got));
return 1; return 1;
} }

View file

@ -8,16 +8,17 @@
// Low frequency TI commands // Low frequency TI commands
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "cmdlfti.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <inttypes.h> #include <inttypes.h>
#include "crc16.h" #include "crc16.h"
#include "proxmark3.h" #include "proxmark3.h"
#include "data.h"
#include "ui.h" #include "ui.h"
#include "graph.h" #include "graph.h"
#include "cmdparser.h" #include "cmdparser.h"
#include "cmdlfti.h" #include "util.h"
static int CmdHelp(const char *Cmd); static int CmdHelp(const char *Cmd);

View file

@ -17,7 +17,6 @@
#include <string.h> #include <string.h>
#include "cmdparser.h" #include "cmdparser.h"
#include "proxmark3.h" #include "proxmark3.h"
#include "data.h"
#include "usb_cmd.h" #include "usb_cmd.h"
#include "ui.h" #include "ui.h"
#include "cmdhf.h" #include "cmdhf.h"
@ -29,8 +28,6 @@
#include "cmdscript.h" #include "cmdscript.h"
unsigned int current_command = CMD_UNKNOWN;
static int CmdHelp(const char *Cmd); static int CmdHelp(const char *Cmd);
static int CmdQuit(const char *Cmd); static int CmdQuit(const char *Cmd);

View file

@ -25,7 +25,7 @@ void CmdsHelp(const command_t Commands[])
int i = 0; int i = 0;
while (Commands[i].Name) while (Commands[i].Name)
{ {
if (!offline || Commands[i].Offline) if (!IsOffline() || Commands[i].Offline)
PrintAndLog("%-16s %s", Commands[i].Name, Commands[i].Help); PrintAndLog("%-16s %s", Commands[i].Name, Commands[i].Help);
++i; ++i;
} }

View file

@ -17,7 +17,6 @@
#include "proxmark3.h" #include "proxmark3.h"
#include "scripting.h" #include "scripting.h"
#include "data.h"
#include "ui.h" #include "ui.h"
#include "graph.h" #include "graph.h"
#include "cmdparser.h" #include "cmdparser.h"

View file

@ -15,16 +15,15 @@
#include "uart.h" #include "uart.h"
#include "ui.h" #include "ui.h"
#include "common.h" #include "common.h"
#include "data.h"
#include "util_posix.h" #include "util_posix.h"
// Declare globals. // Declare globals.
// Serial port that we are communicating with the PM3 on. // Serial port that we are communicating with the PM3 on.
serial_port sp; static serial_port sp;
// If TRUE, then there is no active connection to the PM3, and we will drop commands sent. // If TRUE, then there is no active connection to the PM3, and we will drop commands sent.
bool offline; static bool offline;
// Transmit buffer. // Transmit buffer.
// TODO: Use locks and execute this on the main thread, rather than the receiver // TODO: Use locks and execute this on the main thread, rather than the receiver
@ -47,10 +46,52 @@ static int cmd_tail = 0;
// to lock cmdBuffer operations from different threads // to lock cmdBuffer operations from different threads
static pthread_mutex_t cmdBufferMutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t cmdBufferMutex = PTHREAD_MUTEX_INITIALIZER;
// These wrappers are required because it is not possible to access a static
// global variable outside of the context of a single file.
void SetOffline(bool new_offline) {
offline = new_offline;
}
bool IsOffline() {
return offline;
}
bool OpenProxmark(char *portname, bool waitCOMPort, int timeout) {
if (!waitCOMPort) {
sp = uart_open(portname);
} else {
printf("Waiting for Proxmark to appear on %s ", portname);
fflush(stdout);
int openCount = 0;
do {
sp = uart_open(portname);
msleep(1000);
printf(".");
fflush(stdout);
} while(++openCount < timeout && (sp == INVALID_SERIAL_PORT || sp == CLAIMED_SERIAL_PORT));
printf("\n");
}
// check result of uart opening
if (sp == INVALID_SERIAL_PORT) {
printf("ERROR: invalid serial port\n");
return false;
} else if (sp == CLAIMED_SERIAL_PORT) {
printf("ERROR: serial port is claimed by another process\n");
return false;
} else {
return true;
}
}
void CloseProxmark(void) {
uart_close(sp);
}
void SendCommand(UsbCommand *c) { void SendCommand(UsbCommand *c) {
#if 0 #ifdef COMMS_DEBUG
printf("Sending %d bytes\n", sizeof(UsbCommand)); printf("Sending %04x cmd\n", c->cmd);
#endif #endif
if (offline) { if (offline) {
@ -63,6 +104,7 @@ void SendCommand(UsbCommand *c) {
Not good.../holiman Not good.../holiman
**/ **/
while(txcmd_pending); while(txcmd_pending);
txcmd = *c; txcmd = *c;
txcmd_pending = true; txcmd_pending = true;
} }
@ -130,11 +172,11 @@ int getCommand(UsbCommand* response)
} }
//----------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Entry point into our code: called whenever we received a packet over USB // Entry point into our code: called whenever we received a packet over USB.
// that we weren't necessarily expecting, for example a debug print. // Handle debug commands directly, store all other commands in circular buffer.
//----------------------------------------------------------------------------- //----------------------------------------------------------------------------------
void UsbCommandReceived(UsbCommand *UC) static void UsbCommandReceived(UsbCommand *UC)
{ {
switch(UC->cmd) { switch(UC->cmd) {
// First check if we are handling a debug message // First check if we are handling a debug message
@ -152,11 +194,6 @@ void UsbCommandReceived(UsbCommand *UC)
return; return;
} break; } break;
case CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K: {
memcpy(sample_buf+(UC->arg[0]),UC->d.asBytes,UC->arg[1]);
return;
} break;
default: default:
storeCommand(UC); storeCommand(UC);
break; break;
@ -172,12 +209,12 @@ __attribute__((force_align_arg_pointer))
#endif #endif
#endif #endif
*uart_receiver(void *targ) { *uart_receiver(void *targ) {
receiver_arg *arg = (receiver_arg*)targ; receiver_arg *conn = (receiver_arg*)targ;
size_t rxlen; size_t rxlen;
uint8_t rx[sizeof(UsbCommand)]; uint8_t rx[sizeof(UsbCommand)];
uint8_t *prx = rx; uint8_t *prx = rx;
while (arg->run) { while (conn->run) {
rxlen = 0; rxlen = 0;
if (uart_receive(sp, prx, sizeof(UsbCommand) - (prx-rx), &rxlen) && rxlen) { if (uart_receive(sp, prx, sizeof(UsbCommand) - (prx-rx), &rxlen) && rxlen) {
prx += rxlen; prx += rxlen;
@ -201,19 +238,76 @@ __attribute__((force_align_arg_pointer))
} }
/**
* Data transfer from Proxmark to client. This method times out after
* ms_timeout milliseconds.
* @brief GetFromBigBuf
* @param dest Destination address for transfer
* @param bytes number of bytes to be transferred
* @param start_index offset into Proxmark3 BigBuf[]
* @param response struct to copy last command (CMD_ACK) into
* @param ms_timeout timeout in milliseconds
* @param show_warning display message after 2 seconds
* @return true if command was returned, otherwise false
*/
bool GetFromBigBuf(uint8_t *dest, int bytes, int start_index, UsbCommand *response, size_t ms_timeout, bool show_warning)
{
UsbCommand c = {CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K, {start_index, bytes, 0}};
SendCommand(&c);
uint64_t start_time = msclock();
UsbCommand resp;
if (response == NULL) {
response = &resp;
}
int bytes_completed = 0;
while(true) {
if (getCommand(response)) {
if (response->cmd == CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K) {
int copy_bytes = MIN(bytes - bytes_completed, response->arg[1]);
memcpy(dest + response->arg[0], response->d.asBytes, copy_bytes);
bytes_completed += copy_bytes;
} else if (response->cmd == CMD_ACK) {
return true;
}
}
if (msclock() - start_time > ms_timeout) {
break;
}
if (msclock() - start_time > 2000 && show_warning) {
PrintAndLog("Waiting for a response from the proxmark...");
PrintAndLog("You can cancel this operation by pressing the pm3 button");
show_warning = false;
}
}
return false;
}
/** /**
* Waits for a certain response type. This method waits for a maximum of * Waits for a certain response type. This method waits for a maximum of
* ms_timeout milliseconds for a specified response command. * ms_timeout milliseconds for a specified response command.
*@brief WaitForResponseTimeout *@brief WaitForResponseTimeout
* @param cmd command to wait for * @param cmd command to wait for, or CMD_UNKNOWN to take any command.
* @param response struct to copy received command into. * @param response struct to copy received command into.
* @param ms_timeout * @param ms_timeout
* @param show_warning display message after 2 seconds
* @return true if command was returned, otherwise false * @return true if command was returned, otherwise false
*/ */
bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeout, bool show_warning) { bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeout, bool show_warning) {
UsbCommand resp; UsbCommand resp;
#ifdef COMMS_DEBUG
printf("Waiting for %04x cmd\n", cmd);
#endif
if (response == NULL) { if (response == NULL) {
response = &resp; response = &resp;
} }
@ -223,7 +317,7 @@ bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeo
// Wait until the command is received // Wait until the command is received
while (true) { while (true) {
while(getCommand(response)) { while(getCommand(response)) {
if(response->cmd == cmd){ if (cmd == CMD_UNKNOWN || response->cmd == cmd) {
return true; return true;
} }
} }
@ -233,6 +327,7 @@ bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeo
} }
if (msclock() - start_time > 2000 && show_warning) { if (msclock() - start_time > 2000 && show_warning) {
// 2 seconds elapsed (but this doesn't mean the timeout was exceeded)
PrintAndLog("Waiting for a response from the proxmark..."); PrintAndLog("Waiting for a response from the proxmark...");
PrintAndLog("You can cancel this operation by pressing the pm3 button"); PrintAndLog("You can cancel this operation by pressing the pm3 button");
show_warning = false; show_warning = false;

View file

@ -30,16 +30,20 @@ typedef struct {
pthread_mutex_t recv_lock; pthread_mutex_t recv_lock;
} receiver_arg; } receiver_arg;
void SetOffline(bool new_offline);
bool IsOffline();
bool OpenProxmark(char *portname, bool waitCOMPort, int timeout);
void CloseProxmark(void);
void SendCommand(UsbCommand *c); void SendCommand(UsbCommand *c);
void *uart_receiver(void *targ); void *uart_receiver(void *targ);
void UsbCommandReceived(UsbCommand *UC);
void clearCommandBuffer(); void clearCommandBuffer();
bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeout, bool show_warning); bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeout, bool show_warning);
bool WaitForResponseTimeout(uint32_t cmd, UsbCommand* response, size_t ms_timeout); bool WaitForResponseTimeout(uint32_t cmd, UsbCommand* response, size_t ms_timeout);
bool WaitForResponse(uint32_t cmd, UsbCommand* response); bool WaitForResponse(uint32_t cmd, UsbCommand* response);
bool GetFromBigBuf(uint8_t *dest, int bytes, int start_index, UsbCommand *response, size_t ms_timeout, bool show_warning);
extern serial_port sp;
extern bool offline;
#endif // COMMS_H_ #endif // COMMS_H_

View file

@ -1,25 +0,0 @@
//-----------------------------------------------------------------------------
// Copyright (C) 2010 iZsh <izsh at fail0verflow.com>
//
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// Data utilities
//-----------------------------------------------------------------------------
#include <string.h>
#include <stdint.h>
#include "data.h"
#include "ui.h"
#include "proxmark3.h"
#include "cmdmain.h"
uint8_t* sample_buf;
void GetFromBigBuf(uint8_t *dest, int bytes, int start_index)
{
sample_buf = dest;
UsbCommand c = {CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K, {start_index, bytes, 0}};
SendCommand(&c);
}

View file

@ -1,23 +0,0 @@
//-----------------------------------------------------------------------------
// Copyright (C) 2010 iZsh <izsh at fail0verflow.com>
//
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// Data utilities
//-----------------------------------------------------------------------------
#ifndef DATA_H__
#define DATA_H__
#include <stdint.h>
#define FILE_PATH_SIZE 1000
extern uint8_t* sample_buf;
#define arraylen(x) (sizeof(x)/sizeof((x)[0]))
void GetFromBigBuf(uint8_t *dest, int bytes, int start_index);
#endif

View file

@ -27,9 +27,6 @@ void ReceiveCommand(UsbCommand* rxcmd);
serial_port sp; serial_port sp;
// FIXME: what the fuckity fuck
unsigned int current_command = CMD_UNKNOWN;
#define FLASH_START 0x100000 #define FLASH_START 0x100000
#define FLASH_SIZE (256*1024) #define FLASH_SIZE (256*1024)
#define FLASH_END (FLASH_START + FLASH_SIZE) #define FLASH_END (FLASH_START + FLASH_SIZE)
@ -52,13 +49,14 @@ void CloseProxmark(const char *serial_port_name) {
unlink(serial_port_name); unlink(serial_port_name);
} }
int OpenProxmark(size_t i, const char *serial_port_name) { bool OpenProxmark(size_t i, const char *serial_port_name) {
sp = uart_open(serial_port_name); sp = uart_open(serial_port_name);
if (sp == INVALID_SERIAL_PORT || sp == CLAIMED_SERIAL_PORT) { if (sp == INVALID_SERIAL_PORT || sp == CLAIMED_SERIAL_PORT) {
//poll once a second //poll once a second
return 0; return false;
} }
return 1;
return true;
} }
// Turn PHDRs into flasher segments, checking for PHDR sanity and merging adjacent // Turn PHDRs into flasher segments, checking for PHDR sanity and merging adjacent
@ -355,6 +353,7 @@ static int enter_bootloader(char *serial_port_name)
SendCommand(&c); SendCommand(&c);
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");
} }
msleep(100); msleep(100);
CloseProxmark(serial_port_name); CloseProxmark(serial_port_name);
@ -363,6 +362,7 @@ static int enter_bootloader(char *serial_port_name)
sleep(1); sleep(1);
fprintf(stderr, "."); fprintf(stderr, ".");
} while (!OpenProxmark(0, serial_port_name)); } while (!OpenProxmark(0, serial_port_name));
fprintf(stderr," Found.\n"); fprintf(stderr," Found.\n");
return 0; return 0;

View file

@ -32,7 +32,7 @@ int flash_write(flash_file_t *ctx);
void flash_free(flash_file_t *ctx); void flash_free(flash_file_t *ctx);
int flash_stop_flashing(void); int flash_stop_flashing(void);
void CloseProxmark(const char *serial_port_name); void CloseProxmark(const char *serial_port_name);
int OpenProxmark(size_t i, const char *serial_port_name); bool OpenProxmark(size_t i, const char *serial_port_name);
extern serial_port sp; extern serial_port sp;
#endif #endif

View file

@ -31,7 +31,6 @@ usb_dev_handle *devh = NULL;
static unsigned int claimed_iface = 0; static unsigned int claimed_iface = 0;
unsigned char return_on_error = 0; unsigned char return_on_error = 0;
unsigned char error_occured = 0; unsigned char error_occured = 0;
extern unsigned int current_command;
void SendCommand(UsbCommand *c) void SendCommand(UsbCommand *c)
{ {
@ -40,7 +39,6 @@ void SendCommand(UsbCommand *c)
#if 0 #if 0
printf("Sending %d bytes\n", sizeof(UsbCommand)); printf("Sending %d bytes\n", sizeof(UsbCommand));
#endif #endif
current_command = c->cmd;
ret = usb_bulk_write(devh, 0x01, (char*)c, sizeof(UsbCommand), 1000); ret = usb_bulk_write(devh, 0x01, (char*)c, sizeof(UsbCommand), 1000);
if (ret<0) { if (ret<0) {
error_occured = 1; error_occured = 1;

View file

@ -13,8 +13,8 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "data.h"
#include "crapto1/crapto1.h" #include "crapto1/crapto1.h"
#include "util.h"
// defaults // defaults
// timeout in units. (ms * 106)/10 or us*0.0106 // timeout in units. (ms * 106)/10 or us*0.0106

View file

@ -21,7 +21,6 @@
#include "util_posix.h" #include "util_posix.h"
#include "proxgui.h" #include "proxgui.h"
#include "cmdmain.h" #include "cmdmain.h"
#include "uart.h"
#include "ui.h" #include "ui.h"
#include "util.h" #include "util.h"
#include "cmdparser.h" #include "cmdparser.h"
@ -46,9 +45,12 @@ main_loop(char *script_cmds_file, char *script_cmd, bool usb_present) {
if (usb_present) { if (usb_present) {
conn.run = true; conn.run = true;
SetOffline(false);
pthread_create(&reader_thread, NULL, &uart_receiver, &conn); pthread_create(&reader_thread, NULL, &uart_receiver, &conn);
// cache Version information now: // cache Version information now:
CmdVersion(NULL); CmdVersion(NULL);
} else {
SetOffline(true);
} }
// file with script // file with script
@ -235,7 +237,7 @@ int main(int argc, char* argv[]) {
if(strcmp(argv[i],"-f") == 0 || strcmp(argv[i],"-flush") == 0){ if(strcmp(argv[i],"-f") == 0 || strcmp(argv[i],"-flush") == 0){
printf("Output will be flushed after every print.\n"); printf("Output will be flushed after every print.\n");
flushAfterWrite = 1; SetFlushAfterWrite(true);
} }
if(strcmp(argv[i],"-w") == 0 || strcmp(argv[i],"-wait") == 0){ if(strcmp(argv[i],"-w") == 0 || strcmp(argv[i],"-wait") == 0){
@ -291,35 +293,8 @@ int main(int argc, char* argv[]) {
// set global variables // set global variables
set_my_executable_path(); set_my_executable_path();
// open uart // try to open USB connection to Proxmark
if (!waitCOMPort) { usb_present = OpenProxmark(argv[1], waitCOMPort, 20);
sp = uart_open(argv[1]);
} else {
printf("Waiting for Proxmark to appear on %s ", argv[1]);
fflush(stdout);
int openCount = 0;
do {
sp = uart_open(argv[1]);
msleep(1000);
printf(".");
fflush(stdout);
} while(++openCount < 20 && (sp == INVALID_SERIAL_PORT || sp == CLAIMED_SERIAL_PORT));
printf("\n");
}
// check result of uart opening
if (sp == INVALID_SERIAL_PORT) {
printf("ERROR: invalid serial port\n");
usb_present = false;
offline = 1;
} else if (sp == CLAIMED_SERIAL_PORT) {
printf("ERROR: serial port is claimed by another process\n");
usb_present = false;
offline = 1;
} else {
usb_present = true;
offline = 0;
}
#ifdef HAVE_GUI #ifdef HAVE_GUI
#ifdef _WIN32 #ifdef _WIN32
@ -344,7 +319,7 @@ int main(int argc, char* argv[]) {
// Clean up the port // Clean up the port
if (usb_present) { if (usb_present) {
uart_close(sp); CloseProxmark();
} }
exit(0); exit(0);

View file

@ -22,8 +22,7 @@
double CursorScaleFactor = 1; double CursorScaleFactor = 1;
int PlotGridX=0, PlotGridY=0, PlotGridXdefault= 64, PlotGridYdefault= 64, CursorCPos= 0, CursorDPos= 0; int PlotGridX=0, PlotGridY=0, PlotGridXdefault= 64, PlotGridYdefault= 64, CursorCPos= 0, CursorDPos= 0;
int offline; bool flushAfterWrite = false; //buzzy
int flushAfterWrite = 0; //buzzy
int GridOffset = 0; int GridOffset = 0;
bool GridLocked = false; bool GridLocked = false;
bool showDemod = true; bool showDemod = true;
@ -93,7 +92,7 @@ void PrintAndLog(char *fmt, ...)
} }
va_end(argptr2); va_end(argptr2);
if (flushAfterWrite == 1) //buzzy if (flushAfterWrite) //buzzy
{ {
fflush(NULL); fflush(NULL);
} }
@ -106,3 +105,8 @@ void SetLogFilename(char *fn)
{ {
logfilename = fn; logfilename = fn;
} }
void SetFlushAfterWrite(bool flush_after_write) {
flushAfterWrite = flush_after_write;
}

View file

@ -20,10 +20,10 @@ void ShowGraphWindow(void);
void RepaintGraphWindow(void); void RepaintGraphWindow(void);
void PrintAndLog(char *fmt, ...); void PrintAndLog(char *fmt, ...);
void SetLogFilename(char *fn); void SetLogFilename(char *fn);
void SetFlushAfterWrite(bool flush_after_write);
extern double CursorScaleFactor; extern double CursorScaleFactor;
extern int PlotGridX, PlotGridY, PlotGridXdefault, PlotGridYdefault, CursorCPos, CursorDPos, GridOffset; extern int PlotGridX, PlotGridY, PlotGridXdefault, PlotGridYdefault, CursorCPos, CursorDPos, GridOffset;
extern int flushAfterWrite; //buzzy
extern bool GridLocked; extern bool GridLocked;
extern bool showDemod; extern bool showDemod;

View file

@ -16,7 +16,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#include "data.h"
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>

View file

@ -24,10 +24,17 @@
#ifndef MAX #ifndef MAX
# define MAX(a, b) (((a) > (b)) ? (a) : (b)) # define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif #endif
#ifndef arraylen
#define arraylen(x) (sizeof(x)/sizeof((x)[0]))
#endif
#define EVEN 0 #define EVEN 0
#define ODD 1 #define ODD 1
#ifndef FILE_PATH_SIZE
#define FILE_PATH_SIZE 2000
#endif
extern int ukbhit(void); extern int ukbhit(void);
extern void AddLogLine(char *fileName, char *extData, char *c); extern void AddLogLine(char *fileName, char *extData, char *c);

View file

@ -29,7 +29,7 @@ GZIP=gzip
OBJDIR = obj OBJDIR = obj
INCLUDE = -I../include -I../common INCLUDE = -I../include -I../common -I.
TAR=tar TAR=tar
TARFLAGS = -C .. -rvf TARFLAGS = -C .. -rvf

View file

@ -11,6 +11,12 @@
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
//#include "iso15693tools.h" //#include "iso15693tools.h"
#ifdef ON_DEVICE
#include "printf.h"
#else
#include <stdio.h>
#endif
#define POLY 0x8408 #define POLY 0x8408
@ -51,8 +57,6 @@ int Iso15693AddCrc(uint8_t *req, int n) {
} }
int sprintf(char *str, const char *format, ...);
// returns a string representation of the UID // returns a string representation of the UID
// UID is transmitted and stored LSB first, displayed MSB first // UID is transmitted and stored LSB first, displayed MSB first
// target char* buffer, where to put the UID, if NULL a static buffer is returned // target char* buffer, where to put the UID, if NULL a static buffer is returned

View file

@ -3,16 +3,18 @@ Signature="$Windows NT$"
Class=Ports Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%ProviderName% Provider=%ProviderName%
DriverVer=31/05/2017,1.1.0.0 DriverVer=03/05/2018,1.1.1.0
[MANUFACTURER] [MANUFACTURER]
%ProviderName%=DeviceList, NTx86, NTamd64 %ProviderName%=DeviceList, NTx86, NTamd64
[DeviceList.NTx86] [DeviceList.NTx86]
%DeviceName%=DriverInstall,USB\VID_9AC4&PID_4B8F %DeviceName%=DriverInstall,USB\VID_9AC4&PID_4B8F
%DeviceName_old%=DriverInstall,USB\VID_2d2d&PID_504d
[DeviceList.NTamd64] [DeviceList.NTamd64]
%DeviceName%=DriverInstall,USB\VID_9AC4&PID_4B8F %DeviceName%=DriverInstall,USB\VID_9AC4&PID_4B8F
%DeviceName_old%=DriverInstall,USB\VID_2d2d&PID_504d
[DriverInstall] [DriverInstall]
include=mdmcpq.inf include=mdmcpq.inf
@ -30,3 +32,4 @@ HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
[Strings] [Strings]
ProviderName = "proxmark.org" ProviderName = "proxmark.org"
DeviceName = "Proxmark3" DeviceName = "Proxmark3"
DeviceName_old = "Proxmark3 (old)"