PySim研究
pySim-读、写和浏览可编程SIM/USIM/ISIM/HPSIM卡
1.1.PySim-sim安装
git clone https://gitea.osmocom.org/sim-card/pysim.git
sudo apt-get install --no-install-recommends pcscd libpcsclite-dev python3 python3-setuptools python3-pycryptodome python3-pyscard python3-pip
cd pysim/
pip3 install --user -r requirements.txt
1.2.PySim-sim启动
1.2.1.读卡器启动
./pySim-shell.py -p0
1.2.2.真实Sim读取
./pySim-shell.py --modem-device /dev/ttyUSB3
1.2.3.Redhat安装问题
pip install pandas -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install pandas -i https://pypi.doubanio.com/simple
1.3.运行pySim工具
1.3.1.启动pcscd:
开启一个terminal窗口:pcscd -f -d
1.3.2.启动swsim:
另外开启一个terminal窗口,执行以下语句:
./build/swsim.elf --ip 127.0.0.1 --port 37324 --fs filesystem.swiccfs --fs-gen ./data/usim.json
1.3.3.启动pysim
./pySim-shell.py -p0执行这个语句这样就能连接到模拟卡swsim上;
pySIM-shell (MF)> select ADF.USIM
pySIM-shell (MF/ADF.USIM)> select EF.IMSI
pySIM-shell (MF/ADF.USIM/EF.IMSI)> read_binary
089999990000000010
pySIM-shell (MF/ADF.USIM/EF.IMSI)> update_binary 089999990000000011
089999990000000011
pySIM-shell (MF/ADF.USIM/EF.IMSI)> read_binary
089999990000000011
1.4.参考文档:
https://github.com/osmocom/pysim
https://downloads.osmocom.org/docs/pysim/master/html/
https://downloads.osmocom.org/docs/pysim/master/html/shell.html#AT%20Command%20Modem%20Reader