- FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
- LEDsoff();
-
- // Interactive mode flag, means we need to send ACK
- if(flags & FLAG_INTERACTIVE) {
- //May just aswell send the collected ar_nr in the response aswell
- uint8_t len = ar_nr_collected*5*4;
- cmd_send(CMD_ACK, CMD_SIMULATE_MIFARE_CARD, len, 0, &ar_nr_responses, len);
- }
-
- if(flags & FLAG_NR_AR_ATTACK && MF_DBGLEVEL >= 1 ) {
- if(ar_nr_collected > 1 ) {
- Dbprintf("Collected two pairs of AR/NR which can be used to extract keys from reader:");
- Dbprintf("../tools/mfkey/mfkey32 %06x%08x %08x %08x %08x %08x %08x",
- ar_nr_responses[0], // UID1
- ar_nr_responses[1], // UID2
- ar_nr_responses[2], // NT
- ar_nr_responses[3], // AR1
- ar_nr_responses[4], // NR1
- ar_nr_responses[8], // AR2
- ar_nr_responses[9] // NR2
- );
- Dbprintf("../tools/mfkey/mfkey32v2 %06x%08x %08x %08x %08x %08x %08x %08x",
- ar_nr_responses[0], // UID1
- ar_nr_responses[1], // UID2
- ar_nr_responses[2], // NT1
- ar_nr_responses[3], // AR1
- ar_nr_responses[4], // NR1
- ar_nr_responses[7], // NT2
- ar_nr_responses[8], // AR2
- ar_nr_responses[9] // NR2
- );
- } else {
- Dbprintf("Failed to obtain two AR/NR pairs!");
- if(ar_nr_collected > 0 ) {
- Dbprintf("Only got these: UID=%06x%08x, nonce=%08x, AR1=%08x, NR1=%08x",
- ar_nr_responses[0], // UID1
- ar_nr_responses[1], // UID2
- ar_nr_responses[2], // NT
- ar_nr_responses[3], // AR1
- ar_nr_responses[4] // NR1
- );
- }
- }
- }
- if (MF_DBGLEVEL >= 1) Dbprintf("Emulator stopped. Tracing: %d trace length: %d ", tracing, BigBuf_get_traceLen());