#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");
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){
return 0;
}
+/*
int CmdLegicRfRawWrite(const char *Cmd) {
PrintAndLog("############# DANGER !! #############");
PrintAndLog("# changing the DCF is irreversible #");
// }
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;
//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;
{"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}
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);
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);