pySim: Utility to program SIMs

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Sylvain Munaut 246tnt at gmail.com
Sun Dec 27 09:38:04 UTC 2009


I' ve just added a tool to deal with SIMs more easily (especially when you
want to program tens of them ... :)
You can check it out at git://bs11-abis.gnumonks.org/pysim.git

The currently supported models are :
 - Super Sim 12-in-1 (the format  described in the OpenBSC Wiki)
 - Magic SIM (2010 model)
 - 'fake' Magic SIM (some counterfeits ?)

Note that I have some marked 'SuperSIM' that need the 'Fake Magic SIM
protocol'. In any case, just try 'auto' first and it'll try to autodetect.
If you have a card for which that doesn't work, contact me please (or debug
and fix it yourself :)

I tested it with the 3 models I have here and it worked fine (tested IMSI,
PLMN_Sel & Ki). (with the 2010 magic sim model, the ICCID isn't programmed
but that has no impact ... and it's not programmed with the official
software either ...)

Here's the README for reference :

This utility allows to :

 * Program customizable SIMs. Two modes are possible:

  - one where you specify every parameter manually :

./pySim.py -n 26C3 -c 49 -x 262 -y 42 -i <IMSI> -s <ICCID>


  - one where they are generated from some minimal set :

./pySim.py -n 26C3 -c 49 -x 262 -y 42 -z <random_string_of_choice> -j
<card_num>

    With <random_string_of_choice> and <card_num>, the soft will generate
    'predictable' IMSI and ICCID, so make sure you choose them so as not to
    conflict with anyone. (for eg. your name as <random_string_of_choice>
and
    0 1 2 ... for <card num>).

  You also need to enter some parameters to select the device :
   -t TYPE : type of card (supersim, magicsim, fakemagicsim or try 'auto')
   -d DEV  : Serial port device (default /dev/ttyUSB0)
   -b BAUD : Baudrate (default 9600)

 * Interact with SIMs from a python interactive shell (ipython for eg :)

import pySim
sl = pySim.SerialSimLink(device='/dev/ttyUSB0', baudrate=9600)
print sl.read_binary(['3f00', '7f20', '6f07']) # Print IMSI
print sl.run_gsm('00112233445566778899aabbccddeeff') # Run A3/A8

----------------


    Sylvain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/openbsc/attachments/20091227/69fc95a0/attachment.htm>


More information about the OpenBSC mailing list