+int CmdAWIDBrute(const char *Cmd){
+
+ uint8_t fc = 0x00;
+ uint8_t bits[96];
+ uint8_t *bs = bits;
+ size_t size = sizeof(bits);
+ memset(bs, 0x00, size);
+
+ char cmdp = param_getchar(Cmd, 0);
+ if (strlen(Cmd) > 3 || strlen(Cmd) == 0 || cmdp == 'h' || cmdp == 'H') return usage_lf_awid_brute();
+
+ fc = param_get8(Cmd, 0);
+ if ( fc == 0) return usage_lf_awid_brute();
+
+ PrintAndLog("Bruteforceing AWID26 Reader");
+ PrintAndLog("Press pm3-button to abort simulation or run another command");
+
+ uint64_t arg1 = (10<<8) + 8; // fcHigh = 10, fcLow = 8
+ uint64_t arg2 = 50; // clk RF/50 invert=0
+ UsbCommand c = {CMD_FSK_SIM_TAG, {arg1, arg2, size}};
+
+ for ( uint16_t cn = 1; cn < 0xFFFF; ++cn){
+ if (ukbhit()) {
+ PrintAndLog("aborted via keyboard!");
+ c.cmd = CMD_PING;
+ c.arg[0] = 0x00;
+ c.arg[1] = 0x00;
+ c.arg[2] = 0x00;
+ clearCommandBuffer();
+ SendCommand(&c);
+ return 1;
+ }
+
+ (void)getAWIDBits(fc, cn, bs);
+ memcpy(c.d.asBytes, bs, size);
+ clearCommandBuffer();
+ SendCommand(&c);
+
+ PrintAndLog("Trying FC: %u; CN: %u", fc, cn);
+ // pause
+ sleep(1);
+ }
+ return 0;
+}
+