check cipurse via hf search

This commit is contained in:
merlokk 2021-05-28 19:05:00 +03:00
parent f267df2fb7
commit ae6580f65b
3 changed files with 20 additions and 0 deletions

View file

@ -128,6 +128,15 @@ int CmdHFSearch(const char *Cmd) {
res = PM3_SUCCESS;
}
}
PROMPT_CLEARLINE;
PrintAndLogEx(INPLACE, " Searching for Cipurse tag...");
if (IfPm3Iso14443a()) {
if (CheckCardCipurse()) {
PrintAndLogEx(SUCCESS, "\nValid " _GREEN_("Cipurse tag") " found\n");
res = PM3_SUCCESS;
}
}
// 14b is the longest test
PROMPT_CLEARLINE;

View file

@ -84,6 +84,15 @@ static int CmdHFCipurseInfo(const char *Cmd) {
bool CheckCardCipurse(void) {
uint8_t buf[APDU_RES_LEN] = {0};
size_t len = 0;
uint16_t sw = 0;
int res = CIPURSESelect(true, false, buf, sizeof(buf), &len, &sw);
return (res == 0 && sw == 0x9000);
}
static command_t CommandTable[] = {
{"help", CmdHelp, AlwaysAvailable, "This help."},
{"info", CmdHFCipurseInfo, IfPm3Iso14443a, "Info about Cipurse tag."},

View file

@ -20,4 +20,6 @@
int CmdHFCipurse(const char *Cmd);
bool CheckCardCipurse(void);
#endif