- if(flags & FLAG_INTERACTIVE) {\r
- PrintAndLog("Press pm3-button to abort simulation");\r
- while(! WaitForResponseTimeout(CMD_ACK,&resp,1500)) {\r
- //We're waiting only 1.5 s at a time, otherwise we get the\r
- // annoying message about "Waiting for a response... "\r
- }\r
- //got a response\r
- if (flags & FLAG_NR_AR_ATTACK) {\r
- nonces_t ar_resp[ATTACK_KEY_COUNT*2];\r
- memcpy(ar_resp, resp.d.asBytes, sizeof(ar_resp));\r
- readerAttack(ar_resp, setEmulatorMem);\r
- }\r
+ while(! WaitForResponseTimeout(CMD_ACK,&resp,1500)) {\r
+ //We're waiting only 1.5 s at a time, otherwise we get the\r
+ // annoying message about "Waiting for a response... "\r
+ }\r
+ //got a response\r
+ nonces_t ar_resp[ATTACK_KEY_COUNT*2];\r
+ memcpy(ar_resp, resp.d.asBytes, sizeof(ar_resp));\r
+ // We can skip the standard attack if we have RANDOM_NONCE set.\r
+ readerAttack(ar_resp, setEmulatorMem, !(flags & FLAG_RANDOM_NONCE));\r
+ if ((bool)resp.arg[1]) {\r
+ PrintAndLog("Device button pressed - quitting");\r
+ fclose(f);\r
+ return 4;\r