diff --git a/client/cmdhflegic.c b/client/cmdhflegic.c index 0ddc7466c..3cc6c4064 100644 --- a/client/cmdhflegic.c +++ b/client/cmdhflegic.c @@ -636,14 +636,13 @@ int CmdLegicRfWrite(const char *Cmd) { PrintAndLog("############# DANGER ################"); PrintAndLog("# changing the DCF is irreversible #"); PrintAndLog("#####################################"); - PrintAndLog("do you really want to continue? y(es) n(o)"); - char answer; - sscanf(" %c", &answer); - bool exit = !(answer == 'n' || answer == 'N'); - if (exit) + char *answer = NULL; + answer = readline("do you really want to continue? y(es) n(o) : "); + bool overwrite = (answer[0] == 'y' || answer[0] == 'Y'); + if (!overwrite){ + PrintAndLog("command cancelled"); return 0; - printf("ICE DCF: %c answer, %d\n", answer, exit); - return 0; + } } legic_chk_iv(&IV); diff --git a/client/cmdhflegic.h b/client/cmdhflegic.h index 62aee740b..db38b723d 100644 --- a/client/cmdhflegic.h +++ b/client/cmdhflegic.h @@ -38,6 +38,7 @@ int CmdLegicReader(const char *Cmd); int CmdLegicELoad(const char *Cmd); int CmdLegicESave(const char *Cmd); int CmdLegicList(const char *Cmd); +int CmdLegicWipe(const char *Cmd); int HFLegicReader(const char *Cmd, bool verbose); int legic_print_type(uint32_t tagtype, uint8_t spaces);