CHG: on a slow usb connection it seems the pingcmd which stops the bruteforce on deviceside doesnt get there. Lets send three pings to make sure the device gets it.

This commit is contained in:
iceman1001 2016-08-10 16:23:59 +02:00
commit 56f1aaa234

View file

@ -104,8 +104,9 @@ static bool sendTry(uint8_t fmtlen, uint32_t fc, uint32_t cn, uint32_t delay, ui
static int sendPing(){ static int sendPing(){
UsbCommand resp; UsbCommand resp;
UsbCommand ping = {CMD_PING}; UsbCommand ping = {CMD_PING};
clearCommandBuffer(); clearCommandBuffer(); SendCommand(&ping);
SendCommand(&ping); clearCommandBuffer(); SendCommand(&ping);
clearCommandBuffer(); SendCommand(&ping);
if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) { if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {
PrintAndLog("aborted via keyboard!"); PrintAndLog("aborted via keyboard!");
return 0; return 0;
@ -374,7 +375,7 @@ int CmdAWIDBrute(const char *Cmd){
// Do one down (if cardnumber is given) // Do one down (if cardnumber is given)
if ( cn > 1 ) if ( cn > 1 )
if ( down > 0 ) if ( down > 1 )
if ( !sendTry(fmtlen, fc, --down, delay, bs, size)) return 1; if ( !sendTry(fmtlen, fc, --down, delay, bs, size)) return 1;
} }
return 0; return 0;