Last active
October 30, 2024 18:00
-
-
Save carlossless/e1316206bad4674d28db3ebb86bfd2ca to your computer and use it in GitHub Desktop.
A shallow mock of sinolink's USB descriptors using facedancer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from facedancer import main | |
from facedancer import * | |
from facedancer.classes import USBDeviceClass | |
@use_inner_classes_automatically | |
class Sinolink(USBDevice): | |
device_class : int = 0xff | |
device_subclass : int = 0xff | |
protocol_revision_number : int = 0xff | |
max_packet_size_ep0 : int = 64 | |
vendor_id : int = 0x258a | |
product_id : int = 0x5007 | |
manufacturer_string : str = "SinoWealth" | |
product_string : str = "SinoLink" | |
serial_number_string : str = None | |
supported_languages : tuple = (LanguageIDs.ENGLISH_US,) | |
device_revision : int = 0x0001 | |
usb_spec_version : int = 0x0101 | |
class SinolinkConfiguration(USBConfiguration): | |
configuration_number : int = 1 | |
configuration_string : str = None | |
self_powered : bool = True | |
supports_remote_wakeup : bool = False | |
max_power : int = 500 | |
class SinolinkInterface(USBInterface): | |
number : int = 0 | |
class_number : int = USBDeviceClass.VENDOR_SPECIFIC | |
subclass_number : int = 0 | |
protocol_number : int = 0xff | |
interface_string : str = None | |
class SinolinkInEndpoint(USBEndpoint): | |
number : int = 1 | |
direction : USBDirection = USBDirection.IN | |
transfer_type : USBTransferType = USBTransferType.BULK | |
max_packet_size : int = 64 | |
interval : int = 0 | |
class SinolinkOutEndpoint(USBEndpoint): | |
number : int = 2 | |
direction : USBDirection = USBDirection.OUT | |
transfer_type : USBTransferType = USBTransferType.BULK | |
max_packet_size : int = 64 | |
interval : int = 0 | |
if __name__ == "__main__": | |
main(Sinolink()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment