From 4f85def6b07ad9cefe78d9bd11b18f14fad5dcb7 Mon Sep 17 00:00:00 2001 From: Antiklesys Date: Sun, 20 Oct 2024 12:33:25 +0800 Subject: [PATCH] Check for silicon version in iclass info Updated hf iclass info to check whether the card's chipset is old silicon (supporting 14b) or new silicon (without the 14b support) --- CHANGELOG.md | 1 + client/src/cmdhf14b.c | 11 +++++++---- client/src/cmdhf14b.h | 2 ++ client/src/cmdhficlass.c | 6 ++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 333154a4d..b0795fc0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- Changed `hf iclass info` - now checks for cards silicon version (@antiklesys) - Changed `hf iclass legrec` - updated script implementation to ensure functionality (@antiklesys) - Added recovered iclass custom key to dictionary (@antiklesys) - Changed `hf mf sim` - add option to allow key b to be used even if readable (@doegox) diff --git a/client/src/cmdhf14b.c b/client/src/cmdhf14b.c index 43eeff9fc..3b2cce3bc 100644 --- a/client/src/cmdhf14b.c +++ b/client/src/cmdhf14b.c @@ -1411,7 +1411,7 @@ static bool HF14B_ask_ct_reader(bool verbose) { return false; } -static bool HF14B_picopass_reader(bool verbose) { +bool HF14B_picopass_reader(bool verbose, bool info) { iso14b_raw_cmd_t packet = { .flags = (ISO14B_CONNECT | ISO14B_SELECT_PICOPASS | ISO14B_DISCONNECT), @@ -1437,8 +1437,10 @@ static bool HF14B_picopass_reader(bool verbose) { return false; } memcpy(card, resp.data.asBytes, sizeof(picopass_hdr_t)); - PrintAndLogEx(NORMAL, ""); - PrintAndLogEx(SUCCESS, "iCLASS / Picopass CSN: " _GREEN_("%s"), sprint_hex(card->csn, sizeof(card->csn))); + if(info){ + PrintAndLogEx(NORMAL, ""); + PrintAndLogEx(SUCCESS, "iCLASS / Picopass CSN: " _GREEN_("%s"), sprint_hex(card->csn, sizeof(card->csn))); + } free(card); return true; } @@ -3034,6 +3036,7 @@ int infoHF14B(bool verbose, bool do_aid_search) { // get and print general info about all known 14b chips int readHF14B(bool loop, bool verbose, bool read_plot) { bool found = false; + bool info = true; int res = PM3_SUCCESS; do { found = false; @@ -3049,7 +3052,7 @@ int readHF14B(bool loop, bool verbose, bool read_plot) { goto plot; // Picopass - found |= HF14B_picopass_reader(verbose); + found |= HF14B_picopass_reader(verbose, info); if (found) goto plot; diff --git a/client/src/cmdhf14b.h b/client/src/cmdhf14b.h index 009395ba2..067718507 100644 --- a/client/src/cmdhf14b.h +++ b/client/src/cmdhf14b.h @@ -31,4 +31,6 @@ int select_card_14443b_4(bool disconnect, iso14b_card_select_t *card); int infoHF14B(bool verbose, bool do_aid_search); int readHF14B(bool loop, bool verbose, bool read_plot); +bool HF14B_picopass_reader(bool verbose, bool info); + #endif diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index f891b728c..cc78ce414 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -40,6 +40,7 @@ #include "crypto/asn1utils.h" // ASN1 decoder #include "preferences.h" #include "generator.h" +#include "cmdhf14b.h" #define NUM_CSNS 9 @@ -5379,6 +5380,11 @@ int info_iclass(bool shallow_mod) { uint8_t cardtype = get_mem_config(hdr); PrintAndLogEx(SUCCESS, " Card type.... " _GREEN_("%s"), card_types[cardtype]); + if(HF14B_picopass_reader(false, false)){ + PrintAndLogEx(SUCCESS, " Card chip.... "_YELLOW_("Old Silicon (14b support)")); + }else{ + PrintAndLogEx(SUCCESS, " Card chip.... "_YELLOW_("NEW Silicon (No 14b support)")); + } if (legacy) { int res = PM3_ESOFT;