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") else: print("AD: Can't read, response code = %s" % (sw, )) # EF.SST (res, sw) = card.read_binary('SST') if sw == '9000': print("SIM Service Table: %s" % res) # Print those which are available print("%s" % dec_st(res)) else: print("SIM Service Table: Can't read, response code = %s" % (sw, )) # Check whether we have th AID of USIM, if so select it by its AID # EF.UST - File Id in ADF USIM : 6f38 if '9000' == card.select_adf_by_aid(): # Select USIM profile usim_card = UsimCard(scc) # EF.EHPLMN if usim_card.file_exists(EF_USIM_ADF_map['EHPLMN']): (res, sw) = usim_card.read_ehplmn() if sw == '9000': print("EHPLMN:\n%s" % (res)) else:
ad = EF_AD() decoded_data = ad.decode_hex(res) print("\tMS operation mode: %s" % decoded_data['ms_operation_mode']) if decoded_data['ofm']: print("\tCiphering Indicator: enabled") else: print("\tCiphering Indicator: disabled") else: print("AD: Can't read, response code = %s" % (sw, )) # EF.SST (res, sw) = card.read_binary('SST') if sw == '9000': print("SIM Service Table: %s" % res) # Print those which are available print("%s" % dec_st(res)) else: print("SIM Service Table: Can't read, response code = %s" % (sw, )) # Check whether we have th AID of USIM, if so select it by its AID # EF.UST - File Id in ADF USIM : 6f38 data, sw = card.select_adf_by_aid(adf="usim") if sw == '9000': # Select USIM profile usim_card = UsimCard(scc) # EF.EHPLMN if usim_card.file_exists(EF_USIM_ADF_map['EHPLMN']): (res, sw) = usim_card.read_ehplmn() if sw == '9000': print("EHPLMN:\n%s" % (res))