# Path: umap2/apps/emulate.py
# class Umap2EmulationApp(Umap2App):
# 
#     def run(self):
#         self.fuzzer = self.get_fuzzer()
#         self.phy = self.load_phy(self.options['--phy'])
#         self.dev = self.load_device(self.options['--class'], self.phy)
#         try:
#             self.dev.connect()
#             self.dev.run()
#         except KeyboardInterrupt:
#             self.logger.info('user terminated the run')
#         except:
#             self.logger.error('Got exception while connecting/running device')
#             self.logger.error(traceback.format_exc())
#         self.dev.disconnect()
# 
#     def get_fuzzer(self):
#         return None


import os
import time
from kitty.remote.rpc import RpcClient
from umap2.apps.emulate import Umap2EmulationApp
#!/usr/bin/env python
'''
Emulate a USB device to be used for fuzzing

Usage:
    umap2fuzz -P=PHY_INFO -C=DEVICE_CLASS [-q] [--vid=VID] [--pid=PID] [-i=FUZZER_IP] [-p FUZZER_PORT] [-v ...]

Options:
    -P --phy PHY_INFO           physical layer info, see list below
    -C --class DEVICE_CLASS     class of the device or path to python file with device class
    -v --verbose                verbosity level
    -i --fuzzer-ip HOST         hostname or IP of the fuzzer [default: 127.0.0.1]
    -p --fuzzer-port PORT       port of the fuzzer [default: 26007]
    -q --quiet                  quiet mode. only print warning/error messages
    --vid VID                   override vendor ID
    --pid PID                   override product ID

Physical layer:
    fd:<serial_port>        use facedancer connected to given serial port
    gadgetfs                use gadgetfs (requires mounting of gadgetfs beforehand)

Examples:
    emulate disk-on-key:
        umap2fuzz -P fd:/dev/ttyUSB1 -C mass_storage
'''



# Path: umap2/apps/emulate.py
# class Umap2EmulationApp(Umap2App):
# 
#     def run(self):
#         self.fuzzer = self.get_fuzzer()
#         self.phy = self.load_phy(self.options['--phy'])
#         self.dev = self.load_device(self.options['--class'], self.phy)
#         try:
#             self.dev.connect()
#             self.dev.run()
#         except KeyboardInterrupt:
#             self.logger.info('user terminated the run')
#         except:
#             self.logger.error('Got exception while connecting/running device')
#             self.logger.error(traceback.format_exc())
#         self.dev.disconnect()
# 
#     def get_fuzzer(self):
#         return None


# Path: umap2/apps/fuzz.py
import os
import time
from kitty.remote.rpc import RpcClient
from umap2.apps.emulate import Umap2EmulationApp

#!/usr/bin/env python
'''
Emulate a USB device to be used for fuzzing

Usage:
    umap2fuzz -P=PHY_INFO -C=DEVICE_CLASS [-q] [--vid=VID] [--pid=PID] [-i=FUZZER_IP] [-p FUZZER_PORT] [-v ...]

Options:
    -P --phy PHY_INFO           physical layer info, see list below
    -C --class DEVICE_CLASS     class of the device or path to python file with device class
    -v --verbose                verbosity level
    -i --fuzzer-ip HOST         hostname or IP of the fuzzer [default: 127.0.0.1]
    -p --fuzzer-port PORT       port of the fuzzer [default: 26007]
    -q --quiet                  quiet mode. only print warning/error messages
    --vid VID                   override vendor ID
    --pid PID                   override product ID

Physical layer:
    fd:<serial_port>        use facedancer connected to given serial port
    gadgetfs                use gadgetfs (requires mounting of gadgetfs beforehand)

Examples:
    emulate disk-on-key:
        umap2fuzz -P fd:/dev/ttyUSB1 -C mass_storage
'''



class Umap2FuzzApp(Umap2EmulationApp):