mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
added contact to emv scan
This commit is contained in:
parent
8e199d4c9e
commit
fe66f0fac4
1 changed files with 28 additions and 21 deletions
|
@ -1382,12 +1382,6 @@ int CmdEMVScan(const char *cmd) {
|
||||||
|
|
||||||
SetAPDULogging(showAPDU);
|
SetAPDULogging(showAPDU);
|
||||||
|
|
||||||
// TODO
|
|
||||||
if (channel == ECC_CONTACT) {
|
|
||||||
PrintAndLogEx(ERR, "Do not use contact interface. Exit.");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// current path + file name
|
// current path + file name
|
||||||
if (!strstr(crelfname, ".json"))
|
if (!strstr(crelfname, ".json"))
|
||||||
strcat(crelfname, ".json");
|
strcat(crelfname, ".json");
|
||||||
|
@ -1411,8 +1405,12 @@ int CmdEMVScan(const char *cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// drop field at start
|
// drop field at start
|
||||||
|
if (channel == ECC_CONTACTLESS)
|
||||||
DropFieldEx( channel );
|
DropFieldEx( channel );
|
||||||
|
|
||||||
|
JsonSaveStr(root, "$.File.Created", "proxmark3 `emv scan`");
|
||||||
|
|
||||||
|
if (channel == ECC_CONTACTLESS) {
|
||||||
// iso 14443 select
|
// iso 14443 select
|
||||||
PrintAndLogEx(NORMAL, "--> GET UID, ATS.");
|
PrintAndLogEx(NORMAL, "--> GET UID, ATS.");
|
||||||
|
|
||||||
|
@ -1421,13 +1419,21 @@ int CmdEMVScan(const char *cmd) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
JsonSaveStr(root, "$.File.Created", "proxmark3 `emv scan`");
|
|
||||||
|
|
||||||
JsonSaveStr(root, "$.Card.Communication", "iso14443-4a");
|
JsonSaveStr(root, "$.Card.Contactless.Communication", "iso14443-4a");
|
||||||
JsonSaveBufAsHex(root, "$.Card.UID", (uint8_t *)&card.uid, card.uidlen);
|
JsonSaveBufAsHex(root, "$.Card.Contactless.UID", (uint8_t *)&card.uid, card.uidlen);
|
||||||
JsonSaveHex(root, "$.Card.ATQA", card.atqa[0] + (card.atqa[1] << 2), 2);
|
JsonSaveHex(root, "$.Card.Contactless.ATQA", card.atqa[0] + (card.atqa[1] << 2), 2);
|
||||||
JsonSaveHex(root, "$.Card.SAK", card.sak, 0);
|
JsonSaveHex(root, "$.Card.Contactless.SAK", card.sak, 0);
|
||||||
JsonSaveBufAsHex(root, "$.Card.ATS", (uint8_t *)card.ats, card.ats_len);
|
JsonSaveBufAsHex(root, "$.Card.Contactless.ATS", (uint8_t *)card.ats, card.ats_len);
|
||||||
|
} else {
|
||||||
|
PrintAndLogEx(NORMAL, "--> GET ATR.");
|
||||||
|
|
||||||
|
smart_card_atr_t card;
|
||||||
|
smart_select(true, &card);
|
||||||
|
|
||||||
|
JsonSaveStr(root, "$.Card.Contact.Communication", "iso7816");
|
||||||
|
JsonSaveBufAsHex(root, "$.Card.Contact.ATR", (uint8_t *)card.atr, card.atr_len);
|
||||||
|
}
|
||||||
|
|
||||||
// init applets list tree
|
// init applets list tree
|
||||||
const char *al = "Applets list";
|
const char *al = "Applets list";
|
||||||
|
@ -1642,6 +1648,7 @@ int CmdEMVScan(const char *cmd) {
|
||||||
// free tlv object
|
// free tlv object
|
||||||
tlvdb_free(tlvRoot);
|
tlvdb_free(tlvRoot);
|
||||||
|
|
||||||
|
if (channel == ECC_CONTACTLESS)
|
||||||
DropFieldEx( channel );
|
DropFieldEx( channel );
|
||||||
|
|
||||||
res = json_dump_file(root, fname, JSON_INDENT(2));
|
res = json_dump_file(root, fname, JSON_INDENT(2));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue