mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-23 08:48:35 +03:00
mitm.py: Pass device to do_mitm function
This commit is contained in:
@@ -12,14 +12,6 @@ from util import HEX
|
|||||||
from constants import *
|
from constants import *
|
||||||
from apdu_split import Apdu_splitter, apdu_states
|
from apdu_split import Apdu_splitter, apdu_states
|
||||||
|
|
||||||
def find_dev():
|
|
||||||
dev = usb.core.find(idVendor=0x03eb, idProduct=0x6004)
|
|
||||||
if dev is None:
|
|
||||||
raise ValueError("Device not found")
|
|
||||||
else:
|
|
||||||
print("Found device")
|
|
||||||
return dev
|
|
||||||
|
|
||||||
def pattern_match(inpt):
|
def pattern_match(inpt):
|
||||||
print("Matching inpt", inpt)
|
print("Matching inpt", inpt)
|
||||||
if (inpt == ATR_SYSMOCOM1) or (inpt == ATR_STRANGE_SIM):
|
if (inpt == ATR_SYSMOCOM1) or (inpt == ATR_STRANGE_SIM):
|
||||||
@@ -64,8 +56,7 @@ def replace(data):
|
|||||||
print("*** Value error! ")
|
print("*** Value error! ")
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def do_mitm(sim_emul=True):
|
def do_mitm(dev, sim_emul=True):
|
||||||
dev = find_dev()
|
|
||||||
if sim_emul == True:
|
if sim_emul == True:
|
||||||
my_class = SmartCardEmulator
|
my_class = SmartCardEmulator
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user