- First teaser for Tyson Johnston’s first contact flick EXIST
- Producers claim documentary of Mayan underwater cities and ET contact will shake the world
- Producers claim documentary of Mayan underwater cities and ET contact will shake the world
- Sundance 2008 - Trailer for Dog Eat Dog (Perro Come Perro)
- New Horror movie: [REC]
- First teaser for Tyson Johnston’s first contact flick EXIST
- Battle for Pandora Trailer!
- Battle for Pandora Trailer!
- Trailer: Indiana Jones and the Dial of Destiny
- MAD MAX: HOPE AND GLORY Short Film Funding on Kickstarter
- Re: Occupation, Australian Sci Fi movie
- Slice of Life, Blade Runner inspired short
- Is Snowpeircer a sequel to Willy Wonka?
- Re: Yesterday
- Re: Yesterday
- Yesterday
- Re: White Night (or where do I get my 30 + from now?)
- Re: White Night (or where do I get my 30 + from now?)
- Re: White Night (or where do I get my 30 + from now?)
- Re: White Night (or where do I get my 30 + from now?)
- MAD MAX: HOPE AND GLORY Short Film Funding on Kickstarter
- Dawn of the Dead 4K Coming in January!
- Here's What's New on Blu-ray and 4K this Week! [October 18, 2022]
- Sony Released A Bunch of Limited Edition Steelbooks This Week
- First Trailer for HBO's THE LAST OF US Series
- Trailer: A Family Navigates Disaster in WHITE NOISE Adaptation
- Take Note PA Fans: TESTAMENT Finally Comes to Blu-ray in Glorious Special Edition
- Trailer for Indigenous Apocalyptic Film POLARIS
- Trailer for New SCAVENGERS REIGN Animated Series
- MANBORG Novelization Out Now!
- Book Club: SWAN SONG Is a Post-Apocalyptic Classic on Par with The Stand
- VIFF 2021: THE IN-LAWS, MIRACLE, SALOUM, SECRETS FROM PUTUMAYO [Capsule Reviews]
- TIFF 2021: SILENT NIGHT Review
- VIFF 2021: Documentary Preview [Capsule Reviews]
- TIFF 2021: THE PINK CLOUD, THE HOLE IN THE FENCE [Capsule Reviews]
- TIFF 2021: JAGGED Review
- TIFF 2021: SUNDOWN Review
- VIFF 2021: Animation Preview [Capsule Reviews]
- SAINT-NARCISSE is Bruce LaBruce at His Most Accomplished [Review]
- TIFF 2021: DASHCAM Review
- TIFF 2021: THE DAUGHTER Review
- Here's What's New on Blu-ray & 4K This Week [September 20, 2022]
- The V/H/S/99 Teaser Trailer is Here!
- Blade Runner 2099 Series Ordered by Amazon
- Trailer for Lars von Trier's THE KINGDOM: EXODUS
- 5-25-77 Is A Coming of Age Movie about Filmmaking and the Summer Star Wars Was Released
- Trailer for Mission to Mars Movie VIKING
- Trailer for Lucky McKee's OLD MAN
- Trailer for Nicolas Winding Refn's Copenhagen Cowboy Netflix Series
- William Gibson Adaptation THE PERIPHERAL Finally Gets a Trailer!
- Winnie the Pooh Slasher Movie Gets a Trailer
- Cameras Roll on MJ Bassett's RED SONJA Adaption!
- Special Features Released for 4K Release of The Return of the Living Dead!
- Trailer: A Family Navigates Disaster in WHITE NOISE Adaptation
- Special Features Revealed for ARMY OF DARKNESS 4K Steelbook Edition
- Mona Lisa and the Blood Moon Trailer
- THE RUNNING MAN Gets a 4K Steelbook for its 35th Anniversary
- George Romero's THE AMUSEMENT PARK Coming to Blu-ray
- Lars von Trier Returns to his haunting TV Series with The Kingdom Exodus! [CLIP]
- Out now on Blu-ray and 4K! [August, 9, 2022]
- Take Note PA Fans: TESTAMENT Finally Comes to Blu-ray in Glorious Special Edition
Jack In
Latest Comments
Latest Forum Posts
PA News
Latest Reviews
Older News
Crew
Marina Antunes
Editor in Chief
Vancouver, British Columbia
Christopher Webster
Managing Editor
Edmonton, Alberta
DN aka quietearth
Founder / Asst. Managing Editor
Denver, Colorado
Simon Read
UK Correspondent
Edinburgh, Scotland
Rick McGrath
Toronto Correspondent
Toronto, Ontario
Manuel de Layet
France Correspondent
Paris, France
rochefort
Austin Correspondent
Austin, Texas
Daniel Olmos
Corrispondente in Italia
Italy
Griffith Maloney aka Griffith Maloney
New York Correspondent
New York, NY
Stephanie O
Floating Correspondent
Quiet Earth Bunker
Jason Widgington
Montreal Correspondent
Montreal, Quebec
Carlos Prime
Austin Correspondent
Austin, TX







