atr fixes and regex test
This commit is contained in:
1 parent
dd391cda01
commit
c93dfb712f
4 files changed
+42
-20
No files matched your search
@@ -23,6 +23,7 @@
|
||||
#include "fileutils.h"
|
||||
#include "crc16.h" // crc
|
||||
#include "cliparser.h" // cliparsing
|
||||
#include "atrs.h" // ATR lookup
|
||||
|
||||
static int CmdHelp(const char *Cmd);
|
||||
|
||||
@@ -691,8 +692,11 @@ static int CmdSmartInfo(const char *Cmd) {
|
||||
// print header
|
||||
PrintAndLogEx(INFO, "--- " _CYAN_("Smartcard Information") " ---------");
|
||||
PrintAndLogEx(INFO, "ISO7618-3 ATR : %s", sprint_hex(card.atr, card.atr_len));
|
||||
|
||||
PrintAndLogEx(INFO, "http://smartcard-atr.apdu.fr/parse?ATR=%s", sprint_hex_inrow(card.atr, card.atr_len));
|
||||
|
||||
//PrintAndLogEx(INFO, "ATR loopup : %s", getAtrInfo("3FFF112503108041B00669FF4A50700000415A010011"));
|
||||
|
||||
// print ATR
|
||||
PrintAndLogEx(INFO, "ATR");
|
||||
PrintATR(card.atr, card.atr_len);
|
||||
@@ -755,6 +759,18 @@ static int CmdSmartReader(const char *Cmd) {
|
||||
}
|
||||
smart_card_atr_t *card = (smart_card_atr_t *)resp.data.asBytes;
|
||||
PrintAndLogEx(INFO, "ISO7816-3 ATR : %s", sprint_hex(card->atr, card->atr_len));
|
||||
|
||||
// test with normal lookup, with existing ATR in table
|
||||
PrintAndLogEx(INFO, "ATR loopup : %s", getAtrInfo("3FFF112503108041B00669FF4A50700000415A010011")); // Astro (Pay TV)
|
||||
|
||||
//PrintAndLogEx(INFO, "ATR loopup : %s", getAtrInfo("3FFD13250250800F..B0..69FF4A50D08000495403"));
|
||||
|
||||
// test with random bytes in .. space
|
||||
PrintAndLogEx(INFO, "ATR loopup : %s", getAtrInfo("3FFD13250250800FEEB00269FF4A50D08000495403")); // Sky (Italy) VideoGuard CAM card
|
||||
|
||||
// test w shorted str, not in ATR table
|
||||
PrintAndLogEx(INFO, "ATR loopup : %s", getAtrInfo("3FFD13250250800FEEB00269FF4A50D080004954")); // Sky (Italy) VideoGuard CAM card
|
||||
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user