hf 14b reader - now supports continuous mode

This commit is contained in:
iceman1001 2021-04-15 22:06:17 +02:00
commit 9c35896162
2 changed files with 32 additions and 20 deletions

View file

@ -1047,13 +1047,20 @@ static int CmdHF14BReader(const char *Cmd) {
void *argtable[] = { void *argtable[] = {
arg_param_begin, arg_param_begin,
arg_lit0("v", "verbose", "verbose"), arg_lit0("s", "silent", "silent (no messages)"),
arg_lit0("@", NULL, "optional - continuous reader mode"),
arg_param_end arg_param_end
}; };
CLIExecWithReturn(ctx, Cmd, argtable, true); CLIExecWithReturn(ctx, Cmd, argtable, true);
bool verbose = arg_get_lit(ctx, 1); bool verbose = (arg_get_lit(ctx, 1) == false);
bool cm = arg_get_lit(ctx, 2);
CLIParserFree(ctx); CLIParserFree(ctx);
return readHF14B(verbose);
if (cm) {
PrintAndLogEx(INFO, "Press " _GREEN_("<Enter>") " to exit");
}
return readHF14B(cm, verbose);
} }
// Read SRI512|SRIX4K block // Read SRI512|SRIX4K block
@ -1965,25 +1972,30 @@ int infoHF14B(bool verbose, bool do_aid_search) {
} }
// get and print general info about all known 14b chips // get and print general info about all known 14b chips
int readHF14B(bool verbose) { int readHF14B(bool loop, bool verbose) {
// try std 14b (atqb) do {
if (HF14B_std_reader(verbose)) // try std 14b (atqb)
return 1; if (HF14B_std_reader(verbose))
return PM3_SUCCESS;
// try ST Microelectronics 14b // try ST Microelectronics 14b
if (HF14B_st_reader(verbose)) if (HF14B_st_reader(verbose))
return 1; return PM3_SUCCESS;
// try ASK CT 14b // try ASK CT 14b
if (HF14B_ask_ct_reader(verbose)) if (HF14B_ask_ct_reader(verbose))
return 1; return PM3_SUCCESS;
// try unknown 14b read commands (to be identified later) // try unknown 14b read commands (to be identified later)
// could be read of calypso, CEPAS, moneo, or pico pass. // could be read of calypso, CEPAS, moneo, or pico pass.
if (HF14B_other_reader(verbose)) if (HF14B_other_reader(verbose))
return 1; return PM3_SUCCESS;
if (verbose) PrintAndLogEx(FAILED, "no 14443-B tag found"); } while (loop && kbd_enter_pressed() == false);
return 0;
if (verbose) {
PrintAndLogEx(FAILED, "no ISO 14443-B tag found");
}
return PM3_EOPABORTED;
} }

View file

@ -18,5 +18,5 @@ int CmdHF14B(const char *Cmd);
int exchange_14b_apdu(uint8_t *datain, int datainlen, bool activate_field, bool leave_signal_on, uint8_t *dataout, int maxdataoutlen, int *dataoutlen, int user_timeout); int exchange_14b_apdu(uint8_t *datain, int datainlen, bool activate_field, bool leave_signal_on, uint8_t *dataout, int maxdataoutlen, int *dataoutlen, int user_timeout);
int infoHF14B(bool verbose, bool do_aid_search); int infoHF14B(bool verbose, bool do_aid_search);
int readHF14B(bool verbose); int readHF14B(bool loop, bool verbose);
#endif #endif