3 #-----------------------------------------------------------------------------
4 # Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # See LICENSE.txt for the text of the license.
17 #-----------------------------------------------------------------------------
19 # python3 -m pip install urllib unidecode
24 ATR_URL
='https://raw.githubusercontent.com/LudovicRousseau/pcsc-tools/master/smartcard_list.txt'
26 C_HEADER
="""//-----------------------------------------------------------------------------
27 // Borrowed initially from
28 // """ + ATR_URL
+ """
29 // Copyright (C) 2002-2021 Ludovic Rousseau
30 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
32 // This program is free software: you can redistribute it and/or modify
33 // it under the terms of the GNU General Public License as published by
34 // the Free Software Foundation, either version 3 of the License, or
35 // (at your option) any later version.
37 // This program is distributed in the hope that it will be useful,
38 // but WITHOUT ANY WARRANTY; without even the implied warranty of
39 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 // GNU General Public License for more details.
42 // See LICENSE.txt for the text of the license.
43 //-----------------------------------------------------------------------------
44 // *DO NOT EDIT MANUALLY*
45 // Autogenerated with atr_scrap_pcsctools.py
46 //-----------------------------------------------------------------------------
52 typedef struct atr_s {
57 const char *getAtrInfo(const char *atr_str);
59 // atr_t array is expected to be NULL terminated
60 const static atr_t AtrTable[] = {
61 { "3BDF18FFC080B1FE751F033078464646462026204963656D616E1D", "Cardhelper by 0xFFFF and Iceman" },
62 { "3B90969181B1FE551FC7D4", "IClass SE Processor (Other) https://www.hidglobal.com/products/embedded-modules/iclass-se/sio-processor"},
65 C_FOOTER
=""" {NULL, "n/a"}
72 with
open('src/atrs.h','w') as fatr
:
73 s
= urllib
.request
.urlopen(ATR_URL
).read().decode()
77 for line
in s
.split('\n'):
78 if len(line
) == 0 or line
[0] == '#':
81 desc
+= ['\\n',''][len(desc
)==0] + unidecode
.unidecode(line
[1:]).replace('"',"'").replace('\\','\\\\')
84 fatr
.write(f
' {{ "{atr}", "{desc}" }},\n')
85 atr
= line
.replace(' ','')
87 fatr
.write(f
' {{ "{atr}", "{desc}" }},\n')
90 if __name__
== "__main__":