+int usage_lf_hid_sim(void){
+ PrintAndLog("HID Tag simulator");
+ PrintAndLog("");
+ PrintAndLog("Usage: lf hid sim [h] [ID]");
+ PrintAndLog("Options:");
+ PrintAndLog(" h - This help");
+ PrintAndLog(" ID - HID id");
+ PrintAndLog("Examples:");
+ PrintAndLog(" lf hid sim 224");
+ return 0;
+}
+int usage_lf_hid_clone(void){
+ PrintAndLog("Clone HID to T55x7. Tag must be on antenna. ");
+ PrintAndLog("");
+ PrintAndLog("Usage: lf hid clone [h] [ID] <L>");
+ PrintAndLog("Options:");
+ PrintAndLog(" h - This help");
+ PrintAndLog(" ID - HID id");
+ PrintAndLog(" L - 84bit ID");
+ PrintAndLog("Examples:");
+ PrintAndLog(" lf hid clone 224");
+ PrintAndLog(" lf hid clone 224 L");
+ return 0;
+}
+int usage_lf_hid_brute(void){
+ PrintAndLog("Enables bruteforce of HID readers with specified facility code.");
+ PrintAndLog("This is a attack against reader. if cardnumber is given, it starts with it and goes up / down one step");
+ PrintAndLog("if cardnumber is not given, it starts with 1 and goes up to 65535");
+ PrintAndLog("");
+ PrintAndLog("Usage: lf hid brute [h] a <format> f <facility-code> c <cardnumber> d <delay>");
+ PrintAndLog("Options :");
+ PrintAndLog(" h : This help");
+ PrintAndLog(" a <format> : 26|33|34|35|37|40|44|84");
+ PrintAndLog(" f <facility-code> : 8-bit value HID facility code");
+ PrintAndLog(" c <cardnumber> : (optional) cardnumber to start with, max 65535");
+ PrintAndLog(" d <delay> : delay betweens attempts in ms. Default 1000ms");
+ PrintAndLog("");
+ PrintAndLog("Samples:");
+ PrintAndLog(" lf hid brute a 26 f 224");
+ PrintAndLog(" lf hid brute a 26 f 21 d 2000");
+ PrintAndLog(" lf hid brute a 26 f 21 c 200 d 2000");
+ return 0;
+}
+
+static int sendPing(void){
+ UsbCommand ping = {CMD_PING, {1, 2, 3}};
+ SendCommand(&ping);
+ SendCommand(&ping);
+ SendCommand(&ping);
+ clearCommandBuffer();
+ UsbCommand resp;
+ if (WaitForResponseTimeout(CMD_ACK, &resp, 1000))
+ return 0;
+ return 1;
+}
+static bool sendTry(uint8_t fmtlen, uint32_t fc, uint32_t cn, uint32_t delay, uint8_t *bs){
+
+ PrintAndLog("Trying FC: %u; CN: %u", fc, cn);
+
+ calcWiegand( fmtlen, fc, cn, bs);