Skip to content

Commit

Permalink
Merge pull request RfidResearchGroup#2581 from Antiklesys/master
Browse files Browse the repository at this point in the history
iclass updates
  • Loading branch information
iceman1001 authored Oct 23, 2024
2 parents 6de21ed + 49ac233 commit d2e29b2
Show file tree
Hide file tree
Showing 7 changed files with 229 additions and 147 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ 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)
- Added support for all Hitag S response protocol mode (@douniwan5788)
- Fixed 'hf_young.c' - flags declaration was missing a semicolon (@jakkpotts)
- Changed `hf mf sim` - add option to allow key b to be used even if readable (@doegox)
Expand Down
351 changes: 209 additions & 142 deletions armsrc/iclass.c

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion armsrc/iclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,5 @@ bool authenticate_iclass_tag(iclass_auth_req_t *payload, picopass_hdr_t *hdr, ui
uint8_t get_pagemap(const picopass_hdr_t *hdr);
void iclass_send_as_reader(uint8_t *frame, int len, uint32_t *start_time, uint32_t *end_time, bool shallow_mod);

void generate_single_key_block_inverted(const uint8_t *startingKey, uint32_t index, uint8_t *keyBlock);
void iClass_Recover(iclass_recover_req_t *msg);
#endif
2 changes: 2 additions & 0 deletions client/dictionaries/iclass_default_keys.dic
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ C1B74D7478053AE2
#
# default iCLASS RFIDeas
6B65797374726B72
# Retrieved from Custom Keyed Systems
E9924C13F4BFA82C
11 changes: 7 additions & 4 deletions client/src/cmdhf14b.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions client/src/cmdhf14b.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions client/src/cmdhficlass.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "crypto/asn1utils.h" // ASN1 decoder
#include "preferences.h"
#include "generator.h"
#include "cmdhf14b.h"


#define NUM_CSNS 9
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d2e29b2

Please sign in to comment.