]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlf.c
fix bug in st detect +
[proxmark3-svn] / client / cmdlf.c
index 8d789a8e0b0de7562c294b5349c02375bac50c0c..f78b380151d87cdacfe6855765b2dd0e67eab15e 100644 (file)
@@ -42,6 +42,7 @@
 #include "cmdlfnexwatch.h"//for nexwatch menu
 #include "cmdlfjablotron.h" //for jablotron menu
 #include "cmdlfnoralsy.h"// for noralsy menu
 #include "cmdlfnexwatch.h"//for nexwatch menu
 #include "cmdlfjablotron.h" //for jablotron menu
 #include "cmdlfnoralsy.h"// for noralsy menu
+#include "cmdlfsecurakey.h"//for securakey menu
 
 bool g_lf_threshold_set = false;
 static int CmdHelp(const char *Cmd);
 
 bool g_lf_threshold_set = false;
 static int CmdHelp(const char *Cmd);
@@ -862,16 +863,25 @@ int CheckChipType(char cmdp) {
 
        //check for em4x05/em4x69 chips first
        save_restoreGB(1);
 
        //check for em4x05/em4x69 chips first
        save_restoreGB(1);
+       save_restoreDB(1);
        if ((!offline && (cmdp != '1')) && EM4x05Block0Test(&wordData)) {
                PrintAndLog("\nValid EM4x05/EM4x69 Chip Found\nTry lf em 4x05... commands\n");
                save_restoreGB(0);
        if ((!offline && (cmdp != '1')) && EM4x05Block0Test(&wordData)) {
                PrintAndLog("\nValid EM4x05/EM4x69 Chip Found\nTry lf em 4x05... commands\n");
                save_restoreGB(0);
+               save_restoreDB(0);
                return 1;
        }
 
        //TODO check for t55xx chip...
 
                return 1;
        }
 
        //TODO check for t55xx chip...
 
+       if ((!offline && (cmdp != '1')) && tryDetectP1(true)) {
+               PrintAndLog("\nValid T55xx Chip Found\nTry lf t55xx ... commands\n");
+               save_restoreGB(0);
+               save_restoreDB(0);
+               return 1;               
+       }
        save_restoreGB(0);
        save_restoreGB(0);
-       return 1;
+       save_restoreDB(0);
+       return 0;
 }
 
 //by marshmellow
 }
 
 //by marshmellow
@@ -923,7 +933,7 @@ int CmdLFfind(const char *Cmd)
                                return 1;
                        }
                        ans=CmdCOTAGRead("");
                                return 1;
                        }
                        ans=CmdCOTAGRead("");
-                       if (ans>0){
+                       if (ans>0) {
                                PrintAndLog("\nValid COTAG ID Found!");
                                return 1;
                        }
                                PrintAndLog("\nValid COTAG ID Found!");
                                return 1;
                        }
@@ -931,6 +941,8 @@ int CmdLFfind(const char *Cmd)
                return 0;
        }
 
                return 0;
        }
 
+       // TODO test for modulation then only test formats that use that modulation
+
        ans=CmdFSKdemodIO("");
        if (ans>0) {
                PrintAndLog("\nValid IO Prox ID Found!");
        ans=CmdFSKdemodIO("");
        if (ans>0) {
                PrintAndLog("\nValid IO Prox ID Found!");
@@ -979,13 +991,13 @@ int CmdLFfind(const char *Cmd)
                return CheckChipType(cmdp);
        }
 
                return CheckChipType(cmdp);
        }
 
-       ans=CmdFdxDemod("");
+       ans=CmdFdxDemod(""); //biphase
        if (ans>0) {
                PrintAndLog("\nValid FDX-B ID Found!");
                return CheckChipType(cmdp);
        }
 
        if (ans>0) {
                PrintAndLog("\nValid FDX-B ID Found!");
                return CheckChipType(cmdp);
        }
 
