[Lazarus] Decoding USB sniff data

Marc Santhoff M.Santhoff at web.de
Fri Jun 4 00:43:25 CEST 2010


Am Freitag, den 04.06.2010, 00:58 +0300 schrieb Adem:
> On 2010-06-03 23:54, Marc Santhoff wrote:
> > May I ask how you did that? I'm searching a usable but not very costly
> > USB monitoring thingy for Windows(XP).
> >    
> I used USBTrace [ http://sysnucleus.com/ ]. It's not at all cheap [195 USD].

That's in the price range of similar software, look there:

http://www.usblyzer.com/purchase.htm

At least they offer a 30 days fully functional demo. Another kind of pet
are hardware analyzers, starting at around 800$:

http://www.beyondlogic.org/usb/protocolanalysers.htm

I'm still not willing to pay one third of the price the device to look
at has costed itself. I'm pretty close to exchanging that thing itself,
saving all the work making a protocol spec and a program ...

> >> What do you use for this sort of thing?
> >>      
> > For a small controller built using an ATmega64 and the abandoned Philips
> > PDIUSBD11 I did it on low level. The operating system gives me a raw
> > device, /dev/ugen0 on FreeBSD, and I have translated a small subset of
> > the USB headers. These are used to talk to the device sending user
> > requests implemented by the maker of the small controller board.
> >
> > I can show some code snippets if you like.
> >    
> I am using Windows (will later port to *nix or --if I can-- to OSX when 
> I release it as freeware)

Then libusb should be best for you.

> USBTrace exports in XML format with content such as below [this a short 
> <g> sample of 200,000 lines I got for one session alone]
> 
> I apologize for dumping on you this, but I thought you might like to see 
> what the USBTrace output looks like too.

Very interesting, thanks. :)

> <Request Number = "5088" Dir = "[OUT]">
> <LogType>URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER</LogType>
> <Param>

[...]

> </Param>
> <Param>
> <Name>UrbLink</Name>
> <Value>0x0</Value>
> </Param>
> </Request>
> 
> I believe all those capitalized labels are constants.

Yes, look at the headers of your OS  and libusb or their pascal
translation. And maybe some USB starters document, explaining basic
communication protocol.

Chapter 8 there is an example:

http://www.beyondlogic.org/usbnutshell/usb1.htm

> What the others are I have no idea yet.
> > I have a similar problem with another type of hardware, but the USB
> > analyzers (hardware) or sniffing software are very comfortable, they do
> > on the fly protocol decoding and the like, but those have their price.
> > And this price is amazing. ;)
> >    
> In my case, health considerations took precedence, I'm afraid.
> 
-- 
Marc Santhoff <M.Santhoff at web.de>





More information about the Lazarus mailing list