check cipurse via hf search

This commit is contained in:
merlokk committed 2021-06-15 14:02:50 +03:00
1 parent f267df2fb7
commit ae6580f65b
3 files changed
+20

No files matched your search

+9
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;
+9
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."},
+2
View File
@@ -20,4 +20,6 @@
int CmdHFCipurse(const char *Cmd);
bool CheckCardCipurse(void);
#endif