mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-19 06:48:34 +03:00
simtrace.py: Use mitm.py in phone and mitm mode
This commit is contained in:
@@ -2,6 +2,7 @@ import usb.core
|
||||
import usb.util
|
||||
|
||||
from ccid_raw import SmartcardConnection
|
||||
from smartcard_emulator import SmartCardEmulator
|
||||
|
||||
from contextlib import closing
|
||||
|
||||
@@ -43,9 +44,13 @@ def write_phone(dev, resp):
|
||||
print("WR: ", HEX(resp))
|
||||
dev.write(PHONE_WR, resp, 10)
|
||||
|
||||
def do_mitm():
|
||||
def do_mitm(sim_emul=True):
|
||||
dev = find_dev()
|
||||
with closing(SmartcardConnection()) as sm_con:
|
||||
if sim_emul == True:
|
||||
my_class = SmartCardEmulator
|
||||
else:
|
||||
my_class = SmartcardConnection
|
||||
with closing(my_class()) as sm_con:
|
||||
atr = sm_con.getATR()
|
||||
|
||||
apdus = []
|
||||
|
||||
Reference in New Issue
Block a user