-       ans=EM4x50Read("", false);
+       ans=EM4x50Read("", false); //ask
        if (ans>0) {
                PrintAndLog("\nValid EM4x50 ID Found!");
                return 1;
        if (ans>0) {
                PrintAndLog("\nValid EM4x50 ID Found!");
                return 1;
@@ -1003,13 +1015,19 @@ int CmdLFfind(const char *Cmd)
                return CheckChipType(cmdp);
        }
 
                return CheckChipType(cmdp);
        }
 
+       ans=CmdSecurakeyDemod("");
+       if (ans>0) {
+               PrintAndLog("\nValid Securakey ID Found!");
+               return CheckChipType(cmdp);
+       }
+
        ans=CmdVikingDemod("");
        if (ans>0) {
                PrintAndLog("\nValid Viking ID Found!");
                return CheckChipType(cmdp);
        }
 
        ans=CmdVikingDemod("");
        if (ans>0) {
                PrintAndLog("\nValid Viking ID Found!");
                return CheckChipType(cmdp);
        }
 
-       ans=CmdIndalaDecode("");
+       ans=CmdIndalaDecode(""); //psk
        if (ans>0) {
                PrintAndLog("\nValid Indala ID Found!");
                return CheckChipType(cmdp);
        if (ans>0) {
                PrintAndLog("\nValid Indala ID Found!");
                return CheckChipType(cmdp);
@@ -1022,14 +1040,14 @@ int CmdLFfind(const char *Cmd)
        }
 
        PrintAndLog("\nNo Known Tags Found!\n");
        }
 
        PrintAndLog("\nNo Known Tags Found!\n");
-       if (testRaw=='u' || testRaw=='U'){
+       if (testRaw=='u' || testRaw=='U') {
                ans=CheckChipType(cmdp);
                //test unknown tag formats (raw mode)0
                PrintAndLog("\nChecking for Unknown tags:\n");
                ans=AutoCorrelate(4000, false, false);
                if (ans > 0) PrintAndLog("Possible Auto Correlation of %d repeating samples",ans);
                ans=GetFskClock("",false,false); 
                ans=CheckChipType(cmdp);
                //test unknown tag formats (raw mode)0
                PrintAndLog("\nChecking for Unknown tags:\n");
                ans=AutoCorrelate(4000, false, false);
                if (ans > 0) PrintAndLog("Possible Auto Correlation of %d repeating samples",ans);
                ans=GetFskClock("",false,false); 
-               if (ans != 0){ //fsk
+               if (ans != 0) { //fsk
                        ans=FSKrawDemod("",true);
                        if (ans>0) {
                                PrintAndLog("\nUnknown FSK Modulated Tag Found!");
                        ans=FSKrawDemod("",true);
                        if (ans>0) {
                                PrintAndLog("\nUnknown FSK Modulated Tag Found!");
@@ -1074,6 +1092,7 @@ static command_t CommandTable[] =
        {"presco",      CmdLFPresco,        1, "{ Presco RFIDs...            }"},
        {"pcf7931",     CmdLFPCF7931,       1, "{ PCF7931 CHIPs...           }"},
        {"pyramid",     CmdLFPyramid,       1, "{ Farpointe/Pyramid RFIDs... }"},
        {"presco",      CmdLFPresco,        1, "{ Presco RFIDs...            }"},
        {"pcf7931",     CmdLFPCF7931,       1, "{ PCF7931 CHIPs...           }"},
        {"pyramid",     CmdLFPyramid,       1, "{ Farpointe/Pyramid RFIDs... }"},
+       {"securakey",   CmdLFSecurakey,     1, "{ Securakey RFIDs...         }"},
        {"t55xx",       CmdLFT55XX,         1, "{ T55xx CHIPs...             }"},
        {"ti",          CmdLFTI,            1, "{ TI CHIPs...                }"},
        {"viking",      CmdLFViking,        1, "{ Viking RFIDs...            }"},
        {"t55xx",       CmdLFT55XX,         1, "{ T55xx CHIPs...             }"},
        {"ti",          CmdLFTI,            1, "{ TI CHIPs...                }"},
        {"viking",      CmdLFViking,        1, "{ Viking RFIDs...            }"},
Impressum, Datenschutz