import deviceproxy callback_strings = [None, 'ubertooth', 'bt_rxtx', '0001'] device_desc = [ 18, 1, 0x00, 0x02, 0xff, 0x00, 0x00, 64, 0x50, 0x1d, 0x02, 0x60, 0x00, 0x01, 0x00, 0x00, 0x00, 1 #0x01, 0x01, 0x02, 0x03, 1 ] config_desc = [ 9, 2, 32, 0, 1, 1, 0, 0x80, 0x32, 9, 4, 0, 0, 2, 0xff, 0, 0, 0, 7, 5, 0x82, 2, 0x40, 0x00, 0, 7, 5, 0x05, 2, 0x40, 0x00, 0 ] class Ubertooth(deviceproxy.DeviceProxy): pass if __name__ == '__main__': usbproxy.init() device = Ubertooth(device_desc, config_desc) deviceproxy.init(device) x = usbproxy.register_deviceproxy(connect=deviceproxy.connect, control_request=deviceproxy.control_req) usbproxy.lib.print_config() usbproxy.lib.load_plugins() usbproxy.run()
def service_irqs(self): usbproxy.run()
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()