def __init__(self, verbose=0):
		self.verbose = verbose
		usbproxy.init()
		self.usbproxy_dev = USBProxyDevice(self)
		deviceproxy.init(self.usbproxy_dev)
		self.x = usbproxy.register_deviceproxy(
			connect=deviceproxy.connect,
			disconnect=deviceproxy.disconnect,
			control_request=deviceproxy.control_req,
			send_data=deviceproxy.send_data,
			receive_data=deviceproxy.receive_data
			)
		
		usbproxy.lib.enable_logging()
		usbproxy.lib.print_config()
		usbproxy.lib.load_plugins()
Example #2
0
                    pkt[0] = mod

            for i in range(len(pkt)):
                dataptr[i] = c_ubyte(pkt[i])
            p_length[0] = len(pkt)

    def get_interface(self, p_ctrl_req, p_nbytes, dataptr, timeout):
        print("USB_REQ_GET_INTERFACE")
        setup_packet = p_ctrl_req[0]
        p_nbytes[0] = 1
        if setup_packet.bRequestType & deviceproxy.USB_DIR_IN:
            dataptr[0] = c_ubyte(0)


if __name__ == "__main__":
    usbproxy.init()
    device = Keyboard(device_desc, config_desc)
    device.set_text("Shmoocon")
    deviceproxy.init(device)
    x = usbproxy.register_deviceproxy(
        connect=deviceproxy.connect,
        control_request=deviceproxy.control_req,
        send_data=deviceproxy.send_data,
        receive_data=deviceproxy.receive_data,
    )

    usbproxy.lib.enable_logging()
    usbproxy.lib.print_config()
    usbproxy.lib.load_plugins()
    usbproxy.run()