|
From: Xiaofan C. <xia...@gm...> - 2007-09-22 10:14:14
|
On 9/22/07, Varuna De Silva <va...@gm...> wrote: > > I need to get raw USB packets with its protocol headers, these protocol > packets we need to convert to a pcap format to be decode by WireShark. > > Is it possible with Libusb-win32 API to get these raw packets by sniffing > the USBus , or do we have to write a special kernel level filter for this. > > Please be kind enough to guide us. > I am not an USB expert but I guess that the answer is no and you need a special filter driver. Do the existing open source sniffers like SnoopyPro and SniffUSB work for you? Both of them use a filter driver. 1. SnoopyPro: http://sourceforge.net/projects/usbsnoop/ 2. SniffUSB http://benoit.papillault.free.fr/usbsnoop/doc.php.en http://www.pcausa.com/Utilities/UsbSnoop/default.htm For libusb-win32, you can capature the debug message and I think you are asking more than that. Three steps to capature the debug message. * add usb_set_debug(255) to your code after the call of usb_init() * download DebugView from microsoft.com http://www.microsoft.com/technet/sysinternals/utilities/debugview.mspx * run DebugView to capture the driver's an the DLL's debug messages Example output: http://forum.microchip.com/tm.aspx?m=270049&mpage=2 Regards, Xiaofan |