]> git.zerfleddert.de Git - proxmark3-svn/blame - client/taginfo.c
fix 'hf 15 csetuid' (#890)
[proxmark3-svn] / client / taginfo.c
CommitLineData
1338d245 1//-----------------------------------------------------------------------------
2// Functions for Chip Identification
3//-----------------------------------------------------------------------------
4
5#include "taginfo.h"
6
7#include <stdint.h>
8
9// ISO/IEC 7816-6 manufacturer byte decoding
10
11typedef struct {
12 uint8_t manufacturer_byte;
13 char* desc;
14} manufacturerName_t;
15
16// based on ISO/IEC JTC1/SC17 STANDING DOCUMENT 5 (Updated March 2018) Register of IC manufacturers
17static const manufacturerName_t manufacturerMapping[] = {
18 // ID, "Vendor Country"
19 { 0x01, "Motorola UK"},
20 { 0x02, "STMicroelectronics SA France"},
21 { 0x03, "Hitachi, Ltd Japan"},
22 { 0x04, "NXP Semiconductors Germany"},
23 { 0x05, "Infineon Technologies AG Germany"},
24 { 0x06, "Cylink USA"},
25 { 0x07, "Texas Instrument France"},
26 { 0x08, "Fujitsu Limited Japan"},
27 { 0x09, "Matsushita Electronics Corporation, Semiconductor Company Japan"},
28 { 0x0A, "NEC Japan"},
29 { 0x0B, "Oki Electric Industry Co. Ltd Japan"},
30 { 0x0C, "Toshiba Corp. Japan"},
31 { 0x0D, "Mitsubishi Electric Corp. Japan"},
32 { 0x0E, "Samsung Electronics Co. Ltd Korea"},
33 { 0x0F, "Hynix Korea"},
34 { 0x10, "LG-Semiconductors Co. Ltd Korea"},
35 { 0x11, "Emosyn-EM Microelectronics USA"},
36 { 0x12, "INSIDE Technology France"},
37 { 0x13, "ORGA Kartensysteme GmbH Germany"},
38 { 0x14, "SHARP Corporation Japan"},
39 { 0x15, "ATMEL France"},
40 { 0x16, "EM Microelectronic-Marin SA Switzerland"},
41 { 0x17, "SMARTRAC TECHNOLOGY GmbH Germany"},
42 { 0x18, "ZMD AG Germany"},
43 { 0x19, "XICOR, Inc. USA"},
44 { 0x1A, "Sony Corporation Japan"},
45 { 0x1B, "Malaysia Microelectronic Solutions Sdn. Bhd Malaysia"},
46 { 0x1C, "Emosyn USA"},
47 { 0x1D, "Shanghai Fudan Microelectronics Co. Ltd. P.R. China"},
48 { 0x1E, "Magellan Technology Pty Limited Australia"},
49 { 0x1F, "Melexis NV BO Switzerland"},
50 { 0x20, "Renesas Technology Corp. Japan"},
51 { 0x21, "TAGSYS France"},
52 { 0x22, "Transcore USA"},
53 { 0x23, "Shanghai belling corp., ltd. China"},
54 { 0x24, "Masktech Germany Gmbh Germany"},
55 { 0x25, "Innovision Research and Technology Plc UK"},
56 { 0x26, "Hitachi ULSI Systems Co., Ltd. Japan"},
57 { 0x27, "Yubico AB Sweden"},
58 { 0x28, "Ricoh Japan"},
59 { 0x29, "ASK France"},
60 { 0x2A, "Unicore Microsystems, LLC Russian Federation"},
61 { 0x2B, "Dallas Semiconductor/Maxim USA"},
62 { 0x2C, "Impinj, Inc. USA"},
63 { 0x2D, "RightPlug Alliance USA"},
64 { 0x2E, "Broadcom Corporation USA"},
65 { 0x2F, "MStar Semiconductor, Inc Taiwan, ROC"},
66 { 0x30, "BeeDar Technology Inc. USA"},
67 { 0x31, "RFIDsec Denmark"},
68 { 0x32, "Schweizer Electronic AG Germany"},
69 { 0x33, "AMIC Technology Corp Taiwan"},
70 { 0x34, "Mikron JSC Russia"},
71 { 0x35, "Fraunhofer Institute for Photonic Microsystems Germany"},
72 { 0x36, "IDS Microchip AG Switzerland"},
73 { 0x37, "Kovio USA"},
74 { 0x38, "HMT Microelectronic Ltd Switzerland"},
75 { 0x39, "Silicon Craft Technology Thailand"},
76 { 0x3A, "Advanced Film Device Inc. Japan"},
77 { 0x3B, "Nitecrest Ltd UK"},
78 { 0x3C, "Verayo Inc. USA"},
79 { 0x3D, "HID Global USA"},
80 { 0x3E, "Productivity Engineering Gmbh Germany"},
81 { 0x3F, "Austriamicrosystems AG (reserved) Austria"},
82 { 0x40, "Gemalto SA France"},
83 { 0x41, "Renesas Electronics Corporation Japan"},
84 { 0x42, "3Alogics Inc Korea"},
85 { 0x43, "Top TroniQ Asia Limited Hong Kong"},
86 { 0x44, "Gentag Inc (USA) USA"},
87 { 0x45, "Invengo Information Technology Co.Ltd China"},
88 { 0x46, "Guangzhou Sysur Microelectronics, Inc China"},
89 { 0x47, "CEITEC S.A. Brazil"},
90 { 0x48, "Shanghai Quanray Electronics Co. Ltd. China"},
91 { 0x49, "MediaTek Inc Taiwan"},
92 { 0x4A, "Angstrem PJSC Russia"},
93 { 0x4B, "Celisic Semiconductor (Hong Kong) Limited China"},
94 { 0x4C, "LEGIC Identsystems AG Switzerland"},
95 { 0x4D, "Balluff GmbH Germany"},
96 { 0x4E, "Oberthur Technologies France"},
97 { 0x4F, "Silterra Malaysia Sdn. Bhd. Malaysia"},
98 { 0x50, "DELTA Danish Electronics, Light & Acoustics Denmark"},
99 { 0x51, "Giesecke & Devrient GmbH Germany"},
100 { 0x52, "Shenzhen China Vision Microelectronics Co., Ltd. China"},
101 { 0x53, "Shanghai Feiju Microelectronics Co. Ltd. China"},
102 { 0x54, "Intel Corporation USA"},
103 { 0x55, "Microsensys GmbH Germany"},
104 { 0x56, "Sonix Technology Co., Ltd. Taiwan"},
105 { 0x57, "Qualcomm Technologies Inc USA"},
106 { 0x58, "Realtek Semiconductor Corp Taiwan"},
107 { 0x59, "Freevision Technologies Co. Ltd China"},
108 { 0x5A, "Giantec Semiconductor Inc. China"},
109 { 0x5B, "JSC Angstrem-T Russia"},
110 { 0x5C, "STARCHIP France"},
111 { 0x5D, "SPIRTECH France"},
112 { 0x5E, "GANTNER Electronic GmbH Austria"},
113 { 0x5F, "Nordic Semiconductor Norway"},
114 { 0x60, "Verisiti Inc USA"},
115 { 0x61, "Wearlinks Technology Inc. China"},
116 { 0x62, "Userstar Information Systems Co., Ltd Taiwan"},
117 { 0x63, "Pragmatic Printing Ltd. UK"},
118 { 0x64, "Associacao do Laboratorio de Sistemas Integraveis Tecnologico – LSI-TEC Brazil"},
119 { 0x65, "Tendyron Corporation China"},
120 { 0x66, "MUTO Smart Co., Ltd. Korea"},
121 { 0x67, "ON Semiconductor USA"},
122 { 0x68, "TÜBİTAK BİLGEM Turkey"},
123 { 0x69, "Huada Semiconductor Co., Ltd China"},
124 { 0x6A, "SEVENEY France"},
125 { 0x6B, "ISSM France"},
126 { 0x6C, "Wisesec Ltd Israel"},
127 { 0x7E, "Holtek Taiwan"},
128 { 0x00, "Unknown" } // must be the last entry
129};
130
131// get manufacturer's name and country based on the manufacturer byte
132char *getManufacturerName(uint8_t vendorID)
133{
134 int i;
135 int len = sizeof(manufacturerMapping) / sizeof(manufacturerName_t);
136
137 for (i = 0; i < len; ++i)
138 if (vendorID == manufacturerMapping[i].manufacturer_byte)
139 return manufacturerMapping[i].desc;
140
141 //No match, return default
142 return manufacturerMapping[len-1].desc;
143}
144
145
146// Chip ID encoding
147
148typedef struct {
149 uint8_t manufacturer; // chip info is manufacturer specific
150 uint8_t chipID;
151 uint8_t mask; // relevant bits
152 char* desc;
153} chipinfo_t;
154
155
156const chipinfo_t chipIDmapping[] = {
157 // manufacturer_byte, chip_id, bitmask for chip_id, Text
158
159 // 0x02 = ST Microelectronics
160 { 0x02, 0x05, 0xFF, "LRI64 [IC id = 05]"},
161 { 0x02, 0x08, 0xFF, "LRI2K [IC id = 08]"},
162 { 0x02, 0x0A, 0xFF, "LRIS2K [IC id = 10]"},
163 { 0x02, 0x44, 0xFF, "LRIS64K [IC id = 68]"},
164 { 0x02, 0x00, 0xFC, "SRIX4K (Special)"},
165 { 0x02, 0x08, 0xFC, "SR176"},
166 { 0x02, 0x0C, 0xFC, "SRIX4K"},
167 { 0x02, 0x10, 0xFC, "SRIX512"},
168 { 0x02, 0x18, 0xFC, "SRI512"},
169 { 0x02, 0x1C, 0xFC, "SRI4K"},
170 { 0x02, 0x30, 0xFC, "SRT512"},
171
172 // 0x04 = Philips/NXP
173 //I-Code SLI SL2 ICS20 [IC id = 01]
174 //I-Code SLI-S [IC id = 02]
175 //I-Code SLI-L [IC id = 03]
176 //I-Code SLIX [IC id = 01 + bit36 set to 1 (starting from bit0 - different from normal SLI)]
177 //I-Code SLIX-S [IC id = 02 + bit36 set to 1]
178 //I-Code SLIX-L [IC id = 03 + bit36 set to 1]
179 { 0x04, 0x01, 0xFF, "IC SL2 ICS20/ICS21(SLI) ICS2002/ICS2102(SLIX)" },
180 { 0x04, 0x02, 0xFF, "IC SL2 ICS53/ICS54(SLI-S) ICS5302/ICS5402(SLIX-S)" },
181 { 0x04, 0x03, 0xFF, "IC SL2 ICS50/ICS51(SLI-L) ICS5002/ICS5102(SLIX-L)" },
182
183 // 0x05 = Infineon
184 { 0x05, 0xA1, 0xFF, "SRF55V01P [IC id = 161] plain mode 1kBit"},
185 { 0x05, 0xA8, 0xFF, "SRF55V01P [IC id = 168] pilot series 1kBit"},
186 { 0x05, 0x40, 0xFF, "SRF55V02P [IC id = 64] plain mode 2kBit"},
187 { 0x05, 0x00, 0xFF, "SRF55V10P [IC id = 00] plain mode 10KBit"},
188 { 0x05, 0x50, 0xFF, "SRF55V02S [IC id = 80] secure mode 2kBit"},
189 { 0x05, 0x10, 0xFF, "SRF55V10S [IC id = 16] secure mode 10KBit"},
190 { 0x05, 0x1E, 0xFE, "SLE66r01P [IC id = 3x = My-d Move or My-d move NFC]"},
191 { 0x05, 0x20, 0xF8, "SLE66r01P [IC id = 3x = My-d Move or My-d move NFC]"},
192
193 // 0x07 = Texas Instruments
194 // XX = from bit 41 to bit 43 = product configuration - from bit 44 to bit 47 IC id (Chip ID Family)
195 //Tag IT RFIDType-I Plus, 2kBit, TI Inlay
196 //Tag-it HF-I Plus Inlay [IC id = 00] -> b'0000 000 2kBit
197 //Tag-it HF-I Plus Chip [IC id = 64] -> b'1000 000 2kBit
198 //Tag-it HF-I Standard Chip / Inlays [IC id = 96] -> b'1100 000 256Bit
199 //Tag-it HF-I Pro Chip / Inlays [IC id = 98] -> b'1100 010 256Bit, Password protection
200 { 0x07, 0x00, 0xF0, "Tag-it HF-I Plus Inlay; 64x32bit" },
201 { 0x07, 0x10, 0xF0, "Tag-it HF-I Plus Chip; 64x32bit" },
202 { 0x07, 0x80, 0xFE, "Tag-it HF-I Plus (RF-HDT-DVBB tag or Third Party Products)" },
203 { 0x07, 0xC0, 0xFE, "Tag-it HF-I Standard; 8x32bit" },
204 { 0x07, 0xC4, 0xFE, "Tag-it HF-I Pro; 8x23bit; password" },
205
206
207 // 0x16 = EM Microelectronic-Marin SA Switzerland (Skidata)
208 { 0x16, 0x04, 0xFF, "EM4034 [IC id = 01] (Read/Write - no AFI)"},
209 { 0x16, 0x0C, 0xFF, "EM4035 [IC id = 03] (Read/Write - replaced by 4233)"},
210 { 0x16, 0x10, 0xFF, "EM4135 [IC id = 04] (Read/Write - replaced by 4233) 36x64bit start page 13"},
211 { 0x16, 0x14, 0xFF, "EM4036 [IC id = 05] 28pF"},
212 { 0x16, 0x18, 0xFF, "EM4006 [IC id = 06] (Read Only)"},
213 { 0x16, 0x1C, 0xFF, "EM4133 [IC id = 07] 23,5pF (Read/Write)"},
214 { 0x16, 0x20, 0xFF, "EM4033 [IC id = 08] 23,5pF (Read Only - no AFI / no DSFID / no security blocks)"},
215 { 0x16, 0x24, 0xFF, "EM4233 [IC id = 09] 23,5pF CustomerID-102"},
216 { 0x16, 0x28, 0xFF, "EM4233 SLIC [IC id = 10] 23,5pF (1Kb flash memory - not provide High Security mode and QuietStorage feature)" },
217 { 0x16, 0x3C, 0xFF, "EM4237 [IC id = 15] 23,5pF"},
218 { 0x16, 0x7C, 0xFF, "EM4233 [IC id = 31] 95pF"},
219 { 0x16, 0x94, 0xFF, "EM4036 [IC id = 37] 95pF 51x64bit "},
220 { 0x16, 0x9c, 0xFF, "EM4133 [IC id = 39] 95pF (Read/Write)" },
221 { 0x16, 0xA8, 0xFF, "EM4233 SLIC [IC id = 42] 97pF" },
222 { 0x16, 0xBC, 0xFF, "EM4237 [IC id = 47] 97pF" },
223
224 { 0x00, 0x00, 0x00, "no tag-info available" } // must be the last entry
225};
226
227
228// get a product description based on the UID
229// uid[8] tag uid
230// returns description of the best match
231char *getChipInfo(uint8_t vendorID, uint8_t chipID) {
232 int i = 0;
233 int best = -1;
234 while (chipIDmapping[i].mask > 0) {
235 if (vendorID == chipIDmapping[i].manufacturer
236 && (chipID & chipIDmapping[i].mask) == chipIDmapping[i].chipID) {
237 if (best == -1) {
238 best = i;
239 } else {
240 if (chipIDmapping[i].mask > chipIDmapping[best].mask) {
241 best = i;
242 }
243 }
244 }
245 i++;
246 }
247
248 if (best >= 0) return chipIDmapping[best].desc;
249
250 return chipIDmapping[i].desc;
251}
Impressum, Datenschutz