quietearth [General News 10.16.06]
This is intended to be a howto to debug usb transactions under linux, or simply to reverse engineer propietary usb stuff.
If you need to reverse engineer a windows only usb driver, you can do it easily using vmware. We can snoop the usb traffic from windows using usbmon which is part of the linux kernel since version 2.6.11 (I think). Previous to that you had to use patches.
1. Compile and install the kernel
First off we need to compile the "Debug filesystem" and the usbmon module into the kernel. Under your source directory, run:
# make menuconfig
Enable the debug filesystem which is located under Kernel hacking -> Kernel Debugging. Unfortunately this cannot be compiled as a module.
Then enable usb monitoring under Device Drivers -> USB support. It should be around the USB Multimedia adapters or before port drivers.
You will then need to compile the newly configured kernel and install it. This will be distribution dependent, so consult your documentation. If you are looking for instructions for ubuntu, you can read my post about it here.
2. Setup
Once you're booted into your new kernel, we need to mount the debug filesystem and load usbmon (which should be a module):
# mount -t debugfs none_debugs /sys/kernel/debug
# modprobe usbmon
# ls -l /sys/kernel/debug
total 0
-rw------- 1 root root 0 2006-10-16 12:53 1s
-rw------- 1 root root 0 2006-10-16 12:53 1t
-rw------- 1 root root 0 2006-10-16 12:53 2s
-rw------- 1 root root 0 2006-10-16 12:53 2t
You should already have vmware setup with your necessary version of windows installed. At this point we can use the usbmon package (note the package name is the same as the kernel module, but not the same thing) which makes reading the debug output much easier, or you could read the usbmon documentation located in Docuemtation/usb/usbmon.txt in the linux kernel source.
I'm going to use the usbmon package (0.4) so let's grab it from http://people.redhat.com/zaitcev/linux/. This is a java program, and I couldn't use the pre-installed blackdown java on ubuntu, I had to grab the Sun jre and jdk from the repositories. To compile you will probably need to modify the USBMon Makefile to change the JAVAC (java compiler) location. Run make and you should be able to start it up with "java USBMon". Let's leave this for later as it will need to be loaded after we've inserted our device.
3. Execution
Startup vmware and boot your windows virtual machine, once loaded make sure you have loaded the device driver and software for the usb thing you wish to watch. Insert the usb device, both windows and linux should recognize the device, and it should function fine without any special modifications required. Now we can load up the java USBMon program and find our usb device, it will be listed under whatever usb bus # you plugged it into. It might be listed as "generic" or something else which is non-intuitive, so you can take a look at /proc/bus/usb/devices to help out.
Once you've found the device in USBMon, set the primary control pipe and all the interfaces under the Configuration tab to "Full Data Monitoring", then go ahead and run a transaction to it under windows. To see the data, go to the Endpoints tab and under whatever Endpoint Data section, just click on "Data not shown" and it will open a new window with a text/hex/binary dump of the data.
At this point I would reccomend doing one transaction to your device at a time, then looking at the debug output to figure out how it works. The USBMon interface leaves a lot to be desired, so if anyone knows of any better program, please post a comment here.
Then again it might just be easier to do it by hand as described in the kernel documentation.
UPDATE: 10/17/06
I got linked off Make, woohoo! Make rules, it's one of the few sites I read. Thanks to all who visited, and special thanks to Pete for the update on the impending binary api goodness..
Pingbacks
Trackbacks
Rad, Quiet Earth has a good how-to on listening in to what's going on over USB, great for reverse engineering weird USB doo-dads... - "This is intended to be a ho...

Pete Zaitcev (16 years ago) Reply
Just like you said, forget the USBmon. It's the old program which Dave Harding wrote, but he never completed it.
Currently (for 2.6.18), I simply read the raw output for the text format API.
Last week one guy sent me a patch to introduce a binary API, which plugs into libpcap, and thus into Wireshark. We're hashing this out, so it's not quite there.

Anonymous (15 years ago) Reply
ur hot

danielstaple (15 years ago) Reply
The cool thing I have spotted is that the debugfs and usbmon module is already present under ubuntu. You will not need to compile or configure the kernel, just mount the debugfs, load the usbmon module, and the usbmon directory should appear under the /sys/kernel/debug directory.
Happy hacking - I am going to try to get some multimedia keys working on my new shiny keyboard...

Giro (14 years ago) Reply
There is an even better way to sniff on USB Traffic:
the svn version of libpcap is able to sniff on USB Traffic. In combination with Wireshark it is very easy to see whats going on on the USB
http://wiki.wireshark.org/USB

CeDeROM (14 years ago) Reply
pingback frompoland: http://www.tomek.cedro.info/content/view/202/72/lang,pl/

Anonymous (13 years ago) Reply
ping