- NYFF 2012: De Palma's PASSION is a Wreck [Review]
- Even More Action In New RIDDICK Trailer
- AIRLOCKED is an impressive and devastating scifi short
- Even More Action In New RIDDICK Trailer
- NYFF 2012: Review of Takeshi Kitano's OUTRAGE BEYOND
- THIS IS THE END Makes Light of the Apocalypse [Review]
- THE VIGILANTE DIARIES Trailer is Stylish, Bloody Fun!
- Adventure Continues in THE HOBBIT: THE DESOLATION OF SMAUG [Trailer]
- Wave of Nordic Crime Thrillers Continues with THE KEEPER OF LOST CAUSES [Trailer]
- THE WALL Is a Spectacular Achievement [Review]
- Re: Takashi Ishii
- Re: In the Flesh
- Viy 3D (2013)
- Re: Japanese zombie movies (2011-12 round-up)
- Re: Why Don't You Play in Hell? (2013)
- Re: Japanese zombie movies (2011-12 round-up)
- Re: Lesson of the Evil (2012)
- Project Kronos (short film)
- Why Don't You Play in Hell? (2013)
- Endless Dark (2013)
- SNOWPIERCER Trailer Blows in from the Cold!
- Official MAD MAX Game Trailer
- The Rapture Vs. Eric Roberts in REVELATION ROAD 2: THE SEA OF GLASS AND FIRE [Trailer]
- WORLD WAR Z "Scared the Living Heck" out of Darren Aronofsky
- Take a look at Scream Factory's DAY OF THE DEAD Blu-ray
- Z FOR ZACHARIAH movie is happening... for real this time!
- A BOY AND HIS DOG Hits Blu-ray in August
- Trailer for THE DEAD 2: INDIA Rises from the Grave
- THE COLONY: There's Hope At The End Of The World [Review]
- Michael Bay's Post-Apocalyptic THE LAST SHIP Gets a Trailer
- First footage from SNOWPIERCER!
- THE WALL Is a Spectacular Achievement [Review]
- THIS IS THE END Makes Light of the Apocalypse [Review]
- Think You’re HELLBOUND? Think Again [Review]
- THE RAMBLER is Odd But an Apt Follow-up to THE OREGONIAN [Review]
- VIOLET & DAISY is a Boring Mess [Review]
- CANNES 2013: LAST DAYS ON MARS Treads Old Ground [Review]
- Obsession Turns Violent In NANCY, PLEASE [Review]
- CANNES 2013: THE BLING RING Review
- Story & Action Well Balanced In COLD PREY Director's ESCAPE [Review]
- KISS OF THE DAMNED Is A Sexy Story Of Awakening [Review]
- Philip K. Dick Fans: Help RADIO FREE ALBEMUTH see US Theatrical Release
- Renny Harlin Tackles the Supernatural in THE DYATLOV PASS INCIDENT [Trailer]
- First Look at Ruairi Robinson's LAST DAYS ON MARS [Clip]
- Taking the SCENIC ROUTE Could Be Deadly [Trailer]
- The Stone Roses Define a Generation in SPIKE ISLAND [Trailer]
- CANNES 2013: First Look at Palme d'Or Winner BLUE IS THE WARMEST COLOUR [Clips]
- Take a look at Scream Factory's DAY OF THE DEAD Blu-ray
- Gorgeous First Look at Sundance Hit AIN'T THEM BODIES SAINTS [Trailer]
- CANNES 2013: LAST DAYS ON MARS Treads Old Ground [Review]
- Visions Plague Juno Temple in Travel Thriller MAGIC MAGIC [Trailer]
- THE WORLD'S END Goes International! [Trailer]
- MANIAC Remake Gets A New Everything! [Trailer]
- Obsession Turns Violent In NANCY, PLEASE [Review]
- ABCs OF DEATH Released as a Children's Book
- SOLOMON KANE Finally Hits Blu-ray in July
- Ben Wheatley's A FIELD IN ENGLAND Trailer
- 70s Crime Drama Revived in Guillaume Canet's BLOOD TIES [Trailer]
- CANNES 2013: THE BLING RING Review
- Trailer for Alejandro Jodorowsky's THE DANCE OF REALITY
- The Mind is Deadly in Ozploitation Remake PATRICK [Trailer]
Jack In
Latest Comments
Latest Forum Posts
PA News
Latest Reviews
Older News
Film Festivals
Seattle International Film Festival
May 17 - Jun 10
Seattle, Washington
Los Angeles Film Festival
Jun 14 - Jun 24
Los Angeles, California
Cinequest Film Festival
Feb 28 - Mar 11
San Jose, California
Dead by Dawn
Mar 29 - Apr 01
Edinburgh, Scotland
Shanghai International Film Festival
Jun 16 - Jun 24
Shanghai, China
Crew
Don Neumann aka quietearth
Editor in Chief
Fort Collins/Denver, Colorado
agentorange
Managing Editor
Edmonton, Alberta
Marina Antunes
Assistant Managing Editor
Vancouver, British Columbia
projectcyclops
UK Correspondent
Edinburgh, Scotland
Rick McGrath
Toronto Correspondent
Toronto, Ontario
The Crystal Ferret
France Correspondent
Paris, France
rochefort
Austin Correspondent
Austin, Texas
Joao Fleck
South American Correspondent
Porto Alegre, Brazil
Griffith Maloney
New York Correspondent
New York, NY
Stephanie Ogrodnik
Floating Correspondent
Quiet Earth Bunker
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 menuconfigEnable 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 2tYou 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 (6 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 (6 years ago) Reply
ur hot
danielstaple (5 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 (4 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 (4 years ago) Reply
pingback frompoland: http://www.tomek.cedro.info/content/view/202/72/lang,pl/
Anonymous (3 years ago) Reply
ping



