Python script to read and write SIM cards. Fields and values are specified in a CSV file, and optionally a filter script can be supplied as a command line argument for dynamically changing the CSV contents for each card.
- Python 3.7 or later (Python Installation Steps)
- pysim
- Right now it uses my fork, because of this commit (https://github.com/andrew-ma/pysim/commit/2f10406c9d3ba42787648fb0060475222531d905), and official repo doesn't accept pull requests on Github
- pandas
- PyQt5
pip install https://github.com/andrew-ma/sim_csv_script/archive/main.zip --upgrade --no-cache-dir
Linux: if you get a "swig: not found" error while running the installation command, first ensure that Python 3.7 or later is installed ('
python3 --version
'). If so, install swig with 'sudo apt install swig
' and retry the installation command.
pip uninstall sim_csv_script -y
sim_csv_script -h
sim_csv_script {example.csv}
- Specify ASCII ADM pin without the leading "0x"
sim_csv_script {example.csv} --write --pin-adm 0x8888888888888888
Example Write Single (reading hexadecimal ADM pin from JSON file with {"IMSI key" : "ADM pin value"})
- Specify ASCII ADM pins without the leading "0x"
sim_csv_script {example.csv} --write --pin-adm-json {IMSI_TO_ADM.json}
sim_csv_script {example.csv} --multiple
On Windows, replace
python3
withpython
-
You can create a filter script (doesn't have to be Python) that reads in a CSV file from STDIN, modifies it, and outputs a new CSV file to STDOUT
-
The filter script should be able to function as a standalone program "
python3 filter_script.py unchanging_arg_1} < {example.csv}
"- In Windows, running this in Powershell will cause an error because Powershell doesn't have the '<' STDIN redirect operator, so run this in Command Prompt
-
Filter script must return 0 on Success. It should also raise Exceptions if it requires certain arguments.
-
Supply a valid command (that can run in the terminal) to --filter, like "
--filter python3 filter_script.py
" -
Unchanging arguments can be specified immediately after the command.
-
If different arguments need to be specified for each card, then we can set --ask-filter-args, which will ask user to type new arguments that will be appended to --filter command.
sim_csv_script {example.csv} --multiple --filter {python3 filter_script.py unchanging_arg1}
sim_csv_script {example.csv} --multiple --filter {python3 filter_script.py} --ask-filter-args
Launch GUI
sim_csv_gui