X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/f665067919fef6bff274d5ede3c30336edef5071..d1869c3336e82b7f2eb68b7fa9a5bdb865ff6b23:/client/cmdlf.c diff --git a/client/cmdlf.c b/client/cmdlf.c index 602f1b9d..93a1398d 100644 --- a/client/cmdlf.c +++ b/client/cmdlf.c @@ -29,6 +29,7 @@ #include "cmdlft55xx.h" #include "cmdlfpcf7931.h" #include "cmdlfio.h" +#include "cmdlfviking.h" #include "lfdemod.h" static int CmdHelp(const char *Cmd); @@ -423,6 +424,7 @@ int CmdIndalaClone(const char *Cmd) c.arg[1] = uid2; } + clearCommandBuffer(); SendCommand(&c); return 0; } @@ -545,6 +547,7 @@ int CmdLFSetConfig(const char *Cmd) //Averaging is a flag on high-bit of arg[1] UsbCommand c = {CMD_SET_LF_SAMPLING_CONFIG}; memcpy(c.d.asBytes,&config,sizeof(sample_config)); + clearCommandBuffer(); SendCommand(&c); return 0; } @@ -561,6 +564,7 @@ int CmdLFRead(const char *Cmd) if (param_getchar(Cmd, cmdp) == 's') arg1 = true; //suppress print //And ship it to device UsbCommand c = {CMD_ACQUIRE_RAW_ADC_SAMPLES_125K, {arg1,0,0}}; + clearCommandBuffer(); SendCommand(&c); //WaitForResponse(CMD_ACK,NULL); if ( !WaitForResponseTimeout(CMD_ACK,NULL,2500) ) { @@ -580,6 +584,7 @@ int CmdLFSnoop(const char *Cmd) } UsbCommand c = {CMD_LF_SNOOP_RAW_ADC_SAMPLES}; + clearCommandBuffer(); SendCommand(&c); WaitForResponse(CMD_ACK,NULL); return 0; @@ -626,6 +631,7 @@ int CmdLFSim(const char *Cmd) printf("\n"); PrintAndLog("Starting to simulate"); UsbCommand c = {CMD_SIMULATE_TAG_125K, {GraphTraceLen, gap, 0}}; + clearCommandBuffer(); SendCommand(&c); return 0; } @@ -775,6 +781,7 @@ int CmdLFfskSim(const char *Cmd) UsbCommand c = {CMD_FSK_SIM_TAG, {arg1, arg2, size}}; memcpy(c.d.asBytes, DemodBuffer, size); + clearCommandBuffer(); SendCommand(&c); return 0; } @@ -868,6 +875,7 @@ int CmdLFaskSim(const char *Cmd) UsbCommand c = {CMD_ASK_SIM_TAG, {arg1, arg2, size}}; PrintAndLog("preparing to sim ask data: %d bits", size); memcpy(c.d.asBytes, DemodBuffer, size); + clearCommandBuffer(); SendCommand(&c); return 0; } @@ -975,6 +983,7 @@ int CmdLFpskSim(const char *Cmd) UsbCommand c = {CMD_PSK_SIM_TAG, {arg1, arg2, size}}; PrintAndLog("DEBUG: Sending DemodBuffer Length: %d", size); memcpy(c.d.asBytes, DemodBuffer, size); + clearCommandBuffer(); SendCommand(&c); return 0; @@ -1128,13 +1137,6 @@ int CmdLFfind(const char *Cmd) return 1; } - //add psk and indala - ans=CmdIndalaDecode(""); - if (ans>0) { - PrintAndLog("\nValid Indala ID Found!"); - return 1; - } - ans=CmdAskEM410xDemod(""); if (ans>0) { PrintAndLog("\nValid EM410x ID Found!"); @@ -1165,6 +1167,12 @@ int CmdLFfind(const char *Cmd) return 1; } + ans=CmdIndalaDecode(""); + if (ans>0) { + PrintAndLog("\nValid Indala ID Found!"); + return 1; + } + ans=CmdPSKNexWatch(""); if (ans>0) { PrintAndLog("\nValid NexWatch ID Found!"); @@ -1185,7 +1193,8 @@ int CmdLFfind(const char *Cmd) return 1; } } - ans=ASKDemod("0 0 0",TRUE,FALSE,1); + bool st = TRUE; + ans=ASKDemod_ext("0 0 0",TRUE,FALSE,1,&st); if (ans>0) { PrintAndLog("\nUnknown ASK Modulated and Manchester encoded Tag Found!"); PrintAndLog("\nif it does not look right it could instead be ASK/Biphase - try 'data rawdemod ab'"); @@ -1206,14 +1215,15 @@ int CmdLFfind(const char *Cmd) static command_t CommandTable[] = { {"help", CmdHelp, 1, "This help"}, - {"awid", CmdLFAWID, 1, "{ AWID RFIDs... }"}, - {"em4x", CmdLFEM4X, 1, "{ EM4X RFIDs... }"}, - {"hid", CmdLFHID, 1, "{ HID RFIDs... }"}, + {"awid", CmdLFAWID, 1, "{ AWID RFIDs... }"}, + {"em4x", CmdLFEM4X, 1, "{ EM4X RFIDs... }"}, + {"hid", CmdLFHID, 1, "{ HID RFIDs... }"}, {"hitag", CmdLFHitag, 1, "{ Hitag tags and transponders... }"}, - {"io", CmdLFIO, 1, "{ ioProx tags... }"}, + {"io", CmdLFIO, 1, "{ ioProx tags... }"}, {"pcf7931", CmdLFPCF7931, 1, "{ PCF7931 RFIDs... }"}, - {"t55xx", CmdLFT55XX, 1, "{ T55xx RFIDs... }"}, - {"ti", CmdLFTI, 1, "{ TI RFIDs... }"}, + {"t55xx", CmdLFT55XX, 1, "{ T55xx RFIDs... }"}, + {"ti", CmdLFTI, 1, "{ TI RFIDs... }"}, + {"viking", CmdLFViking, 1, "{ Viking tags... }"}, {"cmdread", CmdLFCommandRead, 0, " ['H'] -- Modulate LF reader field to send command before read (all periods in microseconds) (option 'H' for 134)"}, {"config", CmdLFSetConfig, 0, "Set config for LF sampling, bit/sample, decimation, frequency"}, {"flexdemod", CmdFlexdemod, 1, "Demodulate samples for FlexPass"},