fix one too small
[RRG-proxmark3.git] / client / src / cmdhfst.c
blob13c482cbc739989b2120b13cd8870034ac887889
1 //-----------------------------------------------------------------------------
2 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // See LICENSE.txt for the text of the license.
15 //-----------------------------------------------------------------------------
16 // High frequency ISO14443A / ST commands
17 //-----------------------------------------------------------------------------
19 #include "cmdhfst.h"
20 #include <string.h>
21 #include <stdio.h>
23 #define TIMEOUT 2000
25 // get ST Microelectronics chip model (from UID)
27 const char *get_st_chip_model(uint8_t pc) {
28 switch (pc) {
29 case 0x0:
30 return "SRIX4K (Special)";
31 case 0x2:
32 return "SR176";
33 case 0x3:
34 return "SRIX4K";
35 case 0x4:
36 return "SRIX512";
37 case 0x6:
38 return "SRI512";
39 case 0x7:
40 return "SRI4K";
41 case 0xC:
42 return "SRT512";
43 case 0xC4:
44 return "ST25TA64K";
45 case 0xC5:
46 return "ST25TA16K";
47 case 0xE2:
48 return "ST25??? IKEA Rothult";
49 case 0xE3:
50 return "ST25TA02KB";
51 case 0xE4:
52 return "ST25TA512B";
53 case 0xE5:
54 return "ST25TA512";
55 case 0xA2:
56 return "ST25TA02K-P";
57 case 0xA3:
58 return "ST25TA02KB-P";
59 case 0xF3:
60 return "ST25TA02KB-D";
61 default:
62 return "Unknown";
68 // print UID info from SRx chips (ST Microelectronics)
69 void print_st_general_info(uint8_t *data, uint8_t len) {
70 //uid = first 8 bytes in data
71 PrintAndLogEx(NORMAL, "");
72 PrintAndLogEx(SUCCESS, " UID: " _GREEN_("%s"), sprint_hex(SwapEndian64(data, 8, 8), len));
73 PrintAndLogEx(SUCCESS, " MFG: %02X, " _YELLOW_("%s"), data[6], getTagInfo(data[6]));
74 PrintAndLogEx(SUCCESS, "Chip: %02X, " _YELLOW_("%s"), data[5] >> 2, get_st_chip_model(data[5] >> 2));