Daniel Willmann | de07b95 | 2020-10-19 10:32:34 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 2 | |
| 3 | # |
| 4 | # Utility to display some informations about a SIM card |
| 5 | # |
| 6 | # |
| 7 | # Copyright (C) 2009 Sylvain Munaut <tnt@246tNt.com> |
| 8 | # Copyright (C) 2010 Harald Welte <laforge@gnumonks.org> |
| 9 | # Copyright (C) 2013 Alexander Chemeris <alexander.chemeris@gmail.com> |
| 10 | # |
| 11 | # This program is free software: you can redistribute it and/or modify |
| 12 | # it under the terms of the GNU General Public License as published by |
| 13 | # the Free Software Foundation, either version 2 of the License, or |
| 14 | # (at your option) any later version. |
| 15 | # |
| 16 | # This program is distributed in the hope that it will be useful, |
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | # GNU General Public License for more details. |
| 20 | # |
| 21 | # You should have received a copy of the GNU General Public License |
| 22 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 23 | # |
| 24 | |
| 25 | import hashlib |
| 26 | from optparse import OptionParser |
| 27 | import os |
| 28 | import random |
| 29 | import re |
| 30 | import sys |
Vadim Yanitskiy | dfe3dbb | 2020-07-28 05:26:02 +0700 | [diff] [blame] | 31 | from pySim.ts_51_011 import EF, DF, EF_SST_map, EF_AD_mode_map |
Sebastian Viviani | 0dc8f69 | 2020-05-29 00:14:55 +0100 | [diff] [blame] | 32 | from pySim.ts_31_102 import EF_UST_map, EF_USIM_ADF_map |
Supreeth Herle | ee15c77 | 2020-03-22 08:58:33 +0100 | [diff] [blame] | 33 | from pySim.ts_31_103 import EF_IST_map |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 34 | |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 35 | from pySim.commands import SimCardCommands |
Supreeth Herle | 4c306ab | 2020-03-18 11:38:00 +0100 | [diff] [blame] | 36 | from pySim.cards import card_detect, Card |
Philipp Maier | ff84c23 | 2020-05-12 17:24:18 +0200 | [diff] [blame] | 37 | from pySim.utils import h2b, swap_nibbles, rpad, dec_imsi, dec_iccid, dec_msisdn |
Supreeth Herle | b1634db | 2020-03-22 10:00:43 +0100 | [diff] [blame] | 38 | from pySim.utils import format_xplmn_w_act, dec_spn, dec_st, init_reader, dec_epdgid |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 39 | |
| 40 | def parse_options(): |
| 41 | |
| 42 | parser = OptionParser(usage="usage: %prog [options]") |
| 43 | |
| 44 | parser.add_option("-d", "--device", dest="device", metavar="DEV", |
| 45 | help="Serial Device for SIM access [default: %default]", |
| 46 | default="/dev/ttyUSB0", |
| 47 | ) |
| 48 | parser.add_option("-b", "--baud", dest="baudrate", type="int", metavar="BAUD", |
| 49 | help="Baudrate used for SIM access [default: %default]", |
| 50 | default=9600, |
| 51 | ) |
| 52 | parser.add_option("-p", "--pcsc-device", dest="pcsc_dev", type='int', metavar="PCSC", |
| 53 | help="Which PC/SC reader number for SIM access", |
| 54 | default=None, |
| 55 | ) |
Vadim Yanitskiy | 29ca804 | 2020-05-09 21:23:37 +0700 | [diff] [blame] | 56 | parser.add_option("--modem-device", dest="modem_dev", metavar="DEV", |
| 57 | help="Serial port of modem for Generic SIM Access (3GPP TS 27.007)", |
| 58 | default=None, |
| 59 | ) |
| 60 | parser.add_option("--modem-baud", dest="modem_baud", type="int", metavar="BAUD", |
| 61 | help="Baudrate used for modem's port [default: %default]", |
| 62 | default=115200, |
| 63 | ) |
Vadim Yanitskiy | 9f9f5a6 | 2018-10-27 02:10:34 +0700 | [diff] [blame] | 64 | parser.add_option("--osmocon", dest="osmocon_sock", metavar="PATH", |
| 65 | help="Socket path for Calypso (e.g. Motorola C1XX) based reader (via OsmocomBB)", |
| 66 | default=None, |
| 67 | ) |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 68 | |
| 69 | (options, args) = parser.parse_args() |
| 70 | |
| 71 | if args: |
| 72 | parser.error("Extraneous arguments") |
| 73 | |
| 74 | return options |
| 75 | |
| 76 | |
| 77 | if __name__ == '__main__': |
| 78 | |
| 79 | # Parse options |
| 80 | opts = parse_options() |
| 81 | |
Vadim Yanitskiy | 588f3ac | 2018-10-27 06:30:33 +0700 | [diff] [blame] | 82 | # Init card reader driver |
Philipp Maier | ff84c23 | 2020-05-12 17:24:18 +0200 | [diff] [blame] | 83 | sl = init_reader(opts) |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 84 | |
| 85 | # Create command layer |
| 86 | scc = SimCardCommands(transport=sl) |
| 87 | |
| 88 | # Wait for SIM card |
| 89 | sl.wait_for_card() |
| 90 | |
Supreeth Herle | 3e6f16d | 2020-03-23 10:00:50 +0100 | [diff] [blame] | 91 | # Assuming UICC SIM |
| 92 | scc.cla_byte = "00" |
| 93 | scc.sel_ctrl = "0004" |
| 94 | |
| 95 | # Testing for Classic SIM or UICC |
| 96 | (res, sw) = sl.send_apdu(scc.cla_byte + "a4" + scc.sel_ctrl + "02" + "3f00") |
| 97 | if sw == '6e00': |
| 98 | # Just a Classic SIM |
| 99 | scc.cla_byte = "a0" |
| 100 | scc.sel_ctrl = "0000" |
| 101 | |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 102 | # Program the card |
| 103 | print("Reading ...") |
| 104 | |
Supreeth Herle | 4c306ab | 2020-03-18 11:38:00 +0100 | [diff] [blame] | 105 | # Initialize Card object by auto detecting the card |
| 106 | card = card_detect("auto", scc) or Card(scc) |
| 107 | |
Supreeth Herle | 3bf4363 | 2020-03-20 20:20:27 +0100 | [diff] [blame] | 108 | # Read all AIDs on the UICC |
| 109 | card.read_aids() |
| 110 | |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 111 | # EF.ICCID |
Supreeth Herle | 3566b8e | 2020-03-18 12:02:34 +0100 | [diff] [blame] | 112 | (res, sw) = card.read_iccid() |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 113 | if sw == '9000': |
Supreeth Herle | 3566b8e | 2020-03-18 12:02:34 +0100 | [diff] [blame] | 114 | print("ICCID: %s" % (res,)) |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 115 | else: |
| 116 | print("ICCID: Can't read, response code = %s" % (sw,)) |
| 117 | |
| 118 | # EF.IMSI |
Supreeth Herle | f9762dc | 2020-03-18 12:05:06 +0100 | [diff] [blame] | 119 | (res, sw) = card.read_imsi() |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 120 | if sw == '9000': |
Supreeth Herle | f9762dc | 2020-03-18 12:05:06 +0100 | [diff] [blame] | 121 | print("IMSI: %s" % (res,)) |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 122 | else: |
| 123 | print("IMSI: Can't read, response code = %s" % (sw,)) |
| 124 | |
Supreeth Herle | ab46d62 | 2020-03-05 15:30:22 +0100 | [diff] [blame] | 125 | # EF.GID1 |
| 126 | try: |
Supreeth Herle | 98a6927 | 2020-03-18 12:14:48 +0100 | [diff] [blame] | 127 | (res, sw) = card.read_gid1() |
Supreeth Herle | ab46d62 | 2020-03-05 15:30:22 +0100 | [diff] [blame] | 128 | if sw == '9000': |
| 129 | print("GID1: %s" % (res,)) |
| 130 | else: |
| 131 | print("GID1: Can't read, response code = %s" % (sw,)) |
| 132 | except Exception as e: |
| 133 | print("GID1: Can't read file -- %s" % (str(e),)) |
| 134 | |
Supreeth Herle | 0e90e6c | 2020-03-05 15:33:00 +0100 | [diff] [blame] | 135 | # EF.GID2 |
| 136 | try: |
Supreeth Herle | e573ccb | 2020-04-01 09:21:20 +0200 | [diff] [blame] | 137 | (res, sw) = card.read_binary('GID2') |
Supreeth Herle | 0e90e6c | 2020-03-05 15:33:00 +0100 | [diff] [blame] | 138 | if sw == '9000': |
| 139 | print("GID2: %s" % (res,)) |
| 140 | else: |
| 141 | print("GID2: Can't read, response code = %s" % (sw,)) |
| 142 | except Exception as e: |
| 143 | print("GID2: Can't read file -- %s" % (str(e),)) |
| 144 | |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 145 | # EF.SMSP |
Supreeth Herle | ebe6dba | 2020-03-19 12:08:20 +0100 | [diff] [blame] | 146 | (res, sw) = card.read_record('SMSP', 1) |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 147 | if sw == '9000': |
| 148 | print("SMSP: %s" % (res,)) |
| 149 | else: |
| 150 | print("SMSP: Can't read, response code = %s" % (sw,)) |
| 151 | |
Supreeth Herle | f829945 | 2019-06-08 07:49:08 +0200 | [diff] [blame] | 152 | # EF.SPN |
| 153 | try: |
Supreeth Herle | 846cefb | 2020-03-19 12:11:25 +0100 | [diff] [blame] | 154 | (res, sw) = card.read_spn() |
Supreeth Herle | f829945 | 2019-06-08 07:49:08 +0200 | [diff] [blame] | 155 | if sw == '9000': |
Supreeth Herle | 846cefb | 2020-03-19 12:11:25 +0100 | [diff] [blame] | 156 | print("SPN: %s" % (res[0] or "Not available")) |
| 157 | print("Display HPLMN: %s" % (res[1],)) |
| 158 | print("Display OPLMN: %s" % (res[2],)) |
Supreeth Herle | f829945 | 2019-06-08 07:49:08 +0200 | [diff] [blame] | 159 | else: |
| 160 | print("SPN: Can't read, response code = %s" % (sw,)) |
| 161 | except Exception as e: |
| 162 | print("SPN: Can't read file -- %s" % (str(e),)) |
| 163 | |
Philipp Maier | a265049 | 2018-07-11 23:05:58 +0200 | [diff] [blame] | 164 | # EF.PLMNsel |
| 165 | try: |
Supreeth Herle | 9efd8ef | 2020-03-19 12:14:10 +0100 | [diff] [blame] | 166 | (res, sw) = card.read_binary('PLMNsel') |
Denis 'GNUtoo' Carikli | 84d2cb3 | 2019-09-12 01:46:25 +0200 | [diff] [blame] | 167 | if sw == '9000': |
| 168 | print("PLMNsel: %s" % (res)) |
| 169 | else: |
| 170 | print("PLMNsel: Can't read, response code = %s" % (sw,)) |
Philipp Maier | a265049 | 2018-07-11 23:05:58 +0200 | [diff] [blame] | 171 | except Exception as e: |
Vadim Yanitskiy | a3bb334 | 2020-01-25 12:45:37 +0700 | [diff] [blame] | 172 | print("PLMNsel: Can't read file -- " + str(e)) |
Philipp Maier | a265049 | 2018-07-11 23:05:58 +0200 | [diff] [blame] | 173 | |
| 174 | # EF.PLMNwAcT |
Denis 'GNUtoo' Carikli | 84d2cb3 | 2019-09-12 01:46:25 +0200 | [diff] [blame] | 175 | try: |
Supreeth Herle | 1408440 | 2020-03-19 12:42:10 +0100 | [diff] [blame] | 176 | (res, sw) = card.read_plmn_act() |
Denis 'GNUtoo' Carikli | 84d2cb3 | 2019-09-12 01:46:25 +0200 | [diff] [blame] | 177 | if sw == '9000': |
Supreeth Herle | 1408440 | 2020-03-19 12:42:10 +0100 | [diff] [blame] | 178 | print("PLMNwAcT:\n%s" % (res)) |
Denis 'GNUtoo' Carikli | 84d2cb3 | 2019-09-12 01:46:25 +0200 | [diff] [blame] | 179 | else: |
| 180 | print("PLMNwAcT: Can't read, response code = %s" % (sw,)) |
Philipp Maier | a265049 | 2018-07-11 23:05:58 +0200 | [diff] [blame] | 181 | except Exception as e: |
Vadim Yanitskiy | 6727f0c | 2020-01-22 23:38:24 +0700 | [diff] [blame] | 182 | print("PLMNwAcT: Can't read file -- " + str(e)) |
Philipp Maier | a265049 | 2018-07-11 23:05:58 +0200 | [diff] [blame] | 183 | |
| 184 | # EF.OPLMNwAcT |
Denis 'GNUtoo' Carikli | 84d2cb3 | 2019-09-12 01:46:25 +0200 | [diff] [blame] | 185 | try: |
Supreeth Herle | 1757b26 | 2020-03-19 12:43:11 +0100 | [diff] [blame] | 186 | (res, sw) = card.read_oplmn_act() |
Denis 'GNUtoo' Carikli | 84d2cb3 | 2019-09-12 01:46:25 +0200 | [diff] [blame] | 187 | if sw == '9000': |
Supreeth Herle | 1757b26 | 2020-03-19 12:43:11 +0100 | [diff] [blame] | 188 | print("OPLMNwAcT:\n%s" % (res)) |
Denis 'GNUtoo' Carikli | 84d2cb3 | 2019-09-12 01:46:25 +0200 | [diff] [blame] | 189 | else: |
| 190 | print("OPLMNwAcT: Can't read, response code = %s" % (sw,)) |
Philipp Maier | a265049 | 2018-07-11 23:05:58 +0200 | [diff] [blame] | 191 | except Exception as e: |
Vadim Yanitskiy | 6727f0c | 2020-01-22 23:38:24 +0700 | [diff] [blame] | 192 | print("OPLMNwAcT: Can't read file -- " + str(e)) |
Philipp Maier | a265049 | 2018-07-11 23:05:58 +0200 | [diff] [blame] | 193 | |
| 194 | # EF.HPLMNAcT |
Denis 'GNUtoo' Carikli | 84d2cb3 | 2019-09-12 01:46:25 +0200 | [diff] [blame] | 195 | try: |
Supreeth Herle | a850a47 | 2020-03-19 12:44:11 +0100 | [diff] [blame] | 196 | (res, sw) = card.read_hplmn_act() |
Denis 'GNUtoo' Carikli | 84d2cb3 | 2019-09-12 01:46:25 +0200 | [diff] [blame] | 197 | if sw == '9000': |
Supreeth Herle | a850a47 | 2020-03-19 12:44:11 +0100 | [diff] [blame] | 198 | print("HPLMNAcT:\n%s" % (res)) |
Denis 'GNUtoo' Carikli | 84d2cb3 | 2019-09-12 01:46:25 +0200 | [diff] [blame] | 199 | else: |
| 200 | print("HPLMNAcT: Can't read, response code = %s" % (sw,)) |
Philipp Maier | a265049 | 2018-07-11 23:05:58 +0200 | [diff] [blame] | 201 | except Exception as e: |
Vadim Yanitskiy | 6727f0c | 2020-01-22 23:38:24 +0700 | [diff] [blame] | 202 | print("HPLMNAcT: Can't read file -- " + str(e)) |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 203 | |
| 204 | # EF.ACC |
Supreeth Herle | d1fb6fc | 2020-03-19 12:45:45 +0100 | [diff] [blame] | 205 | (res, sw) = card.read_binary('ACC') |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 206 | if sw == '9000': |
| 207 | print("ACC: %s" % (res,)) |
| 208 | else: |
| 209 | print("ACC: Can't read, response code = %s" % (sw,)) |
| 210 | |
| 211 | # EF.MSISDN |
Sylvain Munaut | 9f13897 | 2013-07-18 10:36:51 +0200 | [diff] [blame] | 212 | try: |
Supreeth Herle | 6d66af6 | 2020-03-19 12:49:16 +0100 | [diff] [blame] | 213 | (res, sw) = card.read_msisdn() |
Sylvain Munaut | 9f13897 | 2013-07-18 10:36:51 +0200 | [diff] [blame] | 214 | if sw == '9000': |
Supreeth Herle | 6d66af6 | 2020-03-19 12:49:16 +0100 | [diff] [blame] | 215 | # (npi, ton, msisdn) = res |
| 216 | if res is not None: |
| 217 | print("MSISDN (NPI=%d ToN=%d): %s" % res) |
Sylvain Munaut | 9f13897 | 2013-07-18 10:36:51 +0200 | [diff] [blame] | 218 | else: |
| 219 | print("MSISDN: Not available") |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 220 | else: |
Sylvain Munaut | 9f13897 | 2013-07-18 10:36:51 +0200 | [diff] [blame] | 221 | print("MSISDN: Can't read, response code = %s" % (sw,)) |
Philipp Maier | ea6bdf0 | 2018-07-11 23:02:36 +0200 | [diff] [blame] | 222 | except Exception as e: |
Vadim Yanitskiy | 6727f0c | 2020-01-22 23:38:24 +0700 | [diff] [blame] | 223 | print("MSISDN: Can't read file -- " + str(e)) |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 224 | |
Philipp Maier | ee908ae | 2019-03-21 16:21:12 +0100 | [diff] [blame] | 225 | # EF.AD |
Supreeth Herle | 52ef675 | 2020-03-19 12:50:27 +0100 | [diff] [blame] | 226 | (res, sw) = card.read_binary('AD') |
Philipp Maier | ee908ae | 2019-03-21 16:21:12 +0100 | [diff] [blame] | 227 | if sw == '9000': |
Vadim Yanitskiy | dfe3dbb | 2020-07-28 05:26:02 +0700 | [diff] [blame] | 228 | print("Administrative data: %s" % (res,)) |
| 229 | if res[:2] in EF_AD_mode_map: |
| 230 | print("\tMS operation mode: %s" % (EF_AD_mode_map[res[:2]],)) |
| 231 | else: |
| 232 | print("\tMS operation mode: (unknown 0x%s)" % (res[:2],)) |
| 233 | if int(res[4:6], 16) & 0x01: |
| 234 | print("\tCiphering Indicator: enabled") |
| 235 | else: |
| 236 | print("\tCiphering Indicator: disabled") |
Philipp Maier | ee908ae | 2019-03-21 16:21:12 +0100 | [diff] [blame] | 237 | else: |
| 238 | print("AD: Can't read, response code = %s" % (sw,)) |
| 239 | |
Supreeth Herle | e26331e | 2020-03-20 18:50:39 +0100 | [diff] [blame] | 240 | # EF.SST |
Supreeth Herle | d3b13d0 | 2020-04-20 13:30:34 +0200 | [diff] [blame] | 241 | (res, sw) = card.read_binary('SST') |
Supreeth Herle | e26331e | 2020-03-20 18:50:39 +0100 | [diff] [blame] | 242 | if sw == '9000': |
Supreeth Herle | d3b13d0 | 2020-04-20 13:30:34 +0200 | [diff] [blame] | 243 | print("SIM Service Table: %s" % res) |
Supreeth Herle | e26331e | 2020-03-20 18:50:39 +0100 | [diff] [blame] | 244 | # Print those which are available |
Supreeth Herle | d3b13d0 | 2020-04-20 13:30:34 +0200 | [diff] [blame] | 245 | print("%s" % dec_st(res)) |
Supreeth Herle | e26331e | 2020-03-20 18:50:39 +0100 | [diff] [blame] | 246 | else: |
| 247 | print("SIM Service Table: Can't read, response code = %s" % (sw,)) |
| 248 | |
Supreeth Herle | 9641299 | 2020-03-22 08:20:11 +0100 | [diff] [blame] | 249 | # Check whether we have th AID of USIM, if so select it by its AID |
| 250 | # EF.UST - File Id in ADF USIM : 6f38 |
| 251 | if '9000' == card.select_adf_by_aid(): |
Harald Welte | ca67394 | 2020-06-03 15:19:40 +0200 | [diff] [blame] | 252 | # EF.EHPLMN |
| 253 | if card.file_exists(EF_USIM_ADF_map['EHPLMN']): |
| 254 | (res, sw) = card.read_ehplmn() |
| 255 | if sw == '9000': |
| 256 | print("EHPLMN:\n%s" % (res)) |
| 257 | else: |
| 258 | print("EHPLMN: Can't read, response code = %s" % (sw,)) |
herlesupreeth | 4a3580b | 2020-09-29 10:11:36 +0200 | [diff] [blame] | 259 | |
Supreeth Herle | 9641299 | 2020-03-22 08:20:11 +0100 | [diff] [blame] | 260 | # EF.UST |
herlesupreeth | 4a3580b | 2020-09-29 10:11:36 +0200 | [diff] [blame] | 261 | try: |
| 262 | if card.file_exists(EF_USIM_ADF_map['UST']): |
| 263 | # res[0] - EF content of UST |
| 264 | # res[1] - Human readable format of services marked available in UST |
| 265 | (res, sw) = card.read_ust() |
| 266 | if sw == '9000': |
| 267 | print("USIM Service Table: %s" % res[0]) |
| 268 | print("%s" % res[1]) |
| 269 | else: |
| 270 | print("USIM Service Table: Can't read, response code = %s" % (sw,)) |
| 271 | except Exception as e: |
| 272 | print("USIM Service Table: Can't read file -- " + str(e)) |
Supreeth Herle | 9641299 | 2020-03-22 08:20:11 +0100 | [diff] [blame] | 273 | |
Supreeth Herle | b1634db | 2020-03-22 10:00:43 +0100 | [diff] [blame] | 274 | #EF.ePDGId - Home ePDG Identifier |
| 275 | try: |
herlesupreeth | f8232db | 2020-09-29 10:03:06 +0200 | [diff] [blame] | 276 | if card.file_exists(EF_USIM_ADF_map['ePDGId']): |
| 277 | (res, sw) = card.read_epdgid() |
| 278 | if sw == '9000': |
| 279 | print("ePDGId:\n%s" % (len(res) and res or '\tNot available\n',)) |
| 280 | else: |
| 281 | print("ePDGId: Can't read, response code = %s" % (sw,)) |
Supreeth Herle | b1634db | 2020-03-22 10:00:43 +0100 | [diff] [blame] | 282 | except Exception as e: |
| 283 | print("ePDGId: Can't read file -- " + str(e)) |
| 284 | |
Supreeth Herle | ee15c77 | 2020-03-22 08:58:33 +0100 | [diff] [blame] | 285 | # Check whether we have th AID of ISIM, if so select it by its AID |
| 286 | # EF.IST - File Id in ADF ISIM : 6f07 |
| 287 | if '9000' == card.select_adf_by_aid(adf="isim"): |
| 288 | # EF.IST |
| 289 | (res, sw) = card.read_binary('6f07') |
| 290 | if sw == '9000': |
| 291 | print("ISIM Service Table: %s" % res) |
| 292 | # Print those which are available |
| 293 | print("%s" % dec_st(res, table="isim")) |
| 294 | else: |
| 295 | print("ISIM Service Table: Can't read, response code = %s" % (sw,)) |
| 296 | |
Alexander Chemeris | 6e58914 | 2013-07-04 17:34:06 +0400 | [diff] [blame] | 297 | # Done for this card and maybe for everything ? |
Vadim Yanitskiy | 6727f0c | 2020-01-22 23:38:24 +0700 | [diff] [blame] | 298 | print("Done !\n") |