added reset state

This commit is contained in:
iceman1001 2020-10-30 02:12:36 +01:00
commit c1ed65bc4c

View file

@ -5282,13 +5282,12 @@ static int CmdHf14AMfSuperCard(const char *Cmd) {
void *argtable[] = {
arg_param_begin,
arg_lit0("r", "reset", "reset card"),
arg_param_end
};
CLIExecWithReturn(ctx, Cmd, argtable, true);
bool reset_card = arg_get_lit(ctx, 1);
CLIParserFree(ctx);
/*
uint8_t reset[] = { 0x02, 0x00, 0xa6, 0xc0, 0x00 };
*/
bool activate_field = true;
bool keep_field_on = true;
@ -5379,6 +5378,22 @@ static int CmdHf14AMfSuperCard(const char *Cmd) {
else
PrintAndLogEx(FAILED, "failed to recover any key");
if (reset_card) {
activate_field = true;
uint8_t response[6];
int resplen = 0;
// --------------- RESET CARD ----------------
uint8_t aRESET[] = { 0x00, 0xa6, 0xc0, 0x00 };
res = ExchangeAPDU14a(aRESET, sizeof(aRESET), activate_field, keep_field_on, response, sizeof(response), &resplen);
if (res) {
DropField();
return res;
}
}
return PM3_SUCCESS;
}