mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-19 14:58:35 +03:00
simtrace.py: cmdline arg for simcard emulation
This commit is contained in:
@@ -4,6 +4,7 @@ import argparse
|
|||||||
import sniffer
|
import sniffer
|
||||||
import ccid
|
import ccid
|
||||||
import ccid_select
|
import ccid_select
|
||||||
|
import phone
|
||||||
|
|
||||||
import usb.core
|
import usb.core
|
||||||
import usb.util
|
import usb.util
|
||||||
@@ -50,10 +51,12 @@ def main():
|
|||||||
choices=["cmd1", "cmd2", "cmd_poweron", "cmd_poweroff", "cmd_get_slot_stat", "cmd_get_param"])
|
choices=["cmd1", "cmd2", "cmd_poweron", "cmd_poweroff", "cmd_get_slot_stat", "cmd_get_param"])
|
||||||
parser.add_argument("-s", "--sniff", help="Sniff communication!", action='store_true')
|
parser.add_argument("-s", "--sniff", help="Sniff communication!", action='store_true')
|
||||||
parser.add_argument("-S", "--select_file", help="Transmit SELECT cmd!", action='store_true')
|
parser.add_argument("-S", "--select_file", help="Transmit SELECT cmd!", action='store_true')
|
||||||
|
parser.add_argument("-p", "--phone", help="Emulates simcard", action='store_true')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
print("args: ", args)
|
print("args: ", args)
|
||||||
|
|
||||||
|
|
||||||
# FIXME: why is it a ccid function?
|
# FIXME: why is it a ccid function?
|
||||||
if args.conf is not None:
|
if args.conf is not None:
|
||||||
devs = usb.core.find(find_all=1, custom_match=find_class(0xb)) # 0xb = Smartcard
|
devs = usb.core.find(find_all=1, custom_match=find_class(0xb)) # 0xb = Smartcard
|
||||||
@@ -75,6 +78,8 @@ def main():
|
|||||||
sniffer.sniff()
|
sniffer.sniff()
|
||||||
if args.select_file is True:
|
if args.select_file is True:
|
||||||
ccid_select.select()
|
ccid_select.select()
|
||||||
|
if args.phone is True:
|
||||||
|
phone.emulate_sim()
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user