How to catch the exact interaction of USB-HID with software and override it in my own code

I am trying to work with a USB USB device.
I have proprietary software (from the device vendor) that can communicate with the device. But I need to write my own.
Using the sniffer tool, I caught traffic between the host and the device. This is a BusDog tool .
Then I was able to play the same traffic through WriteFile with the device descriptor that I get from CreateFile (for the path obtained from the setupapi.dll API). But the device does not respond to my commands ("requests" because they are called in the USB / HID world).

Then I took another tool - HHD Device Monitoring Studio. This tool shows not only the "transfer of interruptions", but also all types of transfers. I see the following log:

008852: Class-Specific Request (DOWN), 12.20.2010 18: 58: 10.242 +0.031
Destination: Interface, Index 0
Reserved Bits: 34
Request: 0x9
Value: 0x30d
Send 0x8 bytes to the device

 0D 01 01 00 00 00 00 00 ........
008853: Control Transfer (UP), 12.20.2010 18: 58: 10.242 +0.0. Status: 0x00000000
Pipe Handle: 0x8638c5c8

 0D 01 01 00 00 00 00 00 ........
Setup packet
 21 09 0D 03 00 00 08 00! .......
Recipient: Interface
Request Type: Class
Direction: Host-> Device
Request: 0x9 (Unknown)
Value: 0x30d
Index: 0x0
Length: 0x8

, ? ( DeviceIoControl?)

p.s. #, , C/++.

+3
2

HIDClass (http://msdn.microsoft.com/en-us/library/ff538865%28v=vs.85%29.aspx), HID ioctls ... - (HidD_SetFeature).

0

. .

, . ( .) . , , , , , libusb, / / . , .

0

Source: https://habr.com/ru/post/1781263/


All Articles