+ PrintAndLog("Samples:");
+ PrintAndLog(" hf legic sim");
+ PrintAndLog(" hf legic sim ");
+ return 0;
+}
+int usage_legic_write(void){
+ PrintAndLog("Write data to a LEGIC Prime tag. It autodetects tagsize to make sure size");
+ PrintAndLog("Usage: hf legic write [h] o <offset> d <data (hex symbols)>");
+ PrintAndLog("Options:");
+ PrintAndLog(" h : this help");
+ PrintAndLog(" o <offset> : (hex) offset in data array to start writing");
+ //PrintAndLog(" <IV> : (optional) Initialization vector to use (ODD and 7bits)");
+ PrintAndLog(" d <data> : (hex symbols) bytes to write ");
+ PrintAndLog("");
+ PrintAndLog("Samples:");
+ PrintAndLog(" hf legic write o 10 d 11223344 - Write 0x11223344 starting from offset 0x10");
+ return 0;
+}
+int usage_legic_reader(void){
+ PrintAndLog("Read UID and type information from a legic tag.");
+ PrintAndLog("Usage: hf legic reader [h]");
+ PrintAndLog("Options:");
+ PrintAndLog(" h : this help");
+ PrintAndLog("");
+ PrintAndLog("Samples:");
+ PrintAndLog(" hf legic reader");
+ return 0;
+}
+int usage_legic_info(void){
+ PrintAndLog("Reads information from a legic prime tag.");
+ PrintAndLog("Shows systemarea, user areas etc");
+ PrintAndLog("Usage: hf legic info [h]");
+ PrintAndLog("Options:");
+ PrintAndLog(" h : this help");
+ PrintAndLog("");
+ PrintAndLog("Samples:");
+ PrintAndLog(" hf legic info");
+ return 0;
+}
+int usage_legic_dump(void){
+ PrintAndLog("Reads all pages from LEGIC Prime MIM22, MIM256, MIM1024");
+ PrintAndLog("and saves binary dump into the file `filename.bin` or `cardUID.bin`");
+ PrintAndLog("It autodetects card type.\n");
+ PrintAndLog("Usage: hf legic dump [h] o <filename w/o .bin>");
+ PrintAndLog("Options:");
+ PrintAndLog(" h : this help");
+ PrintAndLog(" o <filename> : filename w/o '.bin' to dump bytes");
+ PrintAndLog("");
+ PrintAndLog("Samples:");
+ PrintAndLog(" hf legic dump");
+ PrintAndLog(" hf legic dump o myfile");
+ return 0;
+}
+int usage_legic_restore(void){
+ PrintAndLog("Reads binary file and it autodetects card type and verifies that the file has the same size");
+ PrintAndLog("Then write the data back to card. All bytes except the first 7bytes [UID(4) MCC(1) DCF(2)]\n");
+ PrintAndLog("Usage: hf legic restore [h] i <filename w/o .bin>");
+ PrintAndLog("Options:");
+ PrintAndLog(" h : this help");
+ PrintAndLog(" i <filename> : filename w/o '.bin' to restore bytes on to card from");
+ PrintAndLog("");
+ PrintAndLog("Samples:");
+ PrintAndLog(" hf legic restore i myfile");
+ return 0;
+}
+int usage_legic_eload(void){
+ PrintAndLog("It loads binary dump from the file `filename.bin`");
+ PrintAndLog("Usage: hf legic eload [h] [card memory] <file name w/o `.bin`>");
+ PrintAndLog("Options:");
+ PrintAndLog(" h : this help");
+ PrintAndLog(" [card memory] : 0 = MIM22");
+ PrintAndLog(" : 1 = MIM256 (default)");
+ PrintAndLog(" : 2 = MIM1024");
+ PrintAndLog(" <filename> : filename w/o .bin to load");
+ PrintAndLog("");
+ PrintAndLog("Samples:");
+ PrintAndLog(" hf legic eload 2 myfile");
+ return 0;
+}
+int usage_legic_esave(void){
+ PrintAndLog("It saves binary dump into the file `filename.bin` or `cardID.bin`");
+ PrintAndLog(" Usage: hf legic esave [h] [card memory] [file name w/o `.bin`]");
+ PrintAndLog("Options:");
+ PrintAndLog(" h : this help");
+ PrintAndLog(" [card memory] : 0 = MIM22");
+ PrintAndLog(" : 1 = MIM256 (default)");
+ PrintAndLog(" : 2 = MIM1024");
+ PrintAndLog(" <filename> : filename w/o .bin to load");
+ PrintAndLog("");
+ PrintAndLog("Samples:");
+ PrintAndLog(" hf legic esave 2 myfile");
+ return 0;
+}
+int usage_legic_wipe(void){
+ PrintAndLog("Fills a legic tag memory with zeros. From byte7 and to the end.");
+ PrintAndLog(" Usage: hf legic wipe [h]");
+ PrintAndLog("Options:");
+ PrintAndLog(" h : this help");
+ PrintAndLog("");
+ PrintAndLog("Samples:");
+ PrintAndLog(" hf legic wipe");