X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/31abe49fd323411b391dd10335eb4c60cfcecb06..e396001c47364fd52177960ef3b9ca3bef7adc3f:/client/cmdlf.c diff --git a/client/cmdlf.c b/client/cmdlf.c index 09d93002..f268eaa2 100644 --- a/client/cmdlf.c +++ b/client/cmdlf.c @@ -414,7 +414,6 @@ int CmdLFSetConfig(const char *Cmd) uint8_t cmdp =0; while(param_getchar(Cmd, cmdp) != 0x00) { - PrintAndLog("working %c", param_getchar(Cmd, cmdp)); switch(param_getchar(Cmd, cmdp)) { case 'h': @@ -519,7 +518,7 @@ static void ChkBitstream(const char *str) } } } - +//appears to attempt to simulate manchester int CmdLFSim(const char *Cmd) { int i,j; @@ -662,49 +661,94 @@ int CmdVchDemod(const char *Cmd) int CmdLFfind(const char *Cmd) { int ans=0; - char cmdp = param_getchar(Cmd, 0); - - if (strlen(Cmd) > 1 || cmdp == 'h' || cmdp == 'H') { - PrintAndLog("Usage: lf search <0|1>"); - PrintAndLog(" , if not set, try reading data from tag."); - PrintAndLog(""); - PrintAndLog(" sample: lf search"); - PrintAndLog(" : lf search 1"); - return 0; - } + char cmdp = param_getchar(Cmd, 0); + char testRaw = param_getchar(Cmd, 1); + if (strlen(Cmd) > 2 || cmdp == 'h' || cmdp == 'H') { + PrintAndLog("Usage: lf search <0|1> [u]"); + PrintAndLog(" , if not set, try reading data from tag."); + PrintAndLog(" [Search for Unknown tags] , if not set, reads only known tags."); + PrintAndLog(""); + PrintAndLog(" sample: lf search = try reading data from tag & search for known tags"); + PrintAndLog(" : lf search 1 = use data from GraphBuffer & search for known tags"); + PrintAndLog(" : lf search u = try reading data from tag & search for known and unknown tags"); + PrintAndLog(" : lf search 1 u = use data from GraphBuffer & search for known and unknown tags"); + + return 0; + } - if (!offline && (cmdp != '1')){ + if (!offline && (cmdp != '1')){ ans=CmdLFRead(""); ans=CmdSamples("20000"); - } else if (GraphTraceLen < 1000) { - PrintAndLog("Data in Graphbuffer was too small."); - return 0; + } else if (GraphTraceLen < 1000) { + PrintAndLog("Data in Graphbuffer was too small."); + return 0; } - + if (cmdp == 'u' || cmdp == 'U') testRaw = 'u'; PrintAndLog("NOTE: some demods output possible binary\n if it finds something that looks like a tag"); - PrintAndLog("Checking for known tags:"); + PrintAndLog("False Positives ARE possible\n"); + PrintAndLog("\nChecking for known tags:\n"); ans=CmdFSKdemodIO(""); if (ans>0) { - PrintAndLog("Valid IO Prox ID Found!"); + PrintAndLog("\nValid IO Prox ID Found!"); + return 1; + } + ans=CmdFSKdemodPyramid(""); + if (ans>0) { + PrintAndLog("\nValid Pyramid ID Found!"); + return 1; + } + ans=CmdFSKdemodParadox(""); + if (ans>0) { + PrintAndLog("\nValid Paradox ID Found!"); + return 1; + } + ans=CmdFSKdemodAWID(""); + if (ans>0) { + PrintAndLog("\nValid AWID ID Found!"); return 1; } ans=CmdFSKdemodHID(""); if (ans>0) { - PrintAndLog("Valid HID Prox ID Found!"); + PrintAndLog("\nValid HID Prox ID Found!"); return 1; } //add psk and indala - ans=CmdIndalaDecode("0"); + ans=CmdIndalaDecode(""); if (ans>0) { - PrintAndLog("Valid Indala ID Found!"); + PrintAndLog("\nValid Indala ID Found!"); return 1; } - ans=Cmdaskmandemod(""); + ans=CmdAskEM410xDemod(""); if (ans>0) { - PrintAndLog("Valid EM410x ID Found!"); + PrintAndLog("\nValid EM410x ID Found!"); return 1; } - PrintAndLog("No Known Tags Found!\n"); + PrintAndLog("\nNo Known Tags Found!\n"); + if (testRaw=='u' || testRaw=='U'){ + //test unknown tag formats (raw mode) + PrintAndLog("\nChecking for Unknown tags:\n"); + ans=CmdDetectClockRate("f"); + if (ans != 0){ //fsk + ans=CmdFSKrawdemod(""); + if (ans>0) { + PrintAndLog("\nUnknown FSK Modulated Tag Found!"); + return 1; + } + } + ans=Cmdaskmandemod(""); + if (ans>0) { + PrintAndLog("\nUnknown ASK Modulated and Manchester encoded Tag Found!"); + return 1; + } + ans=CmdPSK1rawDemod(""); + if (ans>0) { + PrintAndLog("Possible unknown PSK1 Modulated Tag Found above!\n\nCould also be PSK2 - try 'data psk2rawdemod'"); + PrintAndLog("\nCould also be PSK3 - [currently not supported]"); + PrintAndLog("\nCould also be NRZ - try 'data nrzrawdemod"); + return 1; + } + PrintAndLog("\nNo Data Found!\n"); + } return 0; } @@ -720,7 +764,7 @@ static command_t CommandTable[] = {"indalademod", CmdIndalaDemod, 1, "['224'] -- Demodulate samples for Indala 64 bit UID (option '224' for 224 bit)"}, {"indalaclone", CmdIndalaClone, 0, " ['l']-- Clone Indala to T55x7 (tag must be in antenna)(UID in HEX)(option 'l' for 224 UID"}, {"read", CmdLFRead, 0, "Read 125/134 kHz LF ID-only tag. Do 'lf read h' for help"}, - {"search", CmdLFfind, 1, "Read and Search for valid known tag (in offline mode it you can load first then search)"}, + {"search", CmdLFfind, 1, "[offline] ['u'] Read and Search for valid known tag (in offline mode it you can load first then search) - 'u' to search for unknown tags"}, {"sim", CmdLFSim, 0, "[GAP] -- Simulate LF tag from buffer with optional GAP (in microseconds)"}, {"simbidir", CmdLFSimBidir, 0, "Simulate LF tag (with bidirectional data transmission between reader and tag)"}, {"simman", CmdLFSimManchester, 0, " [GAP] Simulate arbitrary Manchester LF tag"},