![如何从嗅探到的 USB 通信中获取数据?](https://linux22.com/image/1318349/%E5%A6%82%E4%BD%95%E4%BB%8E%E5%97%85%E6%8E%A2%E5%88%B0%E7%9A%84%20USB%20%E9%80%9A%E4%BF%A1%E4%B8%AD%E8%8E%B7%E5%8F%96%E6%95%B0%E6%8D%AE%EF%BC%9F.png)
我们正在尝试从一个 USB 传感器获取原始测量数据,因为控制软件是一个黑匣子,并且手册中没有包含有关如何处理测量的任何内容。
我能够使用嗅探数据SniffUsb 2.0,但我无法分析输出并识别测量值。数据样本如下:
[11 ms] UsbSnoop - FilterDispatchAny(a693ffd2) : IRP_MJ_INTERNAL_DEVICE_CONTROL
[11 ms] UsbSnoop - FdoHookDispatchInternalIoctl(a69401ea) : fdo=85b14030, Irp=861c2008, IRQL=0
[11 ms] >>> URB 3 going down >>>
-- URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE:
TransferBufferLength = 00000100
TransferBuffer = b9d23800
TransferBufferMDL = 00000000
Index = 00000002
DescriptorType = 00000003 (USB_STRING_DESCRIPTOR_TYPE)
LanguageId = 00000409
[12 ms] UsbSnoop - MyInternalIOCTLCompletion(a6940126) : fido=00000000, Irp=861c2008, Context=8664c358, IRQL=2
[12 ms] <<< URB 3 coming back <<<
-- URB_FUNCTION_CONTROL_TRANSFER:
PipeHandle = 86b77910
TransferFlags = 804ef19f (USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)
TransferBufferLength = 00000018
TransferBuffer = b9d23800
TransferBufferMDL = 86b3b930
00000000: 18 03 72 00 61 00 64 00 5f 00 66 00 6c 00 61 00
00000010: 73 00 68 00 5f 00 32 00
UrbLink = 00000000
SetupPacket =
00000000: 80 06 02 03 09 04 00 01
[12 ms] UsbSnoop - FilterDispatchAny(a693ffd2) : IRP_MJ_INTERNAL_DEVICE_CONTROL
[12 ms] UsbSnoop - FdoHookDispatchInternalIoctl(a69401ea) : fdo=85b14030, Irp=861c2008, IRQL=0
[12 ms] >>> URB 4 going down >>>
-- URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE:
TransferBufferLength = 00000009
TransferBuffer = b9d23998
TransferBufferMDL = 00000000
Index = 00000000
DescriptorType = 00000002 (USB_CONFIGURATION_DESCRIPTOR_TYPE)
LanguageId = 00000000
[12 ms] UsbSnoop - MyInternalIOCTLCompletion(a6940126) : fido=00000000, Irp=861c2008, Context=8664c358, IRQL=2
[12 ms] <<< URB 4 coming back <<<
-- URB_FUNCTION_CONTROL_TRANSFER:
PipeHandle = 86b77910
TransferFlags = 0000000b (USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)
TransferBufferLength = 00000009
TransferBuffer = b9d23998
TransferBufferMDL = 861d79f0
00000000: 09 02 20 00 01 01 00 80 32
UrbLink = 00000000
SetupPacket =
00000000: 80 06 00 02 00 00 09 00
[12 ms] UsbSnoop - FilterDispatchAny(a693ffd2) : IRP_MJ_INTERNAL_DEVICE_CONTROL
[12 ms] UsbSnoop - FdoHookDispatchInternalIoctl(a69401ea) : fdo=85b14030, Irp=861c2008, IRQL=0
[12 ms] >>> URB 5 going down >>>
-- URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE:
TransferBufferLength = 00000020
TransferBuffer = 867df220
TransferBufferMDL = 00000000
Index = 00000000
DescriptorType = 00000002 (USB_CONFIGURATION_DESCRIPTOR_TYPE)
LanguageId = 00000000
[13 ms] UsbSnoop - MyInternalIOCTLCompletion(a6940126) : fido=00000000, Irp=861c2008, Context=8664c358, IRQL=2
[13 ms] <<< URB 5 coming back <<<
-- URB_FUNCTION_CONTROL_TRANSFER:
PipeHandle = 86b77910
TransferFlags = 0000000b (USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)
TransferBufferLength = 00000020
TransferBuffer = 867df220
TransferBufferMDL = 861d79f0
00000000: 09 02 20 00 01 01 00 80 32 09 04 00 00 02 ff 00
00000010: 00 02 07 05 81 02 40 00 00 07 05 01 02 40 00 00
UrbLink = 00000000
SetupPacket =
00000000: 80 06 00 02 00 00 20 00
[13 ms] UsbSnoop - FilterDispatchAny(a693ffd2) : IRP_MJ_INTERNAL_DEVICE_CONTROL
[13 ms] UsbSnoop - FdoHookDispatchInternalIoctl(a69401ea) : fdo=85b14030, Irp=861c2008, IRQL=0
[13 ms] >>> URB 6 going down >>>
我尝试寻找一些数据结构的解释,但没有成功。您知道如何从中获取数据吗?
谢谢