mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-01 21:22:19 +08:00
chg: 'hf felica litedump' - now turns off device when aborted via keyboard, or buttonpress
This commit is contained in:
parent
9a8331b882
commit
647d275d18
2 changed files with 11 additions and 4 deletions
|
@ -587,8 +587,8 @@ void HfDumpFelicaLiteS() {
|
||||||
StartCountSspClk();
|
StartCountSspClk();
|
||||||
|
|
||||||
int c;
|
int c;
|
||||||
int cnt = 0;
|
bool isOK = false;
|
||||||
int cntfails = 0;
|
uint16_t cnt = 0, cntfails = 0;
|
||||||
uint8_t *dest = (uint8_t *)BigBuf_get_addr();
|
uint8_t *dest = (uint8_t *)BigBuf_get_addr();
|
||||||
|
|
||||||
while (!BUTTON_PRESS() && !usb_poll_validate_length()) {
|
while (!BUTTON_PRESS() && !usb_poll_validate_length()) {
|
||||||
|
@ -628,6 +628,7 @@ void HfDumpFelicaLiteS() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
isOK = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -639,5 +640,5 @@ void HfDumpFelicaLiteS() {
|
||||||
|
|
||||||
//setting tracelen - important! it was set by buffer overflow before
|
//setting tracelen - important! it was set by buffer overflow before
|
||||||
set_tracelen(cnt);
|
set_tracelen(cnt);
|
||||||
cmd_send(CMD_ACK, 1, cnt, 0, 0, 0);
|
cmd_send(CMD_ACK, isOK, cnt, 0, 0, 0);
|
||||||
}
|
}
|
|
@ -331,7 +331,7 @@ int CmdHFFelicaDumpLite(const char *Cmd) {
|
||||||
if ( ctmp == 'h' || ctmp == 'H') return usage_hf_felica_dumplite();
|
if ( ctmp == 'h' || ctmp == 'H') return usage_hf_felica_dumplite();
|
||||||
|
|
||||||
PrintAndLog("[+] FeliCa lite - dump started");
|
PrintAndLog("[+] FeliCa lite - dump started");
|
||||||
|
PrintAndLog("[+] press pm3-button to cancel");
|
||||||
UsbCommand c = {CMD_FELICA_LITE_DUMP, {0,0,0}};
|
UsbCommand c = {CMD_FELICA_LITE_DUMP, {0,0,0}};
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
SendCommand(&c);
|
SendCommand(&c);
|
||||||
|
@ -344,13 +344,19 @@ int CmdHFFelicaDumpLite(const char *Cmd) {
|
||||||
if (ukbhit()) {
|
if (ukbhit()) {
|
||||||
int gc = getchar(); (void)gc;
|
int gc = getchar(); (void)gc;
|
||||||
printf("\n[!] aborted via keyboard!\n");
|
printf("\n[!] aborted via keyboard!\n");
|
||||||
|
DropField();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (timeout > 100) {
|
if (timeout > 100) {
|
||||||
PrintAndLog("[!] timeout while waiting for reply.");
|
PrintAndLog("[!] timeout while waiting for reply.");
|
||||||
|
DropField();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (resp.arg[0] == 0) {
|
||||||
|
PrintAndLog("\n[!] Button pressed. Aborted.");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
uint64_t tracelen = resp.arg[1];
|
uint64_t tracelen = resp.arg[1];
|
||||||
uint8_t *trace = malloc(tracelen);
|
uint8_t *trace = malloc(tracelen);
|
||||||
|
|
Loading…
Reference in a new issue