Home > Archive > Tcl > October 2004 > How to spy on a USB port on Win2k?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How to spy on a USB port on Win2k?
|
|
| Leszek.Holenderski@philips.com 2004-10-26, 3:59 pm |
| Hi,
I need to spy on a mouse connected to a USB port, on Win2k. Is this similar to
spying on a serial port (open COM0: r; fconfigure; fileevent)? What device
should I open? Or is there some extension I could use? Code snippets wouldn't
hurt.
Thanks,
Leszek
------------------------------------
Leszek Holenderski, Philips Research
| |
| Shin The Gin 2004-10-26, 3:59 pm |
| Leszek.Holenderski@philips.com wrote:
> Hi,
>
> I need to spy on a mouse connected to a USB port, on Win2k. Is this
> similar to spying on a serial port (open COM0: r; fconfigure; fileevent)?
> What device should I open? Or is there some extension I could use? Code
> snippets wouldn't hurt.
>
AFAIK, The USB is a bus and may appear quite different depending on the
protocol of the connected hardware. On Linux USB devices get mapped to
their corresponding character- or block-devices, which can then be opened
as You described. I don't know whether Windows does it similar, sorry!
Shin - A.k.a. Thomas Braun
| |
| Pat Thoyts 2004-10-26, 8:57 pm |
| Shin The Gin <N05PAM_shin@N05PAM_shin.homelinux.net> writes:
>Leszek.Holenderski@philips.com wrote:
>
>AFAIK, The USB is a bus and may appear quite different depending on the
>protocol of the connected hardware. On Linux USB devices get mapped to
>their corresponding character- or block-devices, which can then be opened
>as You described. I don't know whether Windows does it similar, sorry!
It's really not the same. You do access USB devices using files
(CreateFile, ReadFile and WriteFile) but you also have to use the
SetupAPI functions to open up the device and initialize it. Some of
this is driver dependent too.
If you need to sniff the USB traffic, you likely need a driver level
shim or some hardware. We have something called a USB Chief which taps
the USB comms to capture packets. If you dig around in the DDK
documentation and samples there may be some software solutions in
there to assist you.
--
Pat Thoyts http://www.zsplat.freeserve.co.uk/resume.html
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
| |
| Mac A. Cody 2004-10-27, 3:57 am |
| Leszek.Holenderski@philips.com wrote:
> Hi,
>
> I need to spy on a mouse connected to a USB port, on Win2k. Is this similar to
> spying on a serial port (open COM0: r; fconfigure; fileevent)? What device
> should I open? Or is there some extension I could use? Code snippets wouldn't
> hurt.
>
> Thanks,
> Leszek
> ------------------------------------
> Leszek Holenderski, Philips Research
I've had very good success with USB Sniff on Win2k Pro, which you
can get at http://benoit.papillault.free.fr/usbsnoop/doc.en.php
I also wrote a Tcl script, called usbtattle, that processes the
dumps generated by USB Sniff to make them more understandable.
Hope this helps,
Mac A. Cody
P.S. swap the "cast" and "com" to send email to me.
| |
| Mac A. Cody 2004-10-27, 3:57 am |
| Leszek.Holenderski@philips.com wrote:
> Hi,
>
> I need to spy on a mouse connected to a USB port, on Win2k. Is this similar to
> spying on a serial port (open COM0: r; fconfigure; fileevent)? What device
> should I open? Or is there some extension I could use? Code snippets wouldn't
> hurt.
>
> Thanks,
> Leszek
> ------------------------------------
> Leszek Holenderski, Philips Research
I've had very good success with USB Sniff on Win2k Pro, which you
can get at http://benoit.papillault.free.fr/usbsnoop/doc.en.php
I also wrote a Tcl script, called usbtattle, that processes the
dumps generated by USB Sniff to make them more understandable.
Hope this helps,
Mac A. Cody
P.S. swap the "cast" and "com" to send email to me.
| |
| Mac A. Cody 2004-10-27, 3:57 am |
| Leszek.Holenderski@philips.com wrote:
> Hi,
>
> I need to spy on a mouse connected to a USB port, on Win2k. Is this similar to
> spying on a serial port (open COM0: r; fconfigure; fileevent)? What device
> should I open? Or is there some extension I could use? Code snippets wouldn't
> hurt.
>
> Thanks,
> Leszek
> ------------------------------------
> Leszek Holenderski, Philips Research
I've had very good success with USB Sniff on Win2k Pro, which you
can get at http://benoit.papillault.free.fr/usbsnoop/doc.en.php
I also wrote a Tcl script, called usbtattle, that processes the
dumps generated by USB Sniff to make them more understandable.
Hope this helps,
Mac A. Cody
P.S. swap the "cast" and "com" to send email to me.
| |
| Leszek.Holenderski@philips.com 2004-10-27, 8:57 am |
| "Mac A. Cody" wrote:
> I've had very good success with USB Sniff on Win2k Pro, which you
> can get at http://benoit.papillault.free.fr/usbsnoop/doc.en.php
> I also wrote a Tcl script, called usbtattle, that processes the
> dumps generated by USB Sniff to make them more understandable.
>
> Hope this helps,
I need to spy on USB directly from my Tcl app and I hoped to do it with a Tcl
script. If my only option is to write my own Tcl extension your code seems a
good starting point.
Thanks,
Leszek
------------------------------------
Leszek Holenderski, Philips Research
| |
| Mac A. Cody 2004-10-28, 3:57 am |
| Leszek.Holenderski@philips.com wrote:
> "Mac A. Cody" wrote:
>
>
>
> I need to spy on USB directly from my Tcl app and I hoped to do it with a Tcl
> script. If my only option is to write my own Tcl extension your code seems a
> good starting point.
>
Since the sources to USB sniff are available, it could be
possible to develop a Tcl extension that talks to the
USB Sniff shim directly and process out the message
traces as they are generated. The script that I wrote
only works with the dump file created by USB sniff and
there might be some causality issues trying to work with
a real-time dump stream.
Mac
| |
| Marc Reinig 2004-10-30, 3:56 pm |
| In Win2K, the system opens the mouse exclusively, so you can't directly
access it the way you can COM ports. BTW, it is the same if someone has
already opend a COM port and you try to reOpen it.
You could look at DirectInput but you would probably have to write some sort
of DirectX addon. I don't think you want to use Snoopy, because it requires
a driver added to your system which can cause instability and performance
problems. Besides, the amount of data that is collected is large and you
don't want to be processing that. It's really a USB developer's tool.
Marc Reinig
UCO Lick
Laboratory for Adaptive Optics
<Leszek.Holenderski@philips.com> wrote in message
news:417E5363.BADE3FCD@philips.com...
> Hi,
>
> I need to spy on a mouse connected to a USB port, on Win2k. Is this
> similar to
> spying on a serial port (open COM0: r; fconfigure; fileevent)? What device
> should I open? Or is there some extension I could use? Code snippets
> wouldn't
> hurt.
|
|
|
|
|