facedancer package
Subpackages
- facedancer.backends package
- Submodules
- facedancer.backends.MAXUSBApp module
- facedancer.backends.base module
- facedancer.backends.goodfet module
- facedancer.backends.greatdancer module
- facedancer.backends.greathost module
- facedancer.backends.hydradancer module
- facedancer.backends.libusbhost module
- facedancer.backends.moondancer module
- facedancer.backends.raspdancer module
- Module contents
- Submodules
- facedancer.classes package
- Subpackages
- Module contents
USBDeviceClassUSBDeviceClass.APPLICATION_SPECIFICUSBDeviceClass.AUDIOUSBDeviceClass.AUDIO_VIDEOUSBDeviceClass.BILLBOARDUSBDeviceClass.CDC_DATAUSBDeviceClass.COMMUNICATIONSUSBDeviceClass.COMPOSITEUSBDeviceClass.CONTENT_SECURITYUSBDeviceClass.DIAGNOSTICUSBDeviceClass.HIDUSBDeviceClass.HUBUSBDeviceClass.IMAGEUSBDeviceClass.MASS_STORAGEUSBDeviceClass.MISCELLANEOUSUSBDeviceClass.PERSONAL_HEALTHCAREUSBDeviceClass.PHYSICALUSBDeviceClass.PRINTERUSBDeviceClass.SMART_CARDUSBDeviceClass.TYPE_C_BRIDGEUSBDeviceClass.VENDOR_SPECIFICUSBDeviceClass.VIDEOUSBDeviceClass.WIRELESS_CONTROLLER
- facedancer.devices package
- facedancer.filters package
Submodules
- facedancer.configuration module
USBConfigurationUSBConfiguration.DESCRIPTOR_SIZE_BYTESUSBConfiguration.DESCRIPTOR_TYPE_NUMBERUSBConfiguration.add_interface()USBConfiguration.attributesUSBConfiguration.configuration_stringUSBConfiguration.from_binary_descriptor()USBConfiguration.generate_code()USBConfiguration.get_descriptor()USBConfiguration.get_device()USBConfiguration.get_endpoint()USBConfiguration.get_identifier()USBConfiguration.get_interfaces()USBConfiguration.handle_buffer_empty()USBConfiguration.handle_data_received()USBConfiguration.handle_data_requested()USBConfiguration.interfacesUSBConfiguration.max_powerUSBConfiguration.numberUSBConfiguration.parentUSBConfiguration.self_poweredUSBConfiguration.supports_remote_wakeup
- facedancer.core module
FacedancerAppFacedancerBasicSchedulerFacedancerUSBApp()FacedancerUSBHostFacedancerUSBHost.ENDPOINT_DIRECTION_INFacedancerUSBHost.ENDPOINT_DIRECTION_OUTFacedancerUSBHost.ENDPOINT_TYPE_CONTROLFacedancerUSBHost.PID_INFacedancerUSBHost.PID_OUTFacedancerUSBHost.PID_SETUPFacedancerUSBHost.REQUEST_RECIPIENT_DEVICEFacedancerUSBHost.REQUEST_RECIPIENT_ENDPOINTFacedancerUSBHost.REQUEST_RECIPIENT_INTERFACEFacedancerUSBHost.REQUEST_RECIPIENT_OTHERFacedancerUSBHost.REQUEST_TYPE_CLASSFacedancerUSBHost.REQUEST_TYPE_RESERVEDFacedancerUSBHost.REQUEST_TYPE_STANDARDFacedancerUSBHost.REQUEST_TYPE_VENDORFacedancerUSBHost.STANDARD_REQUEST_GET_DESCRIPTORFacedancerUSBHost.STANDARD_REQUEST_GET_STATUSFacedancerUSBHost.STANDARD_REQUEST_SET_ADDRESSFacedancerUSBHost.STANDARD_REQUEST_SET_CONFIGURATIONFacedancerUSBHost.apply_configuration()FacedancerUSBHost.appropriate_for_environment()FacedancerUSBHost.autodetect()FacedancerUSBHost.control_request_in()FacedancerUSBHost.control_request_out()FacedancerUSBHost.get_configuration_descriptor()FacedancerUSBHost.get_descriptor()FacedancerUSBHost.get_device_descriptor()FacedancerUSBHost.handle_events()FacedancerUSBHost.initialize_device()FacedancerUSBHost.read_ep0_max_packet_size()FacedancerUSBHost.set_address()FacedancerUSBHost.set_configuration()
FacedancerUSBHostApp()
- facedancer.descriptor module
StringDescriptorManagerStringRefUSBClassDescriptorUSBDescribableUSBDescriptorUSBDescriptorTypeNumberUSBDescriptorTypeNumber.CONFIGURATIONUSBDescriptorTypeNumber.DEVICEUSBDescriptorTypeNumber.DEVICE_QUALIFIERUSBDescriptorTypeNumber.ENDPOINTUSBDescriptorTypeNumber.HIDUSBDescriptorTypeNumber.INTERFACEUSBDescriptorTypeNumber.INTERFACE_POWERUSBDescriptorTypeNumber.OTHER_SPEED_CONFIGURATIONUSBDescriptorTypeNumber.REPORTUSBDescriptorTypeNumber.STRING
USBStringDescriptorinclude_in_config()requestable()
- facedancer.device module
USBBaseDeviceUSBBaseDevice.DESCRIPTOR_LENGTHUSBBaseDevice.DESCRIPTOR_TYPE_NUMBERUSBBaseDevice.__post_init__()USBBaseDevice.add_configuration()USBBaseDevice.add_descriptor()USBBaseDevice.backendUSBBaseDevice.clear_halt()USBBaseDevice.configurationsUSBBaseDevice.connect()USBBaseDevice.control_send()USBBaseDevice.create_request()USBBaseDevice.device_classUSBBaseDevice.device_revisionUSBBaseDevice.device_speedUSBBaseDevice.device_subclassUSBBaseDevice.disconnect()USBBaseDevice.emulate()USBBaseDevice.from_binary_descriptor()USBBaseDevice.get_configuration_descriptor()USBBaseDevice.get_descriptor()USBBaseDevice.get_endpoint()USBBaseDevice.get_string_descriptor()USBBaseDevice.handle_buffer_available()USBBaseDevice.handle_buffer_empty()USBBaseDevice.handle_bus_reset()USBBaseDevice.handle_data_available()USBBaseDevice.handle_data_received()USBBaseDevice.handle_data_requested()USBBaseDevice.handle_generic_get_descriptor_request()USBBaseDevice.handle_get_supported_languages_descriptor()USBBaseDevice.handle_nak()USBBaseDevice.handle_request()USBBaseDevice.handle_unexpected_data_received()USBBaseDevice.handle_unexpected_data_requested()USBBaseDevice.manufacturer_stringUSBBaseDevice.max_packet_size_ep0USBBaseDevice.nameUSBBaseDevice.print_suggested_additions()USBBaseDevice.product_idUSBBaseDevice.product_stringUSBBaseDevice.protocol_revision_numberUSBBaseDevice.requestable_descriptorsUSBBaseDevice.run()USBBaseDevice.run_with()USBBaseDevice.send()USBBaseDevice.serial_number_stringUSBBaseDevice.set_address()USBBaseDevice.stall()USBBaseDevice.supported_languagesUSBBaseDevice.usb_spec_versionUSBBaseDevice.vendor_id
USBDeviceUSBDevice.configurationsUSBDevice.generate_code()USBDevice.handle_clear_feature_requestUSBDevice.handle_get_configuration_requestUSBDevice.handle_get_descriptor_requestUSBDevice.handle_get_status_requestUSBDevice.handle_set_address_requestUSBDevice.handle_set_configuration_requestUSBDevice.handle_set_descriptor_requestUSBDevice.handle_set_feature_requestUSBDevice.handle_synch_frame_requestUSBDevice.manufacturer_stringUSBDevice.product_stringUSBDevice.requestable_descriptorsUSBDevice.serial_number_string
- facedancer.endpoint module
USBEndpointUSBEndpoint.DESCRIPTOR_TYPE_NUMBERUSBEndpoint.add_descriptor()USBEndpoint.addressUSBEndpoint.address_for_number()USBEndpoint.attached_descriptorsUSBEndpoint.attributesUSBEndpoint.directionUSBEndpoint.extra_bytesUSBEndpoint.from_binary_descriptor()USBEndpoint.generate_code()USBEndpoint.get_address()USBEndpoint.get_descriptor()USBEndpoint.get_device()USBEndpoint.get_identifier()USBEndpoint.handle_buffer_empty()USBEndpoint.handle_clear_feature_requestUSBEndpoint.handle_data_received()USBEndpoint.handle_data_requested()USBEndpoint.intervalUSBEndpoint.matches_identifier()USBEndpoint.max_packet_sizeUSBEndpoint.numberUSBEndpoint.parentUSBEndpoint.requestable_descriptorsUSBEndpoint.send()USBEndpoint.synchronization_typeUSBEndpoint.transfer_typeUSBEndpoint.usage_type
- facedancer.errors module
- facedancer.interface module
USBInterfaceUSBInterface.DESCRIPTOR_TYPE_NUMBERUSBInterface.add_descriptor()USBInterface.add_endpoint()USBInterface.alternateUSBInterface.attached_descriptorsUSBInterface.class_numberUSBInterface.endpointsUSBInterface.from_binary_descriptor()USBInterface.generate_code()USBInterface.get_descriptor()USBInterface.get_device()USBInterface.get_endpoint()USBInterface.get_endpoints()USBInterface.get_identifier()USBInterface.handle_buffer_empty()USBInterface.handle_data_received()USBInterface.handle_data_requested()USBInterface.handle_get_descriptor_requestUSBInterface.handle_get_interface_requestUSBInterface.handle_set_interface_requestUSBInterface.has_endpoint()USBInterface.interface_stringUSBInterface.matches_identifier()USBInterface.nameUSBInterface.numberUSBInterface.parentUSBInterface.protocol_numberUSBInterface.requestable_descriptorsUSBInterface.subclass_number
- facedancer.logging module
- facedancer.magic module
- facedancer.proxy module
LibUSB1DeviceUSBProxyDeviceUSBProxyDevice.__init__()USBProxyDevice.add_filter()USBProxyDevice.configured()USBProxyDevice.connect()USBProxyDevice.filter_listUSBProxyDevice.handle_bus_reset()USBProxyDevice.handle_data_available()USBProxyDevice.handle_get_configuration_request()USBProxyDevice.handle_get_descriptor_request()USBProxyDevice.handle_nak()USBProxyDevice.handle_request()USBProxyDevice.interface_changed()USBProxyDevice.name
- facedancer.request module
ControlRequestHandlerUSBControlRequestUSBControlRequest.ack()USBControlRequest.acknowledge()USBControlRequest.dataUSBControlRequest.deviceUSBControlRequest.directionUSBControlRequest.from_raw_bytes()USBControlRequest.get_direction()USBControlRequest.get_recipient()USBControlRequest.get_type()USBControlRequest.indexUSBControlRequest.index_highUSBControlRequest.index_lowUSBControlRequest.lengthUSBControlRequest.numberUSBControlRequest.raw()USBControlRequest.recipientUSBControlRequest.reply()USBControlRequest.requestUSBControlRequest.request_typeUSBControlRequest.stall()USBControlRequest.typeUSBControlRequest.valueUSBControlRequest.value_highUSBControlRequest.value_low
USBRequestHandlerclass_request_handler()control_request_handler()get_request_handler_methods()reserved_request_handler()standard_request_handler()to_any_endpoint()to_any_interface()to_device()to_other()to_this_endpoint()to_this_interface()vendor_request_handler()
- facedancer.types module
DescriptorTypesDeviceSpeedLanguageIDsLanguageIDs.AFRIKAANSLanguageIDs.ALBANIANLanguageIDs.ARABIC_ALGERIALanguageIDs.ARABIC_BAHRAINLanguageIDs.ARABIC_EGYPTLanguageIDs.ARABIC_IRAQLanguageIDs.ARABIC_JORDANLanguageIDs.ARABIC_KUWAITLanguageIDs.ARABIC_LEBANONLanguageIDs.ARABIC_LIBYALanguageIDs.ARABIC_MOROCCOLanguageIDs.ARABIC_OMANLanguageIDs.ARABIC_QATARLanguageIDs.ARABIC_SAUDI_ARABIALanguageIDs.ARABIC_SYRIALanguageIDs.ARABIC_TUNISIALanguageIDs.ARABIC_UAELanguageIDs.ARABIC_YEMENLanguageIDs.ARMENIANLanguageIDs.ASSAMESELanguageIDs.AZERI_CYRILLICLanguageIDs.AZERI_LATINLanguageIDs.BASQUELanguageIDs.BELARUSSIANLanguageIDs.BENGALILanguageIDs.BULGARIANLanguageIDs.BURMESELanguageIDs.CATALANLanguageIDs.CHINESE_HONG_KONGLanguageIDs.CHINESE_MACAU_SARLanguageIDs.CHINESE_PRCLanguageIDs.CHINESE_SINGAPORELanguageIDs.CHINESE_TAIWANLanguageIDs.CROATIANLanguageIDs.CZECHLanguageIDs.DANISHLanguageIDs.DUTCH_BELGIUMLanguageIDs.DUTCH_NETHERLANDSLanguageIDs.ENGLISH_AUSTRALIANLanguageIDs.ENGLISH_BELIZELanguageIDs.ENGLISH_CANADIANLanguageIDs.ENGLISH_CARIBBEANLanguageIDs.ENGLISH_IRELANDLanguageIDs.ENGLISH_JAMAICALanguageIDs.ENGLISH_NEW_ZEALANDLanguageIDs.ENGLISH_PHILIPPINESLanguageIDs.ENGLISH_SOUTH_AFRICALanguageIDs.ENGLISH_TRINIDADLanguageIDs.ENGLISH_UNITED_KINGDOMLanguageIDs.ENGLISH_USLanguageIDs.ENGLISH_ZIMBABWELanguageIDs.ESTONIANLanguageIDs.FAEROESELanguageIDs.FARSILanguageIDs.FINNISHLanguageIDs.FRENCH_BELGIANLanguageIDs.FRENCH_CANADIANLanguageIDs.FRENCH_LUXEMBOURGLanguageIDs.FRENCH_MONACOLanguageIDs.FRENCH_STANDARDLanguageIDs.FRENCH_SWITZERLANDLanguageIDs.GEORGIANLanguageIDs.GERMAN_AUSTRIALanguageIDs.GERMAN_LIECHTENSTEINLanguageIDs.GERMAN_LUXEMBOURGLanguageIDs.GERMAN_STANDARDLanguageIDs.GERMAN_SWITZERLANDLanguageIDs.GREEKLanguageIDs.GUJARATILanguageIDs.HEBREWLanguageIDs.HID_USAGE_DATA_DESCRIPTORLanguageIDs.HID_VENDOR_DEFINED_1LanguageIDs.HID_VENDOR_DEFINED_2LanguageIDs.HID_VENDOR_DEFINED_3LanguageIDs.HID_VENDOR_DEFINED_4LanguageIDs.HINDILanguageIDs.HUNGARIANLanguageIDs.ICELANDICLanguageIDs.INDONESIANLanguageIDs.ITALIAN_STANDARDLanguageIDs.ITALIAN_SWITZERLANDLanguageIDs.JAPANESELanguageIDs.KANNADALanguageIDs.KASHMIRI_INDIALanguageIDs.KAZAKHLanguageIDs.KONKANILanguageIDs.KOREANLanguageIDs.KOREAN_JOHABLanguageIDs.LATVIANLanguageIDs.LITHUANIANLanguageIDs.LITHUANIAN_CLASSICLanguageIDs.MACEDONIANLanguageIDs.MALAYALAMLanguageIDs.MALAY_BRUNEI_DARUSSALAMLanguageIDs.MALAY_MALAYSIANLanguageIDs.MANIPURILanguageIDs.MARATHILanguageIDs.NEPALI_INDIALanguageIDs.NORWEGIAN_BOKMALLanguageIDs.NORWEGIAN_NYNORSKLanguageIDs.ORIYALanguageIDs.POLISHLanguageIDs.PORTUGUESE_BRAZILLanguageIDs.PORTUGUESE_STANDARDLanguageIDs.PUNJABILanguageIDs.ROMANIANLanguageIDs.RUSSIANLanguageIDs.SANSKRITLanguageIDs.SERBIAN_CYRILLICLanguageIDs.SERBIAN_LATINLanguageIDs.SINDHILanguageIDs.SLOVAKLanguageIDs.SLOVENIANLanguageIDs.SPANISH_ARGENTINALanguageIDs.SPANISH_BOLIVIALanguageIDs.SPANISH_CHILELanguageIDs.SPANISH_COLOMBIALanguageIDs.SPANISH_COSTA_RICALanguageIDs.SPANISH_DOMINICAN_REPUBLICLanguageIDs.SPANISH_ECUADORLanguageIDs.SPANISH_EL_SALVADORLanguageIDs.SPANISH_GUATEMALALanguageIDs.SPANISH_HONDURASLanguageIDs.SPANISH_MEXICANLanguageIDs.SPANISH_MODERN_SORTLanguageIDs.SPANISH_NICARAGUALanguageIDs.SPANISH_PANAMALanguageIDs.SPANISH_PARAGUAYLanguageIDs.SPANISH_PERULanguageIDs.SPANISH_PUERTO_RICOLanguageIDs.SPANISH_TRADITIONAL_SORTLanguageIDs.SPANISH_URUGUAYLanguageIDs.SPANISH_VENEZUELALanguageIDs.SUTULanguageIDs.SWAHILI_KENYALanguageIDs.SWEDISHLanguageIDs.SWEDISH_FINLANDLanguageIDs.TAMILLanguageIDs.TATAR_TATARSTANLanguageIDs.TELUGULanguageIDs.THAILanguageIDs.TURKISHLanguageIDs.UKRAINIANLanguageIDs.URDU_INDIALanguageIDs.URDU_PAKISTANLanguageIDs.UZBEK_CYRILLICLanguageIDs.UZBEK_LATINLanguageIDs.VIETNAMESE
USBUSB.desc_type_configurationUSB.desc_type_deviceUSB.desc_type_device_qualifierUSB.desc_type_endpointUSB.desc_type_hidUSB.desc_type_interfaceUSB.desc_type_interface_powerUSB.desc_type_other_speed_configurationUSB.desc_type_reportUSB.desc_type_stringUSB.feature_device_remote_wakeupUSB.feature_endpoint_haltUSB.feature_test_modeUSB.if_class_to_desc_typeUSB.interface_class_to_descriptor_type()USB.request_direction_device_to_hostUSB.request_direction_host_to_deviceUSB.request_recipient_deviceUSB.request_recipient_endpointUSB.request_recipient_interfaceUSB.request_recipient_otherUSB.request_type_classUSB.request_type_standardUSB.request_type_vendorUSB.state_addressUSB.state_attachedUSB.state_configuredUSB.state_defaultUSB.state_detachedUSB.state_poweredUSB.state_suspended
USBDirectionUSBPIDCategoryUSBPacketIDUSBPacketID.ACKUSBPacketID.DATA0USBPacketID.DATA1USBPacketID.DATA2USBPacketID.ERRUSBPacketID.INUSBPacketID.MDATAUSBPacketID.NAKUSBPacketID.NYETUSBPacketID.OUTUSBPacketID.PID_CORE_MASKUSBPacketID.PID_INVALIDUSBPacketID.PINGUSBPacketID.PREUSBPacketID.SETUPUSBPacketID.SOFUSBPacketID.SPLITUSBPacketID.STALLUSBPacketID.category()USBPacketID.direction()USBPacketID.from_byte()USBPacketID.from_int()USBPacketID.from_name()USBPacketID.is_data()USBPacketID.is_handshake()USBPacketID.is_invalid()USBPacketID.is_token()USBPacketID.parse()USBPacketID.summarize()
USBRequestRecipientUSBRequestTypeUSBStandardRequestsUSBStandardRequests.CLEAR_FEATUREUSBStandardRequests.GET_CONFIGURATIONUSBStandardRequests.GET_DESCRIPTORUSBStandardRequests.GET_INTERFACEUSBStandardRequests.GET_STATUSUSBStandardRequests.SET_ADDRESSUSBStandardRequests.SET_CONFIGURATIONUSBStandardRequests.SET_DESCRIPTORUSBStandardRequests.SET_FEATUREUSBStandardRequests.SET_INTERFACEUSBStandardRequests.SYNCH_FRAME
USBSynchronizationTypeUSBTransferTypeUSBUsageTypeendpoint_number_from_address()
Module contents
- class facedancer.DeviceSpeed(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
IntEnum- FULL = 2
- HIGH = 3
- LOW = 1
- SUPER = 4
- SUPER_PLUS = 5
- UNKNOWN = 0
- class facedancer.LanguageIDs(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
IntEnum- AFRIKAANS = 1078
- ALBANIAN = 1052
- ARABIC_ALGERIA = 5121
- ARABIC_BAHRAIN = 15361
- ARABIC_EGYPT = 3073
- ARABIC_IRAQ = 2049
- ARABIC_JORDAN = 11265
- ARABIC_KUWAIT = 13313
- ARABIC_LEBANON = 12289
- ARABIC_LIBYA = 4097
- ARABIC_MOROCCO = 6145
- ARABIC_OMAN = 8193
- ARABIC_QATAR = 16385
- ARABIC_SAUDI_ARABIA = 1025
- ARABIC_SYRIA = 10241
- ARABIC_TUNISIA = 7169
- ARABIC_UAE = 14337
- ARABIC_YEMEN = 9217
- ARMENIAN = 1067
- ASSAMESE = 1101
- AZERI_CYRILLIC = 2092
- AZERI_LATIN = 1068
- BASQUE = 1069
- BELARUSSIAN = 1059
- BENGALI = 1093
- BULGARIAN = 1026
- BURMESE = 1109
- CATALAN = 1027
- CHINESE_HONG_KONG = 3076
- CHINESE_MACAU_SAR = 5124
- CHINESE_PRC = 2052
- CHINESE_SINGAPORE = 4100
- CHINESE_TAIWAN = 1028
- CROATIAN = 1050
- CZECH = 1029
- DANISH = 1030
- DUTCH_BELGIUM = 2067
- DUTCH_NETHERLANDS = 1043
- ENGLISH_AUSTRALIAN = 3081
- ENGLISH_BELIZE = 10249
- ENGLISH_CANADIAN = 4105
- ENGLISH_CARIBBEAN = 9225
- ENGLISH_IRELAND = 6153
- ENGLISH_JAMAICA = 8201
- ENGLISH_NEW_ZEALAND = 5129
- ENGLISH_PHILIPPINES = 13321
- ENGLISH_SOUTH_AFRICA = 7177
- ENGLISH_TRINIDAD = 11273
- ENGLISH_UNITED_KINGDOM = 2057
- ENGLISH_US = 1033
- ENGLISH_ZIMBABWE = 12297
- ESTONIAN = 1061
- FAEROESE = 1080
- FARSI = 1065
- FINNISH = 1035
- FRENCH_BELGIAN = 2060
- FRENCH_CANADIAN = 3084
- FRENCH_LUXEMBOURG = 5132
- FRENCH_MONACO = 6156
- FRENCH_STANDARD = 1036
- FRENCH_SWITZERLAND = 4108
- GEORGIAN = 1079
- GERMAN_AUSTRIA = 3079
- GERMAN_LIECHTENSTEIN = 5127
- GERMAN_LUXEMBOURG = 4103
- GERMAN_STANDARD = 1031
- GERMAN_SWITZERLAND = 2055
- GREEK = 1032
- GUJARATI = 1095
- HEBREW = 1037
- HID_USAGE_DATA_DESCRIPTOR = 1279
- HID_VENDOR_DEFINED_1 = 61695
- HID_VENDOR_DEFINED_2 = 62719
- HID_VENDOR_DEFINED_3 = 63743
- HID_VENDOR_DEFINED_4 = 64767
- HINDI = 1081
- HUNGARIAN = 1038
- ICELANDIC = 1039
- INDONESIAN = 1057
- ITALIAN_STANDARD = 1040
- ITALIAN_SWITZERLAND = 2064
- JAPANESE = 1041
- KANNADA = 1099
- KASHMIRI_INDIA = 2144
- KAZAKH = 1087
- KONKANI = 1111
- KOREAN = 1042
- KOREAN_JOHAB = 2066
- LATVIAN = 1062
- LITHUANIAN = 1063
- LITHUANIAN_CLASSIC = 2087
- MACEDONIAN = 1071
- MALAYALAM = 1100
- MALAY_BRUNEI_DARUSSALAM = 2110
- MALAY_MALAYSIAN = 1086
- MANIPURI = 1112
- MARATHI = 1102
- NEPALI_INDIA = 2145
- NORWEGIAN_BOKMAL = 1044
- NORWEGIAN_NYNORSK = 2068
- ORIYA = 1096
- POLISH = 1045
- PORTUGUESE_BRAZIL = 1046
- PORTUGUESE_STANDARD = 2070
- PUNJABI = 1094
- ROMANIAN = 1048
- RUSSIAN = 1049
- SANSKRIT = 1103
- SERBIAN_CYRILLIC = 3098
- SERBIAN_LATIN = 2074
- SINDHI = 1113
- SLOVAK = 1051
- SLOVENIAN = 1060
- SPANISH_ARGENTINA = 11274
- SPANISH_BOLIVIA = 16394
- SPANISH_CHILE = 13322
- SPANISH_COLOMBIA = 9226
- SPANISH_COSTA_RICA = 5130
- SPANISH_DOMINICAN_REPUBLIC = 7178
- SPANISH_ECUADOR = 12298
- SPANISH_EL_SALVADOR = 17418
- SPANISH_GUATEMALA = 4106
- SPANISH_HONDURAS = 18442
- SPANISH_MEXICAN = 2058
- SPANISH_MODERN_SORT = 3082
- SPANISH_NICARAGUA = 19466
- SPANISH_PANAMA = 6154
- SPANISH_PARAGUAY = 15370
- SPANISH_PERU = 10250
- SPANISH_PUERTO_RICO = 20490
- SPANISH_TRADITIONAL_SORT = 1034
- SPANISH_URUGUAY = 14346
- SPANISH_VENEZUELA = 8202
- SUTU = 1072
- SWAHILI_KENYA = 1089
- SWEDISH = 1053
- SWEDISH_FINLAND = 2077
- TAMIL = 1097
- TATAR_TATARSTAN = 1092
- TELUGU = 1098
- THAI = 1054
- TURKISH = 1055
- UKRAINIAN = 1058
- URDU_INDIA = 2080
- URDU_PAKISTAN = 1056
- UZBEK_CYRILLIC = 2115
- UZBEK_LATIN = 1091
- VIETNAMESE = 1066
- class facedancer.StringRef(index: int = None, string: str = None)[source]
Bases:
objectClass representing a reference to a USB string descriptor.
- class facedancer.USBClassDescriptor(*, raw: bytes, type_number: int = None, number: int = None, parent: USBDescribable = None, include_in_config: bool = True)[source]
Bases:
USBDescriptorClass for arbitrary USB Class descriptors.
- include_in_config: bool = True
- class facedancer.USBConfiguration(*, number: int = 1, configuration_string: ~facedancer.descriptor.StringRef = None, max_power: int = 500, self_powered: bool = True, supports_remote_wakeup: bool = True, parent: ~facedancer.descriptor.USBDescribable = None, interfaces: ~facedancer.interface.USBInterface = <factory>)[source]
Bases:
USBDescribable,AutoInstantiable,USBRequestHandlerClass representing a USBDevice’s configuration.
- Fields:
- number:
The configuration’s number; one-indexed.
- configuration_string
A string describing the configuration; or None if not provided.
- max_power:
The maximum power expected to be drawn by the device when using this interface, in mA. Typically 500mA, for maximum possible.
- supports_remote_wakeup:
True iff this device should be able to wake the host from suspend.
- DESCRIPTOR_SIZE_BYTES = 9
- DESCRIPTOR_TYPE_NUMBER = 2
- add_interface(interface: USBInterface)[source]
Adds an interface to the configuration.
- property attributes
Retrives the “attributes” composite word.
- classmethod from_binary_descriptor(data, strings={})[source]
Generates a new USBConfiguration object from a configuration descriptor, handling any attached subordinate descriptors.
- Parameters:
data – The raw bytes for the descriptor to be parsed.
- get_descriptor() bytes[source]
Returns this configuration’s configuration descriptor, including subordinates.
- get_endpoint(number: int, direction: USBDirection) USBEndpoint[source]
Attempts to find an endpoint with the given number + direction.
- Parameters:
number – The endpoint number to look for.
direction – Whether to look for an IN or OUT endpoint.
- get_identifier() int[source]
Returns a unique integer identifier for this object.
This is usually the index or address of the relevant USB object.
- get_interfaces() Iterable[USBInterface][source]
Returns an iterable over all interfaces on the provided device.
- handle_buffer_empty(endpoint: USBEndpoint)[source]
Handler called when a given endpoint first has an empty buffer.
Often, an empty buffer indicates an opportunity to queue data for sending (‘prime an endpoint’), but doesn’t necessarily mean that the host is planning on reading the data.
This function is called only once per buffer.
- handle_data_received(endpoint: USBEndpoint, data: bytes)[source]
Handler for receipt of non-control request data.
Typically, this method will delegate any data received to the appropriate configuration/interface/endpoint. If overridden, the overriding function will receive all data; and can delegate it by calling the .handle_data_received method on self.configuration.
- Parameters:
endpoint – The endpoint on which the data was received.
data – The raw bytes received on the relevant endpoint.
- handle_data_requested(endpoint: USBEndpoint)[source]
Handler called when the host requests data on a non-control endpoint.
Typically, this method will delegate the request to the appropriate interface+endpoint. If overridden, the overriding function will receive all data.
- Parameters:
endpoint – The endpoint on which the host requested data.
- interfaces: USBInterface
- max_power: int = 500
- number: int = 1
- parent: USBDescribable = None
- self_powered: bool = True
- supports_remote_wakeup: bool = True
- class facedancer.USBControlRequest(direction: USBDirection, type: USBRequestType, recipient: USBRequestRecipient, number: int, value: int, index: int, length: int, data: bytes = b'', device: USBDescribable = None)[source]
Bases:
objectClass encapsulating a USB control request.
TODO: document parameters
- ack(*, blocking: bool = False)[source]
Acknowledge the given request without replying.
Convenience alias for .acknowledge().
- Parameters:
blocking – If true, the relevant control request will complete before returning.
- acknowledge(*, blocking: bool = False)[source]
Acknowledge the given request without replying.
- Parameters:
blocking – If true, the relevant control request will complete before returning.
- data: bytes = b''
- device: USBDescribable = None
- direction: USBDirection
- classmethod from_raw_bytes(raw_bytes: bytes, *, device=None)[source]
Creates a request object from a sequence of raw bytes.
- Parameters:
raw_bytes – The raw bytes to create the object from.
device – The USBDevice to associate with the given request. Optional, but necessary to use the .reply() / .acknowledge() methods.
- get_direction() USBDirection[source]
- get_recipient() USBRequestRecipient[source]
- get_type() USBRequestType[source]
- index: int
- property index_high: int
- property index_low: int
- length: int
- number: int
- recipient: USBRequestRecipient
- property request: int
- property request_type: int
Fetches the whole request_type byte.
- stall()[source]
Stalls the associated device’s control request.
Used to indicate that a given request isn’t supported; or isn’t supported with the provided arguments.
- type: USBRequestType
- value: int
- property value_high: int
- property value_low: int
- class facedancer.USBDescriptor(*, raw: bytes, type_number: int = None, number: int = None, parent: USBDescribable = None, include_in_config: bool = False)[source]
Bases:
USBDescribable,AutoInstantiableClass for arbitrary USB descriptors; minimal concrete implementation of USBDescribable.
- classmethod from_binary_descriptor(data, strings={})[source]
Attempts to create a USBDescriptor subclass from the given raw descriptor data.
- get_identifier()[source]
Returns a unique integer identifier for this object.
This is usually the index or address of the relevant USB object.
- include_in_config: bool = False
- number: int = None
Parent object which this descriptor is associated with.
- parent: USBDescribable = None
Whether this descriptor should be included in a GET_CONFIGURATION response.
- raw: bytes
The bDescriptorType of the descriptor.
- type_number: int = None
Number to request this descriptor with a GET_DESCRIPTOR request.
- class facedancer.USBDescriptorTypeNumber(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
IntEnum- CONFIGURATION = 2
- DEVICE = 1
- DEVICE_QUALIFIER = 6
- ENDPOINT = 5
- HID = 33
- INTERFACE = 4
- INTERFACE_POWER = 8
- OTHER_SPEED_CONFIGURATION = 7
- REPORT = 34
- STRING = 3
- class facedancer.USBDevice(*, name: str = 'generic device', device_class: int = 0, device_subclass: int = 0, protocol_revision_number: int = 0, max_packet_size_ep0: int = 64, vendor_id: int = 24843, product_id: int = 18003, manufacturer_string: ~facedancer.descriptor.StringRef = <factory>, product_string: ~facedancer.descriptor.StringRef = <factory>, serial_number_string: ~facedancer.descriptor.StringRef = <factory>, supported_languages: tuple = (LanguageIDs.ENGLISH_US,), device_revision: int = 0, usb_spec_version: int = 512, device_speed: ~facedancer.types.DeviceSpeed = None, requestable_descriptors: ~typing.Dict[tuple[int, int], bytes | callable] = <factory>, configurations: ~typing.Dict[int, ~facedancer.configuration.USBConfiguration] = <factory>, backend: ~facedancer.core.FacedancerUSBApp = None)[source]
Bases:
USBBaseDeviceClass representing the behavior of a USB device.
This default implementation provides standard request handlers in order to facilitate creating a host-compatible USB device.
These functions can be overloaded to change their behavior. If you want to dramatically change the behavior of these requests, you can opt to use USBBaseDevice, which lacks standard request handling.
- Fields:
- device_class/device_subclass/protocol_revision_number –
The USB descriptor fields that select the class, subclass, and protcol.
- vendor_id, product_id –
The USB vendor and product ID for this device.
- manufacturer_string, product_string, serial_number_string –
Python strings identifying the device to the USB host.
- supported_languages –
A tuple containing all of the language IDs supported by the device.
- device_revision –
Number indicating the hardware revision of this device. Typically BCD.
- usb_spec_revision –
Number indicating the version of the USB specification we adhere to. Typically 0x0200.
- handle_clear_feature_request = <ControlRequestHandler wrapping USBDevice.handle_clear_feature_request at 0x7f80aa9ad640
- handle_get_configuration_request = <ControlRequestHandler wrapping USBDevice.handle_get_configuration_request at 0x7f80aa9ae630
- handle_get_descriptor_request = <ControlRequestHandler wrapping USBDevice.handle_get_descriptor_request at 0x7f80aa9ae0c0
- handle_get_status_request = <ControlRequestHandler wrapping USBDevice.handle_get_status_request at 0x7f80aa9acfe0
- handle_set_address_request = <ControlRequestHandler wrapping USBDevice.handle_set_address_request at 0x7f80aa9adcd0
- handle_set_configuration_request = <ControlRequestHandler wrapping USBDevice.handle_set_configuration_request at 0x7f80aa9ae900
- handle_set_descriptor_request = <ControlRequestHandler wrapping USBDevice.handle_set_descriptor_request at 0x7f80aa9ae390
- handle_set_feature_request = <ControlRequestHandler wrapping USBDevice.handle_set_feature_request at 0x7f80aa9ad850
- handle_synch_frame_request = <ControlRequestHandler wrapping USBDevice.handle_synch_frame_request at 0x7f80aa9aeb70
- class facedancer.USBDirection(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
IntEnumClass representing USB directions.
- IN = 1
- OUT = 0
- classmethod from_endpoint_address(address)[source]
Helper method that extracts the direction from an endpoint address.
- classmethod from_request_type(request_type_int)[source]
Helper method that extracts the direction from a request_type integer.
- class facedancer.USBEndpoint(*, number: int, direction: ~facedancer.types.USBDirection, transfer_type: ~facedancer.types.USBTransferType = USBTransferType.BULK, synchronization_type: ~facedancer.types.USBSynchronizationType = USBSynchronizationType.NONE, usage_type: ~facedancer.types.USBUsageType = USBUsageType.DATA, max_packet_size: int = 64, interval: int = 0, extra_bytes: bytes = b'', attached_descriptors: ~typing.List[~facedancer.descriptor.USBDescriptor] = <factory>, requestable_descriptors: ~typing.Dict[tuple[int, int], ~facedancer.descriptor.USBDescriptor] = <factory>, parent: ~facedancer.descriptor.USBDescribable = None)[source]
Bases:
USBDescribable,AutoInstantiable,USBRequestHandlerClass representing a USBEndpoint object.
- Field:
- number:
The endpoint number (without the direction bit) for this endpoint.
- direction:
A USBDirection constant indicating this endpoint’s direction.
- transfer_type:
A USBTransferType constant indicating the type of communications used.
- max_packet_size:
The maximum packet size for this endpoint.
- interval:
The polling interval, for an INTERRUPT endpoint.
- DESCRIPTOR_TYPE_NUMBER = 5
- add_descriptor(descriptor: USBDescriptor)[source]
Adds the provided descriptor to the endpoint.
- property address
Fetches the address for the given endpoint.
- static address_for_number(endpoint_number: int, direction: USBDirection) int[source]
Computes the endpoint address for a given number + direction.
- attached_descriptors: List[USBDescriptor]
- property attributes
Fetches the attributes for the given endpoint, as a single byte.
- direction: USBDirection
- extra_bytes: bytes = b''
- classmethod from_binary_descriptor(data, strings={})[source]
Creates an endpoint object from a description of that endpoint.
- get_identifier() int[source]
Returns a unique integer identifier for this object.
This is usually the index or address of the relevant USB object.
- handle_clear_feature_request = <ControlRequestHandler wrapping USBEndpoint.handle_clear_feature_request at 0x7f80aa9ac560
- handle_data_received(data: bytes)[source]
Handler for receipt of non-control request data.
- Parameters:
data – The raw bytes received.
- interval: int = 0
- max_packet_size: int = 64
- number: int
- parent: USBDescribable = None
- requestable_descriptors: Dict[tuple[int, int], USBDescriptor]
- send(data: bytes, *, blocking: bool = False)[source]
Sends data on this endpoint. Valid only for IN endpoints.
- Parameters:
data – The data to be sent.
blocking – True if we should block until the backend reports the transmission to be complete.
- synchronization_type: USBSynchronizationType = 0
- transfer_type: USBTransferType = 2
- usage_type: USBUsageType = 0
- class facedancer.USBInterface(*, name: ~facedancer.descriptor.StringRef = <factory>, number: int = 0, alternate: int = 0, class_number: int = 0, subclass_number: int = 0, protocol_number: int = 0, interface_string: str = None, attached_descriptors: ~typing.List[~facedancer.descriptor.USBDescriptor] = <factory>, requestable_descriptors: ~typing.Dict[tuple[int, int], ~facedancer.descriptor.USBDescriptor] = <factory>, endpoints: ~typing.Dict[int, ~facedancer.endpoint.USBEndpoint] = <factory>, parent: ~facedancer.descriptor.USBDescribable = None)[source]
Bases:
USBDescribable,AutoInstantiable,USBRequestHandlerClass representing a USBDevice interface.
- Fields:
- number :
The interface’s index. Zero indexed.
- class_number, subclass_number, protocol_number :
The USB class adhered to on this interface; usually a USBDeviceClass constant.
- interface_string :
A short, descriptive string used to identify the endpoint; or None if not provided.
- DESCRIPTOR_TYPE_NUMBER = 4
- add_descriptor(descriptor: USBDescriptor)[source]
Adds the provided descriptor to the interface.
- add_endpoint(endpoint: USBEndpoint)[source]
Adds the provided endpoint to the interface.
- alternate: int = 0
- attached_descriptors: List[USBDescriptor]
- class_number: int = 0
- endpoints: Dict[int, USBEndpoint]
- classmethod from_binary_descriptor(data, strings={})[source]
Generates an interface object from a descriptor.
- get_descriptor() bytes[source]
Retrieves the given interface’s interface descriptor, with subordinates.
- get_endpoint(endpoint_number: int, direction: USBDirection) USBEndpoint[source]
Attempts to find a subordinate endpoint matching the given number/direction.
- Parameters:
endpoint_number – The endpoint number to search for.
direction – The endpoint direction to be matched.
- Returns:
The matching endpoint; or None if no matching endpoint existed.
- get_identifier()[source]
Returns a unique integer identifier for this object.
This is usually the index or address of the relevant USB object.
- handle_buffer_empty(endpoint: USBEndpoint)[source]
Handler called when a given endpoint first has an empty buffer.
Often, an empty buffer indicates an opportunity to queue data for sending (‘prime an endpoint’), but doesn’t necessarily mean that the host is planning on reading the data.
This function is called only once per buffer.
- handle_data_received(endpoint: USBEndpoint, data: bytes)[source]
Handler for receipt of non-control request data.
Typically, this method will delegate any data received to the appropriate configuration/interface/endpoint. If overridden, the overriding function will receive all data; and can delegate it by calling the .handle_data_received method on self.configuration.
- Parameters:
endpoint_number – The endpoint number on which the data was received.
data – The raw bytes received on the relevant endpoint.
- handle_data_requested(endpoint: USBEndpoint)[source]
Handler called when the host requests data on a non-control endpoint.
Typically, this method will delegate the request to the appropriate interface+endpoint. If overridden, the overriding function will receive all data.
- Parameters:
endpoint_number – The endpoint number on which the host requested data.
- handle_get_descriptor_request = <ControlRequestHandler wrapping USBInterface.handle_get_descriptor_request at 0x7f80aa9ac3b0
- handle_get_interface_request = <ControlRequestHandler wrapping USBInterface.handle_get_interface_request at 0x7f80aa9acce0
- handle_set_interface_request = <ControlRequestHandler wrapping USBInterface.handle_set_interface_request at 0x7f80aa9aca70
- has_endpoint(endpoint_number: int, direction: USBDirection) USBEndpoint[source]
Returns true iff we have matching subordinate endpoint.
- Parameters:
endpoint_number – The endpoint number to search for.
direction – The endpoint direction to be matched.
- interface_string: str = None
- number: int = 0
- parent: USBDescribable = None
- protocol_number: int = 0
- requestable_descriptors: Dict[tuple[int, int], USBDescriptor]
- subclass_number: int = 0
- class facedancer.USBRequestRecipient(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
IntEnumEnumeration that describes each ‘recipient’ of a USB request field.
- DEVICE = 0
- ENDPOINT = 2
- INTERFACE = 1
- OTHER = 3
- RESERVED = 4
- class facedancer.USBRequestType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
IntEnumEnumeration that describes each possible Type field for a USB request.
- CLASS = 1
- RESERVED = 3
- STANDARD = 0
- VENDOR = 2
- class facedancer.USBStandardRequests(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
IntEnum- CLEAR_FEATURE = 1
- GET_CONFIGURATION = 8
- GET_DESCRIPTOR = 6
- GET_INTERFACE = 10
- GET_STATUS = 0
- SET_ADDRESS = 5
- SET_CONFIGURATION = 9
- SET_DESCRIPTOR = 7
- SET_FEATURE = 3
- SET_INTERFACE = 11
- SYNCH_FRAME = 12
- class facedancer.USBSynchronizationType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
IntEnum- ADAPTIVE = 2
- ASYNC = 1
- NONE = 0
- SYNCHRONOUS = 3
- class facedancer.USBTransferType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
IntEnum- BULK = 2
- CONTROL = 0
- INTERRUPT = 3
- ISOCHRONOUS = 1
- class facedancer.USBUsageType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
IntEnum- DATA = 0
- FEEDBACK = 1
- IMPLICIT_FEEDBACK = 2
- facedancer.class_request_handler(**kwargs)[source]
Decorator; declares a class request handler. See control_request_handler() for usage.
- facedancer.include_in_config(cls)[source]
Decorator that marks a descriptor to be included in configuration data.
- facedancer.requestable(type_number, number)[source]
Decorator that marks a descriptor as requestable.
- facedancer.standard_request_handler(**kwargs)[source]
Decorator; declares a standard request handler. See control_request_handler() for usage.
- facedancer.to_any_endpoint(func)[source]
Decorator; refines a handler so it’s only called on requests with an endpoint recipient.
- facedancer.to_any_interface(func)[source]
Decorator; refines a handler so it’s only called on requests with an interface recipient.
- facedancer.to_device(func)[source]
Decorator; refines a handler so it’s only called on requests with a device recipient.
- facedancer.to_other(func)[source]
Decorator; refines a handler so it’s only called on requests with an Other (TM) recipient.
- facedancer.to_this_endpoint(func)[source]
Decorator; refines a handler so it’s only called on requests targeting this endpoint.
- facedancer.to_this_interface(func)[source]
Decorator; refines a handler so it’s only called on requests targeting this interface.
- facedancer.use_automatically(cls)[source]
Class decorator used to annotate Facedancer inner classes. Implies @dataclass.
This decorator can be placed on inner classes that describe “subordinate” objects on USB devices. For example, a USBDevice can have several subordinate USBConfigurations; which select the various configurations for that class.
When placed on a subordinate class, this allows the parent class to automatically instantiate the relevant given class during its creation; automatically populating the subordinate properties of the relevant device.
For example, assume we have a Facedancer class representing a custom USB device:
class ExampleDevice(USBDevice): product_string : str = "My Example Device" @use_automatically class DefaultConfiguration(USBConfiguration): number : int = 1
In this case, when an ExampleDevice is instantiated, the USBDevice code knows how to instantiate DefaultConfiguration, and will do so automatically.
Note that this decorator should _only_ be used for subordinate types; and expects that the decorated class has no explicitly-declared __init__ method. The __post_init__ mechanism of python dataclasses can be overridden to perform any needed initialization.