# Path: usbscapy.py
# class usb_string_descriptor(Packet):
#     name = "USB_String_Descriptor"
#     fields_desc = [ByteField("bLength", 0),
#                    ByteField("bDescriptorType", 0),
#                    FieldListField("UnicodeData", 0x00, XLEShortField("Char", 1), count_from=lambda p: p.bLength)
#     ]


from usbscapy import usb_string_descriptor
"""
    vUSBf: A KVM/QEMU based USB-fuzzing framework.
    Copyright (C) 2015  Sergej Schumilo, OpenSource Security Ralf Spenneberg
    This file is part of vUSBf.

    See the file LICENSE for copying permission.
"""


class fuzzer(object):
    def __init__(self, test):
        self.test = test
        self.string_descriptor = None

    def set_descriptor(self, descriptor):
        self.descriptor = descriptor

    def set_string_descriptor(self, string_descriptor):
        self.string_descriptor = string_descriptor

    def get_descriptor(self):
        return self.descriptor

    def get_string_descriptor(self):
        # if self.string_descriptor is None:
        min_d = usb_string_descriptor('\x04\x03\x09\01')

# Path: usbscapy.py
# class usb_string_descriptor(Packet):
#     name = "USB_String_Descriptor"
#     fields_desc = [ByteField("bLength", 0),
#                    ByteField("bDescriptorType", 0),
#                    FieldListField("UnicodeData", 0x00, XLEShortField("Char", 1), count_from=lambda p: p.bLength)
#     ]


# Path: fuzzer.py
from usbscapy import usb_string_descriptor

"""
    vUSBf: A KVM/QEMU based USB-fuzzing framework.
    Copyright (C) 2015  Sergej Schumilo, OpenSource Security Ralf Spenneberg
    This file is part of vUSBf.

    See the file LICENSE for copying permission.
"""


class fuzzer(object):
    def __init__(self, test):
        self.test = test
        self.string_descriptor = None

    def set_descriptor(self, descriptor):
        self.descriptor = descriptor

    def set_string_descriptor(self, string_descriptor):
        self.string_descriptor = string_descriptor

    def get_descriptor(self):
        return self.descriptor

    def get_string_descriptor(self):
        # if self.string_descriptor is None:
        min_d = usb_string_descriptor('\x04\x03\x09\01')

        max_d = usb_string_descriptor(