desowin / usbpcap

USB packet capture for Windows
http://desowin.org/usbpcap
896 stars 170 forks source link

Is possible to get Raw data from USBPcap #90

Closed ghost closed 4 years ago

ghost commented 4 years ago

I need the raw transferred data in windows, it's is possible to get raw data from USBPcap ?
I use the USBPcapCMD source in my program.

desowin commented 4 years ago

What do you mean by raw transferred data? USBPcap does capture the USB Request Blocks that contain the data exchanged between host and device.

ghost commented 4 years ago

Yes right, But i need the actual bit that transferred. When i open the .pcap with the wireshark it's have a some additional header, How i can just capture the transferred bit ?

desowin commented 4 years ago

The additional header is mandatory in order to determine what data you are dealing with (e.g. which endpoint, direction). You simply parse the .pcap file. The format is documented at https://desowin.org/usbpcap/captureformat.html

ghost commented 4 years ago

Thanks for your respond, But it's not mandatory for me i only and only have one USB port on my board which get real-time data from a device and i need only the transferred bits. But i still could not find how those headers append to actual transferred bits.

desowin commented 4 years ago

But i still could not find how those headers append to actual transferred bits.

Just open the .pcap file in Wireshark to get byte-by-byte explaination of the USBPcap pseudoheader (grouped under "USB URB").

https://wiki.wireshark.org/Development/LibpcapFileFormat specifies pcap global and record headers. The .pcap file generated by USBPcap is generally:

ghost commented 4 years ago

So unfortunately it's seem there is no way to edit the source and stop to append those headers.