Author Topic: SIM write/pySIM error  (Read 9054 times)

herman1199

  • Newbie
  • *
  • Posts: 6
    • View Profile
SIM write/pySIM error
« on: January 11, 2017, 05:07:34 AM »
Hi, I'm trying to write SIMs through NIB GUI uaing pySIM. I have SuperSIM cards and a ACR38 writer. I have Ubuntu 14.04 and BladeRFx40. Voice/SMS/GPRS all working with old SIMs and handsets but I now need control of ISMIs for my test lab so I need fresh SIMs.

I can read the blank cards and pcsc_scan gives:
---------------------------------------------------
PC/SC device scanner
V 1.4.22 (c) 2001-2011, Ludovic Rousseau <ludovic.rousseau@free.fr>
Compiled with PC/SC lite version: 1.8.10
Using reader plug'n play mechanism
Scanning present readers...
0: ACS ACR 38U-CCID 00 00

Wed Jan 11 10:43:27 2017
Reader 0: ACS ACR 38U-CCID 00 00
  Card state: Card inserted,
  ATR: 3B 9A 94 00 92 02 75 93 11 00 01 02 02 21

ATR: 3B 9A 94 00 92 02 75 93 11 00 01 02 02 21
+ TS = 3B --> Direct Convention
+ T0 = 9A, Y(1): 1001, K: 10 (historical bytes)
  TA(1) = 94 --> Fi=512, Di=8, 64 cycles/ETU
    62500 bits/s at 4 MHz, fMax for Fi = 5 MHz => 78125 bits/s
  TD(1) = 00 --> Y(i+1) = 0000, Protocol T = 0
-----
+ Historical bytes: 92 02 75 93 11 00 01 02 02 21
  Category indicator byte: 92 (proprietary format)

Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
3B 9A 94 00 92 02 75 93 11 00 01 02 02 21
3B 9A 94 00 92 02 75 93 11 00 01 02 02 ..
        SuperSIM
--------------------------------------------------


When I run the NIB Write SIM I get:
--------------------------------------------------
Insert card now (or CTRL-C to cancel)
Formatting ...
Generated card parameters :
 > Name    : testBTS
 > SMSP    : e1ffffffffffffffffffffffff058100445555ffffffffffff000000
 > ICCID   : 8944104104721218879
 > MCC/MNC : 104/10
 > IMSI    : 104102143012656
 > Ki      : 4267f67d8cd41a1cb1801a14bd37a962
 > OPC     : 27e2829db8a5bb8500d3f13ac8f18c19
 > ACC     : None

Programming ...
Traceback (most recent call last):
  File "/usr/src/pysim/pySim-prog.py", line 626, in
    card.program(cp)
  File "/usr/src/pysim/pySim/cards.py", line 362, in program
    r = self._scc.select_file(['3f00'])
  File "/usr/src/pysim/pySim/commands.py", line 44, in select_file
    data, sw = self._tp.send_apdu_checksw(self.cla_byte + "a4000C02" + i)
  File "/usr/src/pysim/pySim/transport/__init__.py", line 87, in send_apdu_checksw
    raise RuntimeError("SW match failed ! Expected %s and got %s." % (sw.lower(), rv[1]))

RuntimeError: SW match failed ! Expected 9000 and got 6b00.
----------------------------------------------------

Google-hunt hasn't helped much other than to identify that APDU error 6b00 is "Wrong parameter(s) P1-P2" !!

Card reader/writer compatibility with Yate/pySIM ?

Any help or guidance much appreciated.

herman1199

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SIM write/pySIM error
« Reply #1 on: January 11, 2017, 05:59:49 AM »
Additional to this post:

Yate NIB card type set to:
FakeMagicSim - error 6b00 (gen card parameters not shown)
SuperSim - error 6b00 (gen card parameters not shown)
MagicSim - error 6b00 (gen card parameters not shown)
GrcardSim - error 6404 (generated card parameters shown as above)
SysmoSim-GR1 - error 6404 (generated card parameters shown as above)
SysmoSim-GR2 - error 6b00 (generated card parameters shown as above)
SysmoUSim-GR1 - error 6e00 (generated card parameters shown as above)