]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Renamed the calccrc8 functions and command.
authoriceman1001 <iceman@iuse.se>
Thu, 6 Oct 2016 22:14:02 +0000 (00:14 +0200)
committericeman1001 <iceman@iuse.se>
Thu, 6 Oct 2016 22:14:02 +0000 (00:14 +0200)
client/cmdhflegic.c
client/cmdhflegic.h

index c2db86820aaf3a5e71941cb4f2096f7041aac634..3ee6c5d5d401a401fc70e83b1daa401e13c48a75 100644 (file)
@@ -13,10 +13,10 @@ static int CmdHelp(const char *Cmd);
 
 #define MAX_LENGTH 1024        
 
-int usage_legic_calccrc8(void){
+int usage_legic_calccrc(void){
        PrintAndLog("Calculates the legic crc8/crc16 on the input hexbytes.");
        PrintAndLog("There must be an even number of hexsymbols as input.");
-       PrintAndLog("Usage:  hf legic crc8 [h] b <hexbytes> u <uidcrc> c <crc type>");
+       PrintAndLog("Usage:  hf legic crc [h] b <hexbytes> u <uidcrc> c <crc type>");
        PrintAndLog("Options:");
        PrintAndLog("      h             : this help");
        PrintAndLog("      b <hexbytes>  : hex bytes");
@@ -24,8 +24,8 @@ int usage_legic_calccrc8(void){
        PrintAndLog("      c <crc type>  : 8|16 bit crc size");
        PrintAndLog("");
        PrintAndLog("Samples:");
-       PrintAndLog("      hf legic crc8 b deadbeef1122");
-       PrintAndLog("      hf legic crc8 b deadbeef1122 u 9A c 16");
+       PrintAndLog("      hf legic crc b deadbeef1122");
+       PrintAndLog("      hf legic crc b deadbeef1122 u 9A c 16");
        return 0;
 }
 int usage_legic_load(void){
@@ -687,6 +687,7 @@ int CmdLegicRfWrite(const char *Cmd) {
     return 0;
 }
 
+/*
 int CmdLegicRfRawWrite(const char *Cmd) {
        PrintAndLog("############# DANGER !! #############");
        PrintAndLog("# changing the DCF is irreversible  #");
@@ -697,11 +698,9 @@ int CmdLegicRfRawWrite(const char *Cmd) {
        // }
        return 0;
 }
+*/
 
-void static calc4(uint8_t *cmd, uint8_t len){
-}      
-int CmdLegicCalcCrc8(const char *Cmd){
+int CmdLegicCalcCrc(const char *Cmd){
 
        uint8_t *data = NULL;
        uint8_t cmdp = 0, uidcrc = 0, type=0;
@@ -771,16 +770,13 @@ int CmdLegicCalcCrc8(const char *Cmd){
        //Validations
        if (errors){
                if (data) free(data);
-               return usage_legic_calccrc8();
+               return usage_legic_calccrc();
        }
        
        switch (type){
                case 16:
                        PrintAndLog("Legic crc16: %X", CRC16Legic(data, len, uidcrc));
                        break;
-               case 4:
-                       calc4(data, 0);
-                       break;
                default:
                        PrintAndLog("Legic crc8: %X",  CRC8Legic(data, len) );
                        break;
@@ -1105,7 +1101,7 @@ static command_t CommandTable[] =  {
        {"load",        CmdLegicLoad,           0, "<filename> -- Restore samples"},
        {"sim",         CmdLegicRfSim,          0, "[phase drift [frame drift [req/resp drift]]] Start tag simulator (use after load or read)"},
        {"write",       CmdLegicRfWrite,        0, "<offset> <length> <iv> -- Write sample buffer (user after load or read)"},
-       {"crc8",        CmdLegicCalcCrc8,       1, "Calculate Legic CRC8 over given hexbytes"}, 
+       {"crc",         CmdLegicCalcCrc,        1, "Calculate Legic CRC over given hexbytes"},  
        {"eload",       CmdLegicELoad,          1, "Load binary dump to emulator memory"},
        {"esave",       CmdLegicESave,          1, "Save emulator memory to binary file"},
        {NULL, NULL, 0, NULL}
index 741766e9e43654dcd4c174c286de45f1d07bafca..e7a4c9cd4e1e999f4c3c3db87e32f44486975fed 100644 (file)
@@ -31,11 +31,9 @@ int CmdLegicLoad(const char *Cmd);
 int CmdLegicSave(const char *Cmd);
 int CmdLegicRfSim(const char *Cmd);
 int CmdLegicRfWrite(const char *Cmd);
-int CmdLegicRfRawWrite(const char *Cmd);
-int CmdLegicCalcCrc8(const char *Cmd);
+int CmdLegicCalcCrc(const char *Cmd);
 int CmdLegicDump(const char *Cmd);
 int CmdLegicReader(const char *Cmd);
-
 int CmdLegicELoad(const char *Cmd);
 int CmdLegicESave(const char *Cmd);
 
@@ -45,7 +43,7 @@ int legic_get_type(legic_card_select_t *card);
 void legic_chk_iv(uint32_t *iv);
 void legic_seteml(uint8_t *src, uint32_t offset, uint32_t numofbytes);
 
-int usage_legic_calccrc8(void);
+int usage_legic_calccrc(void);
 int usage_legic_load(void);
 int usage_legic_rdmem(void);
 int usage_legic_sim(void);
Impressum, Datenschutz