[Lazarus] Decoding USB sniff data

Henry Vermaak henry.vermaak at gmail.com
Thu Jun 3 23:11:41 CEST 2010


On 3 June 2010 21:22, Adem <listmember at letterboxes.org> wrote:
> What I want to do is this:
>
> I have already sniffed/monitored the exchange between the app and the USB
> device.
>
> I don't really have much idea about what's going on, but I'd like to decode
> (reverse engineer) it first to understand what's what.
>
> I'd appreciate any pointers to help me with this.
>
> Then, I'd like to be able to write my own app to initiate and handle
> communication with the device. So, I believe I need some code to locate the
> correct USB device and talk to it.
>
> What do you use for this sort of thing?

You can use libusb for this.  It allows you to communicate with usb
devices from userspace (i.e. no need to write a kernel driver).  It
works on linux, windows and osx.

You can use some kind of usb snooping software to reverse engineer all
the transfers.  I've used this approach with success.  It's important
for you to familiarise yourself with the usb protocol, though.

Note that there aren't any fpc bindings for libusb 1 (that I know of),
but that should be easy to generate.

There is a list for libusb, but I'm willing to help.  This probably
isn't the right list, though.

Henry




More information about the Lazarus mailing list