Skip to content

Commit 3ec375a

Browse files
committed
hf 14b info: add ATR fingerprinting
1 parent f93c997 commit 3ec375a

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file.
33
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...
44

55
## [unreleased][unreleased]
6-
- Added ATR fingerprinting to `hf 14a info` (@doegox)
6+
- Added ATR fingerprinting to `hf 14a/14b info` (@doegox)
77

88
## [Phrack.4.20728][2025-09-11]
99
- Change `lf t55xx restore` - now skips writing block0 if its all zeros (@iceman1001)

client/src/cmdhf14b.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
#include "aidsearch.h"
3535
#include "fileutils.h" // saveFile
3636
#include "iclass_cmd.h" // picopass defines
37-
#include "cmdhf.h" // handle HF plot
37+
#include "cmdhf.h" // handle HF plot
38+
#include "atrs.h" // atqbToEmulatedAtr
3839

3940
#define MAX_14B_TIMEOUT_MS (4949U)
4041

@@ -467,8 +468,8 @@ static int print_atqb_resp(uint8_t *data, uint8_t cid) {
467468
PrintAndLogEx(SUCCESS, " CID : %u", cid & 0x0f);
468469
PrintAndLogEx(NORMAL, "");
469470

470-
PrintAndLogEx(INFO, "--- " _CYAN_("Fingerprint"));
471471
if (memcmp(data, "\x54\x43\x4F\x53", 4) == 0) {
472+
PrintAndLogEx(INFO, "--- " _CYAN_("Fingerprint") " -------------------------------");
472473

473474
int outlen = 0;
474475
uint8_t out[PM3_CMD_DATA_SIZE] = {0};
@@ -483,7 +484,17 @@ static int print_atqb_resp(uint8_t *data, uint8_t cid) {
483484
}
484485

485486
} else {
486-
PrintAndLogEx(INFO, "n/a");
487+
PrintAndLogEx(INFO, "--- " _CYAN_("ATR fingerprint") " ---------------------------");
488+
uint8_t atr[256] = {0};
489+
int atrLen = 0;
490+
atqbToEmulatedAtr(data, cid, atr, &atrLen);
491+
char *copy = str_dup(getAtrInfo(sprint_hex_inrow(atr, atrLen)));
492+
char *token = strtok(copy, "\n");
493+
while (token != NULL) {
494+
PrintAndLogEx(INFO, " %s", token);
495+
token = strtok(NULL, "\n");
496+
}
497+
free(copy);
487498
}
488499
PrintAndLogEx(NORMAL, "");
489500
return PM3_SUCCESS;

0 commit comments

Comments
 (0)