WIP / RFC for pysim 'next generation;' aka pysim-shell

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/simtrace@lists.osmocom.org/.

Harald Welte laforge at osmocom.org
Tue Feb 2 18:38:07 UTC 2021

On Fri, Jan 08, 2021 at 11:53:51PM +0100, Harald Welte wrote:
> You can see the very first prototype in the laforge/shell branch of pysim.git

Just a quick update: During past weeks I've been on and off spending a
bit of time to bring this idea further along.  It's already quite mature

* many bugs have been fixed

* SW1/SW2 are now parsed into human readable strings

* many file specific encoders/decoders added

* return to 'SELECT" command is now parsed into json:

pySIM-shell (MF)> select ADF.ISIM
    "file_descriptor": {
        "shareable": true,
        "file_type": "df",
        "structure": "no_info_given"
    "file_identifier": "FF01",
    "df_name": "A0000000871004FFFFFFFF8907090000",
    "proprietary_info": {
        "uicc_characteristics": "71",
        "available_memory": 101640
    "life_cycle_status_int": "operational_activated"
    "security_attrib_compact": "00",
    "pin_status_template_do": "900170830101830181830
pySIM-shell (MF/ADF.ISIM)> select EF.P-CSCF
    "file_descriptor": {
        "shareable": true,
        "file_type": "working_ef",
        "structure": "linear_fixed",
        "record_len": 0,
        "num_of_rec": 0
    "file_identifier": "6F09",
    "proprietary_info": {
        "proprietary_D0": "20",
        "proprietary_D2": "0F"
    "life_cycle_status_int": "operational_activated"
    "security_attrib_ref_expanded": "6F0603",
    "file_size": 1024,
    "short_file_id": ""

It's already reached a state where it can be used to perform useful
tasks.  Be warned: It's still very early and nothing has been tested
with cards other than sysmoISIM-SJA2 at this point.

I think within the next weeks I'll probably try to clean up the patches
and get the current state merged to master.  There's still a lot of work
to be done, including:

* option for storing per-ICCID ADM keys in some config file, so you don't have
  to enter them over and over again when frequently changing with the
  same cards
* bulk read / write commands to read/write all records within one file
* decide on some general rules on how to strucure the JSON output, such
  as including the file path and record number in some metadata?
* automatically pad filss/records with fff to their size as determined
  from the card
* ability to select/read/write arbitrary FID, e.g. for non-standard proprietary
  files that are not part of the ETSI/3GPP specs

- Harald Welte <laforge at osmocom.org>            http://laforge.gnumonks.org/
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)

More information about the simtrace mailing list