2020-10-19 08:32:34 +00:00
|
|
|
#!/usr/bin/env python3
|
2013-07-04 13:34:06 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Utility to display some informations about a SIM card
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Copyright (C) 2009 Sylvain Munaut <tnt@246tNt.com>
|
|
|
|
# Copyright (C) 2010 Harald Welte <laforge@gnumonks.org>
|
|
|
|
# Copyright (C) 2013 Alexander Chemeris <alexander.chemeris@gmail.com>
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
|
|
|
|
import hashlib
|
|
|
|
from optparse import OptionParser
|
|
|
|
import os
|
|
|
|
import random
|
|
|
|
import re
|
|
|
|
import sys
|
2020-07-27 22:26:02 +00:00
|
|
|
from pySim.ts_51_011 import EF, DF, EF_SST_map, EF_AD_mode_map
|
2020-05-28 23:14:55 +00:00
|
|
|
from pySim.ts_31_102 import EF_UST_map, EF_USIM_ADF_map
|
2020-03-24 16:26:40 +00:00
|
|
|
from pySim.ts_31_103 import EF_IST_map, EF_ISIM_ADF_map
|
2013-07-04 13:34:06 +00:00
|
|
|
|
|
|
|
from pySim.commands import SimCardCommands
|
2021-04-03 09:52:37 +00:00
|
|
|
from pySim.transport import init_reader
|
2021-01-21 04:57:06 +00:00
|
|
|
from pySim.cards import card_detect, Card, UsimCard, IsimCard
|
2020-05-12 15:24:18 +00:00
|
|
|
from pySim.utils import h2b, swap_nibbles, rpad, dec_imsi, dec_iccid, dec_msisdn
|
2021-04-03 09:52:37 +00:00
|
|
|
from pySim.utils import format_xplmn_w_act, dec_spn, dec_st, dec_addr_tlv
|
2020-03-24 12:03:43 +00:00
|
|
|
from pySim.utils import h2s, format_ePDGSelection
|
2013-07-04 13:34:06 +00:00
|
|
|
|
|
|
|
def parse_options():
|
|
|
|
|
|
|
|
parser = OptionParser(usage="usage: %prog [options]")
|
|
|
|
|
|
|
|
parser.add_option("-d", "--device", dest="device", metavar="DEV",
|
|
|
|
help="Serial Device for SIM access [default: %default]",
|
|
|
|
default="/dev/ttyUSB0",
|
|
|
|
)
|
|
|
|
parser.add_option("-b", "--baud", dest="baudrate", type="int", metavar="BAUD",
|
|
|
|
help="Baudrate used for SIM access [default: %default]",
|
|
|
|
default=9600,
|
|
|
|
)
|
|
|
|
parser.add_option("-p", "--pcsc-device", dest="pcsc_dev", type='int', metavar="PCSC",
|
|
|
|
help="Which PC/SC reader number for SIM access",
|
|
|
|
default=None,
|
|
|
|
)
|
2020-05-09 14:23:37 +00:00
|
|
|
parser.add_option("--modem-device", dest="modem_dev", metavar="DEV",
|
|
|
|
help="Serial port of modem for Generic SIM Access (3GPP TS 27.007)",
|
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
parser.add_option("--modem-baud", dest="modem_baud", type="int", metavar="BAUD",
|
|
|
|
help="Baudrate used for modem's port [default: %default]",
|
|
|
|
default=115200,
|
|
|
|
)
|
2018-10-26 19:10:34 +00:00
|
|
|
parser.add_option("--osmocon", dest="osmocon_sock", metavar="PATH",
|
|
|
|
help="Socket path for Calypso (e.g. Motorola C1XX) based reader (via OsmocomBB)",
|
|
|
|
default=None,
|
|
|
|
)
|
2013-07-04 13:34:06 +00:00
|
|
|
|
|
|
|
(options, args) = parser.parse_args()
|
|
|
|
|
|
|
|
if args:
|
|
|
|
parser.error("Extraneous arguments")
|
|
|
|
|
|
|
|
return options
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
|
|
|
# Parse options
|
|
|
|
opts = parse_options()
|
|
|
|
|
2018-10-26 23:30:33 +00:00
|
|
|
# Init card reader driver
|
2020-05-12 15:24:18 +00:00
|
|
|
sl = init_reader(opts)
|
2021-02-22 15:07:53 +00:00
|
|
|
if sl is None:
|
|
|
|
exit(1)
|
2013-07-04 13:34:06 +00:00
|
|
|
|
|
|
|
# Create command layer
|
|
|
|
scc = SimCardCommands(transport=sl)
|
|
|
|
|
|
|
|
# Wait for SIM card
|
|
|
|
sl.wait_for_card()
|
|
|
|
|
2020-03-23 09:00:50 +00:00
|
|
|
# Assuming UICC SIM
|
|
|
|
scc.cla_byte = "00"
|
|
|
|
scc.sel_ctrl = "0004"
|
|
|
|
|
|
|
|
# Testing for Classic SIM or UICC
|
|
|
|
(res, sw) = sl.send_apdu(scc.cla_byte + "a4" + scc.sel_ctrl + "02" + "3f00")
|
|
|
|
if sw == '6e00':
|
|
|
|
# Just a Classic SIM
|
|
|
|
scc.cla_byte = "a0"
|
|
|
|
scc.sel_ctrl = "0000"
|
|
|
|
|
2013-07-04 13:34:06 +00:00
|
|
|
# Program the card
|
|
|
|
print("Reading ...")
|
|
|
|
|
2020-03-18 10:38:00 +00:00
|
|
|
# Initialize Card object by auto detecting the card
|
|
|
|
card = card_detect("auto", scc) or Card(scc)
|
|
|
|
|
2020-03-20 19:20:27 +00:00
|
|
|
# Read all AIDs on the UICC
|
|
|
|
card.read_aids()
|
|
|
|
|
2013-07-04 13:34:06 +00:00
|
|
|
# EF.ICCID
|
2020-03-18 11:02:34 +00:00
|
|
|
(res, sw) = card.read_iccid()
|
2013-07-04 13:34:06 +00:00
|
|
|
if sw == '9000':
|
2020-03-18 11:02:34 +00:00
|
|
|
print("ICCID: %s" % (res,))
|
2013-07-04 13:34:06 +00:00
|
|
|
else:
|
|
|
|
print("ICCID: Can't read, response code = %s" % (sw,))
|
|
|
|
|
|
|
|
# EF.IMSI
|
2020-03-18 11:05:06 +00:00
|
|
|
(res, sw) = card.read_imsi()
|
2013-07-04 13:34:06 +00:00
|
|
|
if sw == '9000':
|
2020-03-18 11:05:06 +00:00
|
|
|
print("IMSI: %s" % (res,))
|
2013-07-04 13:34:06 +00:00
|
|
|
else:
|
|
|
|
print("IMSI: Can't read, response code = %s" % (sw,))
|
|
|
|
|
2020-03-05 14:30:22 +00:00
|
|
|
# EF.GID1
|
|
|
|
try:
|
2020-03-18 11:14:48 +00:00
|
|
|
(res, sw) = card.read_gid1()
|
2020-03-05 14:30:22 +00:00
|
|
|
if sw == '9000':
|
|
|
|
print("GID1: %s" % (res,))
|
|
|
|
else:
|
|
|
|
print("GID1: Can't read, response code = %s" % (sw,))
|
|
|
|
except Exception as e:
|
|
|
|
print("GID1: Can't read file -- %s" % (str(e),))
|
|
|
|
|
2020-03-05 14:33:00 +00:00
|
|
|
# EF.GID2
|
|
|
|
try:
|
2020-04-01 07:21:20 +00:00
|
|
|
(res, sw) = card.read_binary('GID2')
|
2020-03-05 14:33:00 +00:00
|
|
|
if sw == '9000':
|
|
|
|
print("GID2: %s" % (res,))
|
|
|
|
else:
|
|
|
|
print("GID2: Can't read, response code = %s" % (sw,))
|
|
|
|
except Exception as e:
|
|
|
|
print("GID2: Can't read file -- %s" % (str(e),))
|
|
|
|
|
2013-07-04 13:34:06 +00:00
|
|
|
# EF.SMSP
|
2020-03-19 11:08:20 +00:00
|
|
|
(res, sw) = card.read_record('SMSP', 1)
|
2013-07-04 13:34:06 +00:00
|
|
|
if sw == '9000':
|
|
|
|
print("SMSP: %s" % (res,))
|
|
|
|
else:
|
|
|
|
print("SMSP: Can't read, response code = %s" % (sw,))
|
|
|
|
|
2019-06-08 05:49:08 +00:00
|
|
|
# EF.SPN
|
|
|
|
try:
|
2020-03-19 11:11:25 +00:00
|
|
|
(res, sw) = card.read_spn()
|
2019-06-08 05:49:08 +00:00
|
|
|
if sw == '9000':
|
2020-03-19 11:11:25 +00:00
|
|
|
print("SPN: %s" % (res[0] or "Not available"))
|
|
|
|
print("Display HPLMN: %s" % (res[1],))
|
|
|
|
print("Display OPLMN: %s" % (res[2],))
|
2019-06-08 05:49:08 +00:00
|
|
|
else:
|
|
|
|
print("SPN: Can't read, response code = %s" % (sw,))
|
|
|
|
except Exception as e:
|
|
|
|
print("SPN: Can't read file -- %s" % (str(e),))
|
|
|
|
|
2018-07-11 21:05:58 +00:00
|
|
|
# EF.PLMNsel
|
|
|
|
try:
|
2020-03-19 11:14:10 +00:00
|
|
|
(res, sw) = card.read_binary('PLMNsel')
|
2019-09-11 23:46:25 +00:00
|
|
|
if sw == '9000':
|
|
|
|
print("PLMNsel: %s" % (res))
|
|
|
|
else:
|
|
|
|
print("PLMNsel: Can't read, response code = %s" % (sw,))
|
2018-07-11 21:05:58 +00:00
|
|
|
except Exception as e:
|
2020-01-25 05:45:37 +00:00
|
|
|
print("PLMNsel: Can't read file -- " + str(e))
|
2018-07-11 21:05:58 +00:00
|
|
|
|
|
|
|
# EF.PLMNwAcT
|
2019-09-11 23:46:25 +00:00
|
|
|
try:
|
2020-03-19 11:42:10 +00:00
|
|
|
(res, sw) = card.read_plmn_act()
|
2019-09-11 23:46:25 +00:00
|
|
|
if sw == '9000':
|
2020-03-19 11:42:10 +00:00
|
|
|
print("PLMNwAcT:\n%s" % (res))
|
2019-09-11 23:46:25 +00:00
|
|
|
else:
|
|
|
|
print("PLMNwAcT: Can't read, response code = %s" % (sw,))
|
2018-07-11 21:05:58 +00:00
|
|
|
except Exception as e:
|
2020-01-22 16:38:24 +00:00
|
|
|
print("PLMNwAcT: Can't read file -- " + str(e))
|
2018-07-11 21:05:58 +00:00
|
|
|
|
|
|
|
# EF.OPLMNwAcT
|
2019-09-11 23:46:25 +00:00
|
|
|
try:
|
2020-03-19 11:43:11 +00:00
|
|
|
(res, sw) = card.read_oplmn_act()
|
2019-09-11 23:46:25 +00:00
|
|
|
if sw == '9000':
|
2020-03-19 11:43:11 +00:00
|
|
|
print("OPLMNwAcT:\n%s" % (res))
|
2019-09-11 23:46:25 +00:00
|
|
|
else:
|
|
|
|
print("OPLMNwAcT: Can't read, response code = %s" % (sw,))
|
2018-07-11 21:05:58 +00:00
|
|
|
except Exception as e:
|
2020-01-22 16:38:24 +00:00
|
|
|
print("OPLMNwAcT: Can't read file -- " + str(e))
|
2018-07-11 21:05:58 +00:00
|
|
|
|
|
|
|
# EF.HPLMNAcT
|
2019-09-11 23:46:25 +00:00
|
|
|
try:
|
2020-03-19 11:44:11 +00:00
|
|
|
(res, sw) = card.read_hplmn_act()
|
2019-09-11 23:46:25 +00:00
|
|
|
if sw == '9000':
|
2020-03-19 11:44:11 +00:00
|
|
|
print("HPLMNAcT:\n%s" % (res))
|
2019-09-11 23:46:25 +00:00
|
|
|
else:
|
|
|
|
print("HPLMNAcT: Can't read, response code = %s" % (sw,))
|
2018-07-11 21:05:58 +00:00
|
|
|
except Exception as e:
|
2020-01-22 16:38:24 +00:00
|
|
|
print("HPLMNAcT: Can't read file -- " + str(e))
|
2013-07-04 13:34:06 +00:00
|
|
|
|
|
|
|
# EF.ACC
|
2020-03-19 11:45:45 +00:00
|
|
|
(res, sw) = card.read_binary('ACC')
|
2013-07-04 13:34:06 +00:00
|
|
|
if sw == '9000':
|
|
|
|
print("ACC: %s" % (res,))
|
|
|
|
else:
|
|
|
|
print("ACC: Can't read, response code = %s" % (sw,))
|
|
|
|
|
|
|
|
# EF.MSISDN
|
2013-07-18 08:36:51 +00:00
|
|
|
try:
|
2020-03-19 11:49:16 +00:00
|
|
|
(res, sw) = card.read_msisdn()
|
2013-07-18 08:36:51 +00:00
|
|
|
if sw == '9000':
|
2020-03-19 11:49:16 +00:00
|
|
|
# (npi, ton, msisdn) = res
|
|
|
|
if res is not None:
|
|
|
|
print("MSISDN (NPI=%d ToN=%d): %s" % res)
|
2013-07-18 08:36:51 +00:00
|
|
|
else:
|
|
|
|
print("MSISDN: Not available")
|
2013-07-04 13:34:06 +00:00
|
|
|
else:
|
2013-07-18 08:36:51 +00:00
|
|
|
print("MSISDN: Can't read, response code = %s" % (sw,))
|
2018-07-11 21:02:36 +00:00
|
|
|
except Exception as e:
|
2020-01-22 16:38:24 +00:00
|
|
|
print("MSISDN: Can't read file -- " + str(e))
|
2013-07-04 13:34:06 +00:00
|
|
|
|
2019-03-21 15:21:12 +00:00
|
|
|
# EF.AD
|
2020-03-19 11:50:27 +00:00
|
|
|
(res, sw) = card.read_binary('AD')
|
2019-03-21 15:21:12 +00:00
|
|
|
if sw == '9000':
|
2020-07-27 22:26:02 +00:00
|
|
|
print("Administrative data: %s" % (res,))
|
|
|
|
if res[:2] in EF_AD_mode_map:
|
|
|
|
print("\tMS operation mode: %s" % (EF_AD_mode_map[res[:2]],))
|
|
|
|
else:
|
|
|
|
print("\tMS operation mode: (unknown 0x%s)" % (res[:2],))
|
|
|
|
if int(res[4:6], 16) & 0x01:
|
|
|
|
print("\tCiphering Indicator: enabled")
|
|
|
|
else:
|
|
|
|
print("\tCiphering Indicator: disabled")
|
2019-03-21 15:21:12 +00:00
|
|
|
else:
|
|
|
|
print("AD: Can't read, response code = %s" % (sw,))
|
|
|
|
|
2020-03-20 17:50:39 +00:00
|
|
|
# EF.SST
|
2020-04-20 11:30:34 +00:00
|
|
|
(res, sw) = card.read_binary('SST')
|
2020-03-20 17:50:39 +00:00
|
|
|
if sw == '9000':
|
2020-04-20 11:30:34 +00:00
|
|
|
print("SIM Service Table: %s" % res)
|
2020-03-20 17:50:39 +00:00
|
|
|
# Print those which are available
|
2020-04-20 11:30:34 +00:00
|
|
|
print("%s" % dec_st(res))
|
2020-03-20 17:50:39 +00:00
|
|
|
else:
|
|
|
|
print("SIM Service Table: Can't read, response code = %s" % (sw,))
|
|
|
|
|
2020-03-22 07:20:11 +00:00
|
|
|
# Check whether we have th AID of USIM, if so select it by its AID
|
|
|
|
# EF.UST - File Id in ADF USIM : 6f38
|
2021-03-11 12:03:18 +00:00
|
|
|
data, sw = card.select_adf_by_aid(adf="usim")
|
|
|
|
if sw == '9000':
|
2021-01-21 04:57:06 +00:00
|
|
|
# Select USIM profile
|
|
|
|
usim_card = UsimCard(scc)
|
|
|
|
|
2020-06-03 13:19:40 +00:00
|
|
|
# EF.EHPLMN
|
2021-01-21 04:57:06 +00:00
|
|
|
if usim_card.file_exists(EF_USIM_ADF_map['EHPLMN']):
|
|
|
|
(res, sw) = usim_card.read_ehplmn()
|
2020-06-03 13:19:40 +00:00
|
|
|
if sw == '9000':
|
|
|
|
print("EHPLMN:\n%s" % (res))
|
|
|
|
else:
|
|
|
|
print("EHPLMN: Can't read, response code = %s" % (sw,))
|
2020-09-29 08:11:36 +00:00
|
|
|
|
2020-03-22 07:20:11 +00:00
|
|
|
# EF.UST
|
2020-09-29 08:11:36 +00:00
|
|
|
try:
|
2021-01-21 04:57:06 +00:00
|
|
|
if usim_card.file_exists(EF_USIM_ADF_map['UST']):
|
2020-09-29 08:11:36 +00:00
|
|
|
# res[0] - EF content of UST
|
|
|
|
# res[1] - Human readable format of services marked available in UST
|
2021-01-21 04:57:06 +00:00
|
|
|
(res, sw) = usim_card.read_ust()
|
2020-09-29 08:11:36 +00:00
|
|
|
if sw == '9000':
|
|
|
|
print("USIM Service Table: %s" % res[0])
|
|
|
|
print("%s" % res[1])
|
|
|
|
else:
|
|
|
|
print("USIM Service Table: Can't read, response code = %s" % (sw,))
|
|
|
|
except Exception as e:
|
|
|
|
print("USIM Service Table: Can't read file -- " + str(e))
|
2020-03-22 07:20:11 +00:00
|
|
|
|
2020-03-22 09:00:43 +00:00
|
|
|
#EF.ePDGId - Home ePDG Identifier
|
|
|
|
try:
|
2021-01-21 04:57:06 +00:00
|
|
|
if usim_card.file_exists(EF_USIM_ADF_map['ePDGId']):
|
|
|
|
(res, sw) = usim_card.read_epdgid()
|
2020-09-29 08:03:06 +00:00
|
|
|
if sw == '9000':
|
|
|
|
print("ePDGId:\n%s" % (len(res) and res or '\tNot available\n',))
|
|
|
|
else:
|
|
|
|
print("ePDGId: Can't read, response code = %s" % (sw,))
|
2020-03-22 09:00:43 +00:00
|
|
|
except Exception as e:
|
|
|
|
print("ePDGId: Can't read file -- " + str(e))
|
|
|
|
|
2020-03-24 12:03:43 +00:00
|
|
|
#EF.ePDGSelection - ePDG Selection Information
|
|
|
|
try:
|
2021-01-21 04:57:06 +00:00
|
|
|
if usim_card.file_exists(EF_USIM_ADF_map['ePDGSelection']):
|
|
|
|
(res, sw) = usim_card.read_ePDGSelection()
|
2020-03-24 12:03:43 +00:00
|
|
|
if sw == '9000':
|
|
|
|
print("ePDGSelection:\n%s" % (res,))
|
|
|
|
else:
|
|
|
|
print("ePDGSelection: Can't read, response code = %s" % (sw,))
|
|
|
|
except Exception as e:
|
|
|
|
print("ePDGSelection: Can't read file -- " + str(e))
|
|
|
|
|
2020-03-24 16:26:40 +00:00
|
|
|
# Select ISIM application by its AID
|
2021-03-11 12:03:18 +00:00
|
|
|
data, sw = card.select_adf_by_aid(adf="isim")
|
|
|
|
if sw == '9000':
|
2021-01-21 04:57:06 +00:00
|
|
|
# Select USIM profile
|
|
|
|
isim_card = IsimCard(scc)
|
|
|
|
|
2020-03-24 16:26:40 +00:00
|
|
|
#EF.P-CSCF - P-CSCF Address
|
|
|
|
try:
|
2021-01-21 04:57:06 +00:00
|
|
|
if isim_card.file_exists(EF_ISIM_ADF_map['PCSCF']):
|
|
|
|
res = isim_card.read_pcscf()
|
2020-03-24 16:26:40 +00:00
|
|
|
print("P-CSCF:\n%s" % (len(res) and res or '\tNot available\n',))
|
|
|
|
except Exception as e:
|
|
|
|
print("P-CSCF: Can't read file -- " + str(e))
|
|
|
|
|
2020-03-25 09:23:48 +00:00
|
|
|
# EF.DOMAIN - Home Network Domain Name e.g. ims.mncXXX.mccXXX.3gppnetwork.org
|
|
|
|
try:
|
2021-01-21 04:57:06 +00:00
|
|
|
if isim_card.file_exists(EF_ISIM_ADF_map['DOMAIN']):
|
|
|
|
(res, sw) = isim_card.read_domain()
|
2020-03-25 09:23:48 +00:00
|
|
|
if sw == '9000':
|
|
|
|
print("Home Network Domain Name: %s" % (len(res) and res or 'Not available',))
|
|
|
|
else:
|
|
|
|
print("Home Network Domain Name: Can't read, response code = %s" % (sw,))
|
|
|
|
except Exception as e:
|
|
|
|
print("Home Network Domain Name: Can't read file -- " + str(e))
|
|
|
|
|
2020-03-25 14:38:02 +00:00
|
|
|
# EF.IMPI - IMS private user identity
|
|
|
|
try:
|
2021-01-21 04:57:06 +00:00
|
|
|
if isim_card.file_exists(EF_ISIM_ADF_map['IMPI']):
|
|
|
|
(res, sw) = isim_card.read_impi()
|
2020-03-25 14:38:02 +00:00
|
|
|
if sw == '9000':
|
|
|
|
print("IMS private user identity: %s" % (len(res) and res or 'Not available',))
|
|
|
|
else:
|
|
|
|
print("IMS private user identity: Can't read, response code = %s" % (sw,))
|
|
|
|
except Exception as e:
|
|
|
|
print("IMS private user identity: Can't read file -- " + str(e))
|
|
|
|
|
2020-03-26 08:00:06 +00:00
|
|
|
# EF.IMPU - IMS public user identity
|
|
|
|
try:
|
2021-01-21 04:57:06 +00:00
|
|
|
if isim_card.file_exists(EF_ISIM_ADF_map['IMPU']):
|
|
|
|
res = isim_card.read_impu()
|
2020-03-26 08:00:06 +00:00
|
|
|
print("IMS public user identity:\n%s" % (len(res) and res or '\tNot available\n',))
|
|
|
|
except Exception as e:
|
|
|
|
print("IMS public user identity: Can't read file -- " + str(e))
|
|
|
|
|
2020-06-01 10:53:57 +00:00
|
|
|
# EF.UICCIARI - UICC IARI
|
|
|
|
try:
|
2021-01-21 04:57:06 +00:00
|
|
|
if isim_card.file_exists(EF_ISIM_ADF_map['UICCIARI']):
|
|
|
|
res = isim_card.read_iari()
|
2020-06-01 10:53:57 +00:00
|
|
|
print("UICC IARI:\n%s" % (len(res) and res or '\tNot available\n',))
|
|
|
|
except Exception as e:
|
|
|
|
print("UICC IARI: Can't read file -- " + str(e))
|
|
|
|
|
2020-03-22 07:58:33 +00:00
|
|
|
# Check whether we have th AID of ISIM, if so select it by its AID
|
|
|
|
# EF.IST - File Id in ADF ISIM : 6f07
|
2021-03-11 12:03:18 +00:00
|
|
|
data, sw = card.select_adf_by_aid(adf="isim")
|
|
|
|
if sw == '9000':
|
2020-03-22 07:58:33 +00:00
|
|
|
# EF.IST
|
|
|
|
(res, sw) = card.read_binary('6f07')
|
|
|
|
if sw == '9000':
|
|
|
|
print("ISIM Service Table: %s" % res)
|
|
|
|
# Print those which are available
|
|
|
|
print("%s" % dec_st(res, table="isim"))
|
|
|
|
else:
|
|
|
|
print("ISIM Service Table: Can't read, response code = %s" % (sw,))
|
|
|
|
|
2013-07-04 13:34:06 +00:00
|
|
|
# Done for this card and maybe for everything ?
|
2020-01-22 16:38:24 +00:00
|
|
|
print("Done !\n")
|