mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
[14a sniff] Stop sniff with Enter key
This commit is contained in:
@@ -852,11 +852,20 @@ void RAMFUNC SniffIso14443a(uint8_t param) {
|
||||
|
||||
uint32_t rx_samples = 0;
|
||||
|
||||
uint16_t checker = 12000;
|
||||
|
||||
// loop and listen
|
||||
while (BUTTON_PRESS() == false) {
|
||||
WDT_HIT();
|
||||
LED_A_ON();
|
||||
|
||||
if (checker-- == 0) {
|
||||
if (data_available()) {
|
||||
break;
|
||||
}
|
||||
checker = 12000;
|
||||
}
|
||||
|
||||
register int readBufDataP = data - dma->buf;
|
||||
register int dmaBufDataP = DMA_BUFFER_SIZE - AT91C_BASE_PDC_SSC->PDC_RCR;
|
||||
if (readBufDataP <= dmaBufDataP) {
|
||||
|
||||
+20
-3
@@ -1105,14 +1105,31 @@ int CmdHF14ASniff(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_HF_ISO14443A_SNIFF, (uint8_t *)¶m, sizeof(uint8_t));
|
||||
|
||||
PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " to abort sniffing");
|
||||
|
||||
if (interactive) {
|
||||
PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or " _GREEN_("<Enter>") " to abort sniffing");
|
||||
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_HF_ISO14443A_SNIFF, &resp);
|
||||
|
||||
bool keypress = kbd_enter_pressed();
|
||||
while (keypress == false) {
|
||||
keypress = kbd_enter_pressed();
|
||||
|
||||
if (WaitForResponseTimeout(CMD_HF_ISO14443A_SNIFF, &resp, 500)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (keypress) {
|
||||
// inform device to break the sim loop since client has exited
|
||||
SendCommandNG(CMD_BREAK_LOOP, NULL, 0);
|
||||
WaitForResponse(CMD_HF_ISO14443A_SNIFF, &resp);
|
||||
}
|
||||
|
||||
PrintAndLogEx(INFO, "Done!");
|
||||
PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("hf 14a list")"` to view captured tracelog");
|
||||
PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("trace save -h") "` to save tracelog for later analysing");
|
||||
} else {
|
||||
PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " to abort sniffing");
|
||||
}
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user