<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Matt Cutts: Gadgets, Google, and SEO</title>
	<atom:link href="http://www.mattcutts.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mattcutts.com/blog</link>
	<description></description>
	<lastBuildDate>Tue, 18 Jun 2013 22:02:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Funny SEO emails, part 6</title>
		<link>http://www.mattcutts.com/blog/seo-email/</link>
		<comments>http://www.mattcutts.com/blog/seo-email/#comments</comments>
		<pubDate>Tue, 18 Jun 2013 22:02:26 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Google/SEO]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=5833</guid>
		<description><![CDATA[Folks at Google get cold-call emails out of the blue just like everybody else. Here&#8217;s an email that a colleague of mine got recently: I was on your website www.google.com and wanted to shoot you a quick note. I think I can make a few changes (aesthetically and/or SEO &#8211; wise) to make your site [...]]]></description>
				<content:encoded><![CDATA[<p>Folks at Google get cold-call emails out of the blue just like everybody else. Here&#8217;s an email that a colleague of mine got recently:</p>
<blockquote><p>
I was on your website www.google.com and wanted to shoot you a quick note. I think I can make a few changes (aesthetically and/or SEO &#8211; wise) to make your site convert more visitors into leads and to get it placed higher in the organic search results, for a few of the select terms.</p>
<p>This is NOT like one of those foreign emails you probably get in your inbox every day. Just to be upfront I have 3 agents that work with me for development /SEO.</p>
<p>I would just need to know which (if not both) services you&#8217;re open to checking out information about, either web design or SEO. Would you be open to seeing more brief info / quote for what I would like to accomplish?</p>
<p>Regards,<br />
XXXXXX XXXXX
</p></blockquote>
<p>So this person is offering help to convert Google visitors into leads. Or, you know, to improve Google&#8217;s rankings in organic search results. Sigh.</p>
<p>Earlier this week, I got a different email that said </p>
<blockquote><p>
I would like to extend our knowledge to your audience in the form of a uest post [sic]. This post will be written by a college educated writer fluent in English.</p>
<p>To recap we will provide-<br />
- 100% original guest post with statical [sic] data and studies from professional writers.
</p></blockquote>
<p>Here&#8217;s my rule of thumb: if someone sends you an email with an SEO offer out of the blue, be skeptical. For example, check out some other <a href="http://www.mattcutts.com/blog/a-fun-email/">fun SEO emails</a> that I&#8217;ve gotten in the past.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/seo-email/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Penguin 2.0 rolled out today</title>
		<link>http://www.mattcutts.com/blog/penguin-2-0-rolled-out-today/</link>
		<comments>http://www.mattcutts.com/blog/penguin-2-0-rolled-out-today/#comments</comments>
		<pubDate>Thu, 23 May 2013 00:34:12 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Google/SEO]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=5822</guid>
		<description><![CDATA[We started rolling out the next generation of the Penguin webspam algorithm this afternoon (May 22, 2013), and the rollout is now complete. About 2.3% of English-US queries are affected to the degree that a regular user might notice. The change has also finished rolling out for other languages world-wide. The scope of Penguin varies [...]]]></description>
				<content:encoded><![CDATA[<p>We started rolling out the next generation of the <a href="http://googlewebmastercentral.blogspot.com/2012/04/another-step-to-reward-high-quality.html">Penguin webspam algorithm</a> this afternoon (May 22, 2013), and the rollout is now complete. About 2.3% of English-US queries are affected to the degree that a regular user might notice. The change has also finished rolling out for other languages world-wide. The scope of Penguin varies by language, e.g. languages with more webspam will see more impact.</p>
<p>This is the fourth Penguin-related launch Google has done, but because this is an updated algorithm (not just a <a href="http://www.mattcutts.com/blog/explaining-algorithm-updates-and-data-refreshes/">data refresh</a>), we&#8217;ve been referring to this change as Penguin 2.0 internally. For more information on what SEOs should expect in the coming months, <a href="http://www.mattcutts.com/blog/what-to-expect-in-seo-in-the-coming-months/">see the video that we recently released</a>.</p>
<p>Added: If there are spam sites that you&#8217;d like to report after Penguin, we made a special spam report form at <a href="http://bit.ly/penguinspamreport">http://bit.ly/penguinspamreport</a> . Tell us about spam sites you see and we&#8217;ll check it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/penguin-2-0-rolled-out-today/feed/</wfw:commentRss>
		<slash:comments>236</slash:comments>
		</item>
		<item>
		<title>What to expect in SEO in the coming months</title>
		<link>http://www.mattcutts.com/blog/what-to-expect-in-seo-in-the-coming-months/</link>
		<comments>http://www.mattcutts.com/blog/what-to-expect-in-seo-in-the-coming-months/#comments</comments>
		<pubDate>Mon, 13 May 2013 16:17:12 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Google/SEO]]></category>
		<category><![CDATA[Movies/Videos]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=5815</guid>
		<description><![CDATA[We just recently taped a new round of webmaster videos, and I thought this video deserved a full-fledged blog post. This is my rough estimate (as of early May 2013) of what search engine optimizers (SEOs) and webmasters should expect in the next few months: Bear in mind that this is a very rough estimate, [...]]]></description>
				<content:encoded><![CDATA[<p>We just recently taped a new round of webmaster videos, and I thought this video deserved a full-fledged blog post. This is my rough estimate (as of early May 2013) of what search engine optimizers (SEOs) and webmasters should expect in the next few months:</p>
<p><center><iframe width="720" height="405" src="http://www.youtube.com/embed/xQmQeKU25zg" frameborder="0" allowfullscreen></iframe></center></p>
<p>Bear in mind that this is a very rough estimate, because priorities, projects, and timing can change based on a lot of different factors. But I hope this gives folks a ballpark idea of what to expect in the coming months as far as what my team is working on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/what-to-expect-in-seo-in-the-coming-months/feed/</wfw:commentRss>
		<slash:comments>88</slash:comments>
		</item>
		<item>
		<title>Email backlog</title>
		<link>http://www.mattcutts.com/blog/email-backlog/</link>
		<comments>http://www.mattcutts.com/blog/email-backlog/#comments</comments>
		<pubDate>Mon, 13 May 2013 06:59:42 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Productivity]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=5741</guid>
		<description><![CDATA[This is a &#8220;hairball&#8221; post you can ignore. However, this post does trace my thinking about how to scale webmaster communication. Part of me wants to start answering questions I get via email by stripping out the identifying information and then replying with a blog post. Instead of one person getting a single reply, everybody [...]]]></description>
				<content:encoded><![CDATA[<p><em>This is a &#8220;hairball&#8221; post you can ignore. However, this post does trace my thinking about how to scale webmaster communication. Part of me wants to start answering questions I get via email by stripping out the identifying information and then replying with a blog post. Instead of one person getting a single reply, everybody could see what the answer is.</em></p>
<p>I spent most of the past week tackling my horrendous email backlog. At the start of the weekend, I was just touching 500 unread emails. I got it down to 218 unread emails and 264 total emails in my inbox. Of course, the ones that are left are the harder messages. And out of those 264 emails, 167 are from outside Google.</p>
<p>A few weeks ago, I flew up to the Kirkland office for a couple days to catch up with the <a href="http://www.google.com/webmasters/">Webmaster Central</a> team. At some point, we were talking about doing videos for webmasters. Someone said &#8220;Why don&#8217;t we just grab a video camera and see how many videos we can shoot in an hour?&#8221; So we did. We managed to tape three pretty informative videos in about an hour, and that includes set-up/breakdown time.</p>
<p>So now I&#8217;m looking at these 150+ emails from outside Google, and I&#8217;m pondering about how much time I should spend on email compared to other things. Email is a 1:1 communication, so I could answer 10 emails and help roughly 10 people. Or in the same amount of time, I could comment on a forum, start on a blog post, or plan out another video that could benefit a lot more people. I did a <a href="http://www.mattcutts.com/blog/type/movies/">series of about 15 videos</a> last year when my wife was out of town, and the videos have been watched over 300K times and downloaded over 100K times.</p>
<p>So to make a long story short, I&#8217;m trying to figure out how I should handle email going forward. I&#8217;ve been <a href="http://www.mattcutts.com/blog/changing-how-i-handle-emails/">thinking about this for a while</a>, but don&#8217;t be offended if I don&#8217;t reply to email as much going forward.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/email-backlog/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>The dangers of productivity porn</title>
		<link>http://www.mattcutts.com/blog/the-dangers-of-productivity-porn/</link>
		<comments>http://www.mattcutts.com/blog/the-dangers-of-productivity-porn/#comments</comments>
		<pubDate>Mon, 13 May 2013 06:58:49 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Productivity]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=1077</guid>
		<description><![CDATA[A quick &#8220;hairball&#8221; post about how sometimes it&#8217;s better to just go with the flow. I like how xkcd made this point with a chart of whether it&#8217;s worth the time to fix something that&#8217;s bugging you. I have a friend who is mechanical engineer. A few years ago he took me for a tour [...]]]></description>
				<content:encoded><![CDATA[<p><em>A quick &#8220;hairball&#8221; post about how sometimes it&#8217;s better to just go with the flow. I like how xkcd made this point with a chart of <a href="http://xkcd.com/1205/">whether it&#8217;s worth the time to fix something that&#8217;s bugging you</a>.</em></p>
<p>I have a friend who is mechanical engineer. A few years ago he took me for a tour of his workplace that ended in his office. As I looked at his workstation, something leapt out at me. My friend had never changed his background screen. Whatever the computer came with by default, that&#8217;s what he was using. With this simple act of indifference, my friend taught me an important productivity lesson.</p>
<p>It&#8217;s great to be productive. It really is. But sometimes we chase productivity so much that it makes us, well, unproductive. It&#8217;s easy to read a lot about how to be more productive, but don&#8217;t forget that you have make that time up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/the-dangers-of-productivity-porn/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My wife keeps me grounded</title>
		<link>http://www.mattcutts.com/blog/my-wife-keeps-me-grounded/</link>
		<comments>http://www.mattcutts.com/blog/my-wife-keeps-me-grounded/#comments</comments>
		<pubDate>Mon, 13 May 2013 06:51:21 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=919</guid>
		<description><![CDATA[This is a harmless &#8220;hairball&#8221; post I had as a draft. Me: Hey, they added me to popurls.com! My wife: Never heard of it. (pause) Had you heard of it before? Me: Yeah. Wife: Really? Me: Yeah! Wife: (with an extra helping of sarcasm) Really? Me: Yes! Wife: (dripping with condescension) You&#8217;re a very important [...]]]></description>
				<content:encoded><![CDATA[<p><em>This is a harmless &#8220;hairball&#8221; post I had as a draft.</em></p>
<p>Me: Hey, they added me to <a href="http://popurls.com/">popurls.com</a>!<br />
My wife: Never heard of it. (pause) Had you heard of it before?<br />
Me: Yeah.<br />
Wife: Really?<br />
Me: Yeah!<br />
Wife: (with an extra helping of sarcasm) Really?<br />
Me: Yes!<br />
Wife: (dripping with condescension) You&#8217;re a very important man.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/my-wife-keeps-me-grounded/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Playing with a USB Missile Launcher</title>
		<link>http://www.mattcutts.com/blog/playing-with-a-usb-missile-launcher/</link>
		<comments>http://www.mattcutts.com/blog/playing-with-a-usb-missile-launcher/#comments</comments>
		<pubDate>Mon, 13 May 2013 06:45:43 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Gadgets/Hack]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=4555</guid>
		<description><![CDATA[This is the last half-finished &#8220;hairball&#8221; blog post about USB devices on Linux. I actually did manage to get a working program that controlled a USB foam missile launcher. Unfortunately, I didn&#8217;t document all the steps, so this blog post just sort of stops at some point. I got a USB Missile Launcher for Christmas. [...]]]></description>
				<content:encoded><![CDATA[<p><em>This is the last half-finished &#8220;hairball&#8221; blog post about USB devices on Linux. I actually did manage to get a working program that controlled a USB foam missile launcher. Unfortunately, I didn&#8217;t document all the steps, so this blog post just sort of stops at some point.</em></p>
<p>I got a <a href="http://www.thinkgeek.com/interests/techies/8a0f/">USB Missile Launcher</a> for Christmas. The manufacturer, <a href="http://dreamcheeky.com/download-support">Dream Cheeky, provides software</a>&#8211;but only for Windows XP. And I thought to myself, &#8220;wouldn&#8217;t it be fun to practice some USB reverse engineering skills?&#8221; Because another Christmas present was a <a href="http://www.totalphase.com/products/">USB protocol analyzer</a> from Total Phase. I should note that <a href="http://code.google.com/p/pyrocket/">plenty of other people</a> have apparently already written drivers/<a href="http://sourceforge.net/projects/usblauncher/">software for USB missile launcher toys</a>, but I wanted to poke around myself.</p>
<p>Total Phase makes a high-speed <a href="http://www.totalphase.com/products/beagle_usb480/">USB 2.0 protocol analyzer</a> for $1200, or a regular-speed <a href="http://www.totalphase.com/products/beagle_usb12/">USB protocol analyzer</a> for $400. Here&#8217;s a trick someone mentioned: if you get the cheaper protocol analyzer and need to work with a high-speed USB device, you may be able to plug the high-speed device into a low-speed USB hub to slow the device down.</p>
<p>I decided to start with ladyada&#8217;s excellent guide to <a href="http://ladyada.net/learn/diykinect/">hacking a Kinect</a> by reverse engineering USB packets. So here&#8217;s what I did.</p>
<p>Step 1. Make sure the device works. It would suck to attempt to reverse engineer a broken device. I keep a Windows XP computer lying around, so I downloaded the <a href="http://dreamcheeky.com/download-support">software</a> for it, installed the program, and plugged in the USB rocket launcher. After the install, XP wanted to restart, so I restarted the XP computer (unplugging my USB rocket launcher after the computer was off), then started the rocket launcher software back up, then plugged in the USB device. Sure enough, everything worked fine. The controls are: pan left/right, tilt up/down, and fire. Tip: the rocket launcher uses bursts of air, so don&#8217;t jam the foam rockets down hard on the launcher.</p>
<p>Step 2. Probe the device. I plugged the USB rocket launcher into a Linux machine running Ubuntu 10.04 (Lucid Lynx). I ran the command <strong>sudo lsusb -vv</strong> and the relevant info from the list of USB devices on my system was this:</p>
<p><code></p>
<pre>
Bus 002 Device 045: ID 0a81:0701 Chesen Electronics Corp. USB Missile Launcher
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0a81 Chesen Electronics Corp.
  idProduct          0x0701 USB Missile Launcher
  bcdDevice            0.01
  iManufacturer           1 Dream Link
  iProduct                2 USB Missile Launcher v1.0
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      52
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              20
Device Status:     0x0000
  (Bus Powered)
</pre>
<p></code></p>
<p>Note that my Vendor ID = 0x0a81 and my Product ID = 0&#215;0701. Also note that bNumEndpoints = 1. An endpoint is a channel for USB data communication. Then we get the Endpoint info:</p>
<p><code></p>
<pre>
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              20
</pre>
<p></code></p>
<p>According to ladyada&#8217;s <a href="http://ladyada.net/learn/diykinect/">write-up</a>, the &#8220;IN&#8221; means that data goes IN to the computer from the device, and the &#8220;Interrupt&#8221; transfer type is good for sending large amounts of small data quickly (e.g. a USB mouse).</p>
<p>Step 3. Prepare your Linux system to talk to the device. First, let&#8217;s review ladyada&#8217;s steps, which is for Windows. She installs libusb-win32 and then runs a program called inf-wizard to make a driver shell. Then plugging the device into Windows will attach the LibUSB-win32 device driver. Next, she installed Python and PyUSB.</p>
<p>I wanted to stick with Linux. I didn&#8217;t need libusb-win32 or inf-wizard.exe, and I already had Python installed. So my next step was to <a href="http://sourceforge.net/projects/pyusb/">download PyUSB</a>, extract the zip into a directory, change into that directory, then run <code><strong>sudo python setup.py install</strong></code> in that directory to install PyUSB. Since you&#8217;re installing PyUSB system-wide, you do need to run that command with &#8220;sudo&#8221; to run it as root.</p>
<p>Step 4. Write a short program on your Linux machine to talk to the device. I made a file missile-launcher.py and executable access with &#8220;chmod ugo+rx missile-launcher.py&#8221; next. Here&#8217;s the short program I ended up with:</p>
<p><code></p>
<pre>
#!/usr/bin/python

import usb.core
import usb.util
import sys
 
# find our device
dev = usb.core.find(idVendor=0x0a81, idProduct=0x0701)
 
# was it found?
if dev is None:
    raise ValueError('Device not found')

# Linux kernel sets up a device driver for USB device, which you have
# to detach. Otherwise trying to interact with the device gives a
# 'Resource Busy' error.
try:
  dev.detach_kernel_driver(0)
except Exception, e:
  pass # already unregistered
 
# set the active configuration. With no arguments, the first
# configuration will be the active one
dev.set_configuration()
 
print "all done"
</pre>
<p></code></p>
<p>Note that my &#8220;idVendor=0x0a81, idProduct=0&#215;0701&#8243; parameters use the values I found from lsusb -vv. If you compare against <a href="http://ladyada.net/learn/diykinect/">ladyada&#8217;s short program</a> you&#8217;ll notice one major difference. My code has these lines:</p>
<p><code></p>
<pre>
# Linux kernel sets up a device driver for USB device, which you have
# to detach. Otherwise trying to interact with the device gives a
# 'Resource Busy' error.
try:
  dev.detach_kernel_driver(0)
except Exception, e:
  pass # already unregistered
</pre>
<p></code></p>
<p>Ladyada&#8217;s PyUSB program for Windows didn&#8217;t have anything like that. But when I ran the program under Linux, I got the error message &#8220;usb.core.USBError: Resource busy&#8221;. It turns out that the Linux kernel tries to use a default kernel driver, and that prevents my program from talking to the device. Detaching the kernel driver lets me talk to the device just fine. I picked up this tip <a href="http://www.arcfn.com/2010/04/usb-panic-button-with-linux-and-python.html">Ken Shirriff&#8217;s post about a USB panic button with Linux and Python</a>. In theory you could also <a href="https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/288964">unbind the USB device from a command-line</a>, but I prefer to do it right in my PyUSB program directly.</p>
<p>Note that you will need to run the python program as root, e.g. &#8220;sudo ./missile-launcher.py&#8221; or else you&#8217;ll get a warning message like &#8220;usb.core.USBError: Access denied (insufficient permissions)&#8221;.</p>
<p>At this point, you have a small working program that opens up a connection to the USB rocket launcher. If the USB rocket launcher isn&#8217;t plugged in, you&#8217;ll get a &#8220;Device not found&#8221; error, and if the USB device is plugged in, you&#8217;ll get an &#8220;all done&#8221; message and the program exits gracefully.</p>
<p>Step 5: Try to read from the USB device. In ladyada&#8217;s guide, she tried sending 0b11000000 = 0xC0 (&#8220;Read Vendor data from Device&#8221;) to a Kinect. I got no response from that, but I did get a response sending 0b10000000. That corresponds to sending:<br />
- a &#8217;1&#8242; to read from the device<br />
- a message type of &#8217;00&#8242; = standard. Ladyada got a response sending to &#8217;10&#8242; = vendor<br />
- &#8217;000&#8242; (reserved bits, so always 0)<br />
- &#8217;00&#8242; to say the recipient of the message is the device.<br />
Then sending a request of 0 got back a result of two zero bytes:</p>
<p><code></p>
<pre>
bRequest  0
array('B', [0, 0])
</pre>
<p></code></p>
<p>Interestingly, running the same program again would get a &#8220;usb.core.USBError: Unknown error&#8221; response. At that point, I would unplug the USB device and then plug it back in to reset it. I didn&#8217;t get any other responses from trying to send message types of class or vendor (as opposed to standard), nor did I get any responses from try to send messages to the interface or endpoint (as opposed to the device). See <a href="http://ladyada.net/learn/diykinect/">ladyada&#8217;s guide</a> for more details about fuzzing the device and what all the various bit fields mean.</p>
<p>Step 6: Set up the Linux computer to use the Total Phase Beagle. The CD worked nicely with HTML documentation on it. First, you copy some udev rules so that the device is writable by anyone when the Beagle is plugged in:</p>
<p><code><br />
cd /media/Total Phase/drivers/linux/<br />
sudo cp 99-totalphase.rules /etc/udev/rules.d/<br />
sudo chmod 644 /etc/udev/rules.d/99-totalphase.rules<br />
</code></p>
<p>If you&#8217;ve already plugged in the Beagle, you&#8217;ll need to unplug it and plug it back in for these rules to fire. Next, you&#8217;ll need the Data Center software. You can get it off the CD, but I&#8217;d recommend downloading the <a href="http://www.totalphase.com/products/data_center/">latest software and user&#8217;s manual from the website</a> instead. My CD had software version 4.20 for example and the website was up to 5.01. Extract the software zip file (either from online or the CD). Then follow the directions in the <a href="http://www.totalphase.com/docs/data_center_man/contents/">online manual</a> (or user manual <a href="http://www.totalphase.com/download/pdf/data-center-v5.01.pdf">PDF</a>). The directions according to the manual are </p>
<ol>
<li>Install the USB drivers and Data Center software. Copying the udev rules is enough for USB drivers on Linux. Unpacking the zip is all you need for the Data Center software, because the executable is self-contained.</li>
<li>Plug the Beagle analyzer into the analysis machine. This was my Linux machine.</li>
<li>Plug the Beagle analyzer into the bus to be analyzed. In this case, this was my XP computer. Don&#8217;t plug the USB missile launcher in yet though.</li>
<li>Start the Data Center software. Run the program &#8220;Data Center&#8221; in the directory you extracted from the .zip file. Follow the rest of the instruction in the Quick Start section.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/playing-with-a-usb-missile-launcher/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux USB device driver info</title>
		<link>http://www.mattcutts.com/blog/linux-usb-device-driver-info/</link>
		<comments>http://www.mattcutts.com/blog/linux-usb-device-driver-info/#comments</comments>
		<pubDate>Mon, 13 May 2013 06:41:41 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Gadgets/Hack]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=681</guid>
		<description><![CDATA[What, *another* half-finished blog post about Linux USB drivers? Yup. Suppose you have a device and want a Linux device driver for it. There are a few steps you&#8217;ll need to take. One of the heroes in this area is Greg Kroah-Hartman. Greg wrote USBView, which is a Linux tool to enumerate a list of [...]]]></description>
				<content:encoded><![CDATA[<p><em>What, *another* half-finished blog post about Linux USB drivers? Yup.</em></p>
<p>Suppose you have a device and want a Linux device driver for it. There are a few steps you&#8217;ll need to take. One of the heroes in this area is <a href="http://www.kroah.com/linux/">Greg Kroah-Hartman</a>. Greg wrote <a href="http://www.kroah.com/linux/usb/">USBView</a>, which is a Linux tool to enumerate a list of USB devices. He&#8217;s also done a massive amount of documentation as we&#8217;ll see below. One of his more eye-catching tricks is to walk a classroom through the process of <a href="http://www.kroah.com/log/diary/2005_11_17-tutorial.html">writing a Linux driver for a USB thermometer live and in real-time</a>. In addition to all the work he does for Linux in general, he recently announced a program to work with manufacturers and <a href="http://www.kroah.com/log/linux/free_drivers_faq.html">provide Linux drivers for new devices for free</a>. That&#8217;s right, manufacturers get a free driver. From the <a href="http://www.kroah.com/log/linux/free_drivers.html">original announcement</a>:</p>
<blockquote><p>
All that is needed is some kind of specification that describes how your device works, or the email address of an engineer that is willing to answer questions every once in a while. A few sample devices might be good to have so that debugging doesn&#8217;t have to be done by email, but if necessary, that can be done.</p>
<p>In return, you will receive a complete and working Linux driver that is added to the main Linux kernel source tree. The driver will be written by some of the members of the Linux kernel developer community (over 1500 strong and growing).
</p></blockquote>
<p>That is majorly good karma for Linux and Greg. But if you&#8217;re not a manufacturer, here are the steps that you&#8217;d look into.</p>
<p>1. Get documentation of the USB protocol, or reverse engineer the protocol. It&#8217;s far easier if you can get documentation of the protocol. If you do need to reverse engineer the USB protocol, here are some tools that might help:</p>
<p>Windows tools: <a href="http://www.wingmanteam.com/usbsnoopy/">USB Snoopy</a> let you do actions with your device and log the stream of USB information going downstream/outbound to the device, or upstream/inbound back to your computer. <a href="http://usbsnoop.sourceforge.net/">Snoopy Pro</a> is a variant of the same code that evidently has some improvements. It appears that the preferred location for Snoopy Pro is <a href="http://benoit.papillault.free.fr/usbsnoop/">here</a>.</p>
<p>Linux tools:<br />
- The previously mentioned <a href="http://www.kroah.com/linux/usb/">USBView</a> will show you devices that are currently plugged in.<br />
- The usbutils package includes a bunch of handy console tools for USB, including lsusb, which shows you the USB devices that are currently plugged in. The output of lsusb looks like this:</p>
<blockquote><p>
Bus 001 Device 006: ID 2222:3061 MacAlly<br />
Bus 001 Device 002: ID 0557:7000 ATEN International Co., Ltd<br />
Bus 001 Device 003: ID 045e:00db Microsoft Corp.
</p></blockquote>
<p>2. Write the driver.</p>
<p>- It seems that the process of writing drivers in Linux is getting easier over time. The <a href="http://www.linuxjournal.com/">Linux Journal</a> has documented this well. Compare this <a href="http://www.linuxjournal.com/article/4786">2001 article</a> by Greg Kroah-Hartman to Greg&#8217;s <a href="http://www.linuxjournal.com/article/7353">2004 article</a> on controlling a simple USB lamp device. Then see Greg&#8217;s follow-up article on <a href="http://www.linuxjournal.com/article/7466">writing a linux driver in user space</a>. It turns out that you can use the <a href="http://libusb.sourceforge.net/">libusb library</a> to read/write with USB devices without ever mucking around in the kernel. This is possible because Linux provides a USB filesystem (called USBFS) that automatically mounts USB devices into the Linux directory tree. Note that libusb also works on BSDs, Mac/OSX computers, and that there is a <a href="http://libusb-win32.sourceforge.net/">Windows libusb port</a>.</p>
<p>If you really want to delve into this deeply, there&#8217;s an O&#8217;Reilly book on <a href="http://www.oreilly.com/catalog/linuxdrive3/">Linux device drivers</a> that you can buy as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/linux-usb-device-driver-info/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compile a simple USB program in Linux</title>
		<link>http://www.mattcutts.com/blog/compile-a-simple-usb-program-in-linux/</link>
		<comments>http://www.mattcutts.com/blog/compile-a-simple-usb-program-in-linux/#comments</comments>
		<pubDate>Mon, 13 May 2013 06:39:27 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Linux/Ubuntu]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=897</guid>
		<description><![CDATA[Here&#8217;s another &#8220;hairball&#8221; post about USB devices and drivers on Linux. I wish some expert would write the definitive &#8220;here&#8217;s how to reverse-engineer a USB device and write a new USB driver&#8221; guide. I am definitely not that expert. Once you reverse engineer a Windows USB device enough to know how it works, you&#8217;re ready [...]]]></description>
				<content:encoded><![CDATA[<p><em>Here&#8217;s another &#8220;hairball&#8221; post about USB devices and drivers on Linux. I wish some expert would write the definitive &#8220;here&#8217;s how to reverse-engineer a USB device and write a new USB driver&#8221; guide. I am definitely not that expert.<br />
</em></p>
<p>Once you <a href="http://www.mattcutts.com/blog/reverse-engineering-a-windows-usb-driver/">reverse engineer a Windows USB device</a> enough to know how it works, you&#8217;re ready to try talking to the device under Linux. Here are a few tips.</p>
<p>lsusb to list devices from a command-line.</p>
<p>On Ubuntu 7.10, usbview (use &#8220;sudo apt-get install usbview&#8221; to install it) is broken. It says &#8220;Can not open the file /proc/bus/usb/devices  Verify that you have USB compiled into your kernel, have the USB core modules loaded, and have the usbdevfs filesystem mounted.&#8221; It turns out that <a href="https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/151585/comments/3">Ubuntu decided to drop support for /proc/bus/usb devices</a>. You can still find USB devices under /dev/bus/usb/ on Ubuntu, but they are special binary files.</p>
<p>usbmon is a Linux kernel module that lets you monitor USB events: http://people.redhat.com/zaitcev/linux/OLS05_zaitcev.pdf . The text file format is pretty terse (see the PDF for some details), but if you&#8217;ve installed Linux kernel source code, check Documentation/usb/usbmon.txt for more info. Note that USBMon is a tool with a graphical user interface (GUI) that is based on usbmon. I believe that usbmon operates by using instrumentation hooks in the usbcore Linux kernel module. usbmon normally outputs only text, although Eric Preston reported adding a binary interface to usbmon.</p>
<p>You can trace how talking to a USB device under Linux has gotten easier over the years by reading the sequence of articles that <a href="http://www.kroah.com/linux/">Greg Kroah-Hartman</a> has written for <a href="http://www.linuxjournal.com/">Linux Journal</a> over the years. Let&#8217;s examine a few of the articles:</p>
<p>October 2001: <a href="http://www.linuxjournal.com/article/4786">How to Write a Linux USB Device Driver</a>. Greg walks through nitty gritty details for using a program usb-skeleton.c that he wrote. Aspiring writers of drivers have to learn quite a bit of kernel hacking.</p>
<p>April 2004: <a href="http://www.linuxjournal.com/article/7353">Writing a Simple USB Driver</a>. Greg writes a simple driver for a USB lamp. The driver still sits in kernel space, but exposes some functionality to the user through sysfs. What the heck is sysfs? According to the <a href="http://en.wikipedia.org/wiki/Sysfs">Wikipedia page</a>, &#8220;Sysfs is a virtual file system provided by the 2.6 Linux kernel and it replaced the old deprecated devfs which use in 2.4 series of stable kernels. Sysfs exports information about devices and drivers from the kernel device model to userspace, and is also used for configuration.&#8221; Pretty handy. This article is also notable because Greg mentions a couple ways to reverse-engineer an unknown USB protocol: 1) sniff the USB events with Windows software such as <a href="http://sourceforge.net/projects/usbsnoop/">SnoopyPro</a>, or 2) run Windows on top of Linux using virtualization software such as VMWare. When you plug in a USB device, VMWare can make the device available to the Windows instance. Windows happily talks with the USB device, unaware that because Linux is sitting between Windows and the USB device, Linux gets to see (and can dump) all the communication that is happening between Windows and the USB device.</p>
<p>June 2004: <a href="http://www.linuxjournal.com/article/7466">Writing a Real Driver &#8212; In User Space</a>. Greg has now left the kernel behind for the ease of talking to a USB device from user space. This article covers three things that make like easier.</p>
<p>1. usbfs. Originally called usbdevfs, usbfs is a way for user space programs to read/write data to USB devices. The method of talking to the USB devices are ioctl (&#8220;input/output control&#8221;) function calls to special files, where each file represents a USB device. If you&#8217;ve use ioctl before, you&#8217;ll know that this is still a pretty down-to-the-metal way to talk to hardware.</p>
<p>2. libusb. This is where life really starts to get good. libusb is a library radically simplifies talking to USB devices. Even better, it runs on many types of UNIX besides Linux (including Mac OS X). You can read the <a href="http://libusb.sourceforge.net/doc/index.html">official libusb documentation</a>, but it lacks a good &#8220;talk to a simple device&#8221; example. I also enjoyed this <a href="http://www.linuxforums.org/forum/linux-tutorials-howtos-reference-material/10865-developing-usb-device-drivers-userspace-using-libusb.html">overview of libusb</a>.</p>
<p>3. Example source code. Is there anything better when you&#8217;re delving into a new library than example source code? Greg gives a short program that echoes his previous article. In just a few lines of code, he shows how to turn on an LED in a USB lamp.</p>
<p>There are a couple wrinkles with the sample code. First, there are at least a few errors in the code on the Linux Journal website. A C programmer can look at code like</p>
<p><code><br />
    usb_handle = usb_open(usb_dev);<br />
    if (usb_handle == NULL) {<br />
        fprintf(stderr,<br />
        goto exit;<br />
    }<br />
    usb_handle = usb_open(usb_dev);<br />
    if (usb_handle == NULL) {<br />
        fprintf(stderr, "Not able to claim the USB devicen");<br />
        goto exit;<br />
    }<br />
</code></p>
<p>and say &#8220;Hmm. That first fprintf doesn&#8217;t have a closing parenthesis. For that matter, why call usb_open() twice and overwrite usb_handle the second time?&#8221; So something got scrambled in the code listing. I recommend checking out this <a href="http://csourcesearch.net/data/package/avusbradio/avermedia_usbradio-0.1/usbradio.c">simple usbradio program</a> as another short example of how to use libusb. </p>
<p>Second, Greg doesn&#8217;t really say how to compile the program. On Ubuntu 7.10 (Gutsy Gibbon), I had to install a few packages. I think I had to do &#8220;sudo apt-get install gcc build-essential libusb-dev&#8221; to get everything I needed. Then if your program is called talk-to-usb.c, you would compile the program with &#8220;gcc -o talk-to-usb talk-to-usb.c -lusb&#8221;. (The &#8220;-lusb&#8221; tells the compiler to use the libusb library when linking in code.)</p>
<p>August 2004: <a href="http://www.linuxjournal.com/article/7582">Snooping the USB Data Stream</a>. This is a really fascinating article. Greg is given an unknown USB device and told to make it work on Linux. It turns out to be a crypto key and comes with working Linux code &#8212; but the license prohibits Greg from using the USB device as freely as he would like. This puts Greg back in the position of reverse-engineering a USB protocol. In the same way that Windows-running-atop-Linux-in-VMWare provides a way to monitor USB communication that takes place in usbfs, adding usbfs logging to Linux helps to see what commands are being sent from the too-restrictive Linux library for this USB device.</p>
<p>If you understood that last sentence, congratulations for paying such close attention. <img src='http://www.mattcutts.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  To continue, Greg walks the reader through a patch to the kernel to enable kernel-based logging of any USB communication through usbfs. He even adds a variable (controllable through sysfs) so that users can turn this USB logging on and off at will. </p>
<p>At this point (looking on the web, not in the kernel source), I noticed several reports of additional USB logging in Linux. There was <a href="http://www.linuxjournal.com/article/7582">Greg&#8217;s article</a>. There&#8217;s <a href="http://www.mjmwired.net/kernel/Documentation/usb/usbmon.txt">usbmon</a>, which is &#8220;a facility in kernel which is used to collect traces of I/O on the USB bus.&#8221; I noticed a patch by Paolo Abeni to <a href="http://lwn.net/Articles/203864/">add binary dumps</a> to usbmon. Both usbmon and Paolo&#8217;s patch utilize <a href="http://kerneltrap.org/node/4394">debugfs</a>, which is another Greg Kroah-Hartman invention to allow reading/writing of data to user space, especially debugging/binary data. As Greg puts it, &#8220;one line of code and you have a variable that can be read and written to from userspace.&#8221; And Eric Preston evidently added binary dumping of USB data to Linux as well, and then <a href="http://www.linux.com/feature/55910">started a USB protocol dissector</a> to view USB communication in ethereal/Wireshark, which normally is used to sniff on network communication.</p>
<p>Now we&#8217;ve gotten a lot of background, so we&#8217;re ready to look at an example actually monitoring USB communication in Linux. The best write-up I&#8217;ve seen is this one on <a href="http://www.quietearth.us/articles/2006/10/16/USB-Snoop-in-linux">USB snooping on Linux</a>. It&#8217;s a little over a year old, but check out one of the comments:</p>
<blockquote><p>
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.
</p></blockquote>
<p>That means that a stock Ubuntu 7.10 (Gutsy Gibbon) install can just run these commands:</p>
<blockquote><p>
sudo mount -t debugfs none_debugs /sys/kernel/debug<br />
sudo modprobe usbmon<br />
ls -l /sys/kernel/debug/usbmon/<br />
total 0<br />
-rw&#8212;&#8212;- 1 root root 0 2008-02-17 00:59 0s<br />
-rw&#8212;&#8212;- 1 root root 0 2008-02-17 00:59 0t<br />
-rw&#8212;&#8212;- 1 root root 0 2008-02-17 00:59 0u<br />
-rw&#8212;&#8212;- 1 root root 0 2008-02-17 00:59 1s<br />
-rw&#8212;&#8212;- 1 root root 0 2008-02-17 00:59 1t<br />
-rw&#8212;&#8212;- 1 root root 0 2008-02-17 00:59 1u<br />
-rw&#8212;&#8212;- 1 root root 0 2008-02-17 00:59 2s<br />
-rw&#8212;&#8212;- 1 root root 0 2008-02-17 00:59 2t<br />
-rw&#8212;&#8212;- 1 root root 0 2008-02-17 00:59 2u
</p></blockquote>
<p>After that, you&#8217;re ready to cat those files, exercise the USB device, and observe the resulting USB traces to figure out what commands and data passed back and forth. In case you&#8217;re wondering, the filenames seem to be a number (0,1,2) followed by a letter (s,t,u). According to the <a href="http://www.mjmwired.net/kernel/Documentation/usb/usbmon.txt">usbmon documentation</a>, the number corresponds to the bus numbers of the USB devices. The documentation also mentions that the &#8216;u&#8217; files are a superset of the &#8216;t&#8217; files with more detailed information. I don&#8217;t know what the &#8216;s&#8217; files are.</p>
<p>Just as an aside, it looks like <a href="https://bugs.launchpad.net/virtualbox/+bug/156085">/proc/bus/usb/ is deprecated in Ubuntu 7.10</a> and is being replaced with /dev/bus/usb. Unfortunately, that breaks a few programs (usbview, virtualbox, and qemu). Instead of usbview, you can use lsusb to find the particulars of a specific USB device. Unfortunately, it sounds like /proc/bus/usb/devices is going away entirely, which is a shame because the file was easy-to-read for regular users. The bug report I linked to gives a workaround if you really want that file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/compile-a-simple-usb-program-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reverse engineering a Windows USB driver</title>
		<link>http://www.mattcutts.com/blog/reverse-engineering-a-windows-usb-driver/</link>
		<comments>http://www.mattcutts.com/blog/reverse-engineering-a-windows-usb-driver/#comments</comments>
		<pubDate>Mon, 13 May 2013 06:35:54 +0000</pubDate>
		<dc:creator>Matt Cutts</dc:creator>
				<category><![CDATA[Gadgets/Hack]]></category>
		<category><![CDATA[How to]]></category>

		<guid isPermaLink="false">http://www.mattcutts.com/blog/?p=895</guid>
		<description><![CDATA[For a while, I was really into reverse-engineering USB drivers. Don&#8217;t ask why. The heart wants what the heart wants. I didn&#8217;t finish this &#8220;hairball&#8221; post, but it has some info in it that still might be good. I recently stumbled across this post and it inspired me. I decided to try to reverse engineer [...]]]></description>
				<content:encoded><![CDATA[<p><em>For a while, I was really into reverse-engineering USB drivers. Don&#8217;t ask why. The heart wants what the heart wants. I didn&#8217;t finish this &#8220;hairball&#8221; post, but it has some info in it that still might be good.</em></p>
<p>I recently stumbled across <a href="http://www.jespersaur.com/drupal/book/export/html/21">this post</a> and it inspired me. I decided to try to reverse engineer the USB protocol for my <a href="http://www.mattcutts.com/blog/my-favorite-pedometer-omron-hj-720itc/">Omron pedometer</a>, which can upload your step data, but only to a Windows computer.</p>
<p>There are two parts to writing a Linux driver for a new USB device: reverse-engineering the USB protocol, and writing the Linux program.</p>
<p><strong>Reverse-engineering the USB protocol</strong></p>
<p>Typically your problem is that a device only runs under Windows. Like it or not, that means that you&#8217;re going to need something that runs Windows. It can be a Windows computer, or you can get fancy and run Windows as a &#8220;guest&#8221; operating system using something like VMWare to do virtualization. That is, you&#8217;d install Linux, then install VMWare, then install Windows to run under VMWare. But let&#8217;s start simple.</p>
<p>Step 0. Find the Vendor ID and Product ID of your device</p>
<p>Every USB device should have a Vendor ID plus a Product ID (sometimes called a device ID) that identifies it. You&#8217;ll need to discover this information before you can talk to the device. I plugged my Omron pedometer into a linux machine and typed &#8220;lsusb&#8221;. You&#8217;ll get a lot of information back. I saw a line like</p>
<blockquote><p>Bus 002 Device 018: ID 0590:0028 Omron Corp.</p></blockquote>
<p>That tells me that the vendorid is hexadecimal value 0&#215;0590 (which is 1424 in decimal) and the productid is hex value 0&#215;0028 (which is 40 in decimal). For other operating systems, <a href="http://forum.insanelymac.com/index.php?showtopic=36764">this post</a> tells you how to find your vendor id and product id under Mac and Windows. For Windows XP, it looks like you can run &#8220;msinfo32.exe&#8221; and then look under &#8220;Components&#8221; and then &#8220;USB&#8221; and look for &#8220;VID_&#8221; (vendor id) and &#8220;PID_&#8221; (product id). </p>
<p><strong>1) The simple approach: a dedicated Windows computer</strong></p>
<p>In the beginning, it&#8217;s easiest to just use a Windows computer and run some software to sniff on the USB packets as they go back and forth. The wild part is that the best open-source/free program I found is five years old (<a href="http://sourceforge.net/projects/usbsnoop/">SnoopyPro</a>). It still worked fine on Windows XP though. SnoopyPro is the program you want. There&#8217;s a whole long history of how it forked from USBSnoopy (evidently also called &#8220;<a href="http://benoit.papillault.free.fr/usbsnoop/">sniff-bin</a>&#8220;), and there&#8217;s another program called <a href="http://www.pcausa.com/Utilities/UsbSnoop/default.htm">sniffusb</a> which is related but different (I think both sniffusb and SnoopyPro are forks off of the original USBSnoopy/sniff-bin program). It&#8217;s all very confusing. I went with SnoopyPro and it worked fine for me.</p>
<p>Further reading on SnoopyPro and related USB sniffer programs:<br />
<a href="http://sourceforge.net/docman/display_doc.php?docid=12578&#038;group_id=34567">Some documentation on how to use SnoopyPro</a><br />
If you&#8217;re willing to shell out for a book, it looks like <a href="http://books.google.com/books?id=OSnynlQrvVcC&#038;printsec=frontcover">USB Complete</a>, now in its third edition, is one of the best.<br />
<a href="http://www.piclist.com/techref/usbs.htm">http://www.piclist.com/techref/usbs.htm</a> &#8211; mentions all the different sniffers<br />
<a href="http://hackspire.unsads.com/USB_Protocol#USB_traffic_analysis">http://hackspire.unsads.com/USB_Protocol#USB_traffic_analysis</a> &#8211; talks about how to convert SnoopyPro (and SniffUsb) logs/traces into hexadecimal data.</p>
<p>Are there other options? Sure. <a href="http://www.hhdsoftware.com/Products/home/usb-monitor.html">USB Monitor</a> from HHD Software is $85 and runs on Windows. Or you could spend $850-950 to buy a <a href="http://www.beyondlogic.org/usb/protocolanalysers.htm">hardware USB protocol analyzer</a>. Since I have only a casual interest, that&#8217;s a bit steep for me.</p>
<p>One last option is to run Windows as a virtual &#8220;guest&#8221; on a Linux system running something like VMWare. VMWare can let programs interact with USB devices. As the virtual version Windows interacts with the USB device, the Linux computer gets to see everything that happens, because it sits between Windows and the USB device. In fact, Eric Preston <a href="http://linux.slashdot.org/article.pl?sid=06/07/24/2044227">presented</a> a <a href="http://www.linux.com/feature/55910">method</a> that could log all the the output of the Linux usbmon program as binary data. Eric changed usbmon to use relayfs so that large amounts of data could be quickly relayed from kernel space to user space, then wrote a user space program to dump that binary data to disk. Eric also wrote a dissector for ethereal so that he could view the USB data in real-time. Unfortunately the PDF of his slide presentation have disappeared from <a href="http://download.linuxmontreal.com/projects/usb/reveng/">http://download.linuxmontreal.com/projects/usb/reveng/</a> where they used to be. In fact, all of linuxmontreal.com appears to be gone now. <img src='http://www.mattcutts.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>By the way, Ethereal is now known as <a href="http://www.wireshark.org/">Wireshark</a>, and it is a protocol analyzer that runs on many platforms and apparently <a href="http://www.wireshark.org/docs/dfref/u/usb.html">supports USB traces</a>. It looks like <a href="http://www.wireshark.org/docs/relnotes/wireshark-0.99.4.html">Wireshark has supported USB</a> since version 0.99.4:</p>
<blockquote><p>
Wireshark now supports USB as a media type. If you&#8217;re running a Linux distribution with version 2.6.11 of the kernel or greater and you have the usbmon module enabled and  you have a recent CVS version of libpcap (post-0.9.5) installed you can also do live captures. More details can be found at the <a href="http://wiki.wireshark.org/CaptureSetup/USB">USB capture setup</a> page on the wiki.
</p></blockquote>
<p>Follow the link in the quote to find Wireshark&#8217;s <a href="http://wiki.wireshark.org/CaptureSetup/USB">USB wiki page</a>.</p>
<p>On Ubuntu 7.10 (Gutsy Gibbon), I was able to do <a href="http://hachoir.org/wiki/Canoscan5000F">these commands</a>:</p>
<blockquote><p>
sudo mount -t debugfs none_debugs /sys/kernel/debug<br />
sudo modprobe usbmon<br />
ls /sys/kernel/debug/usbmon<br />
0s  0t  0u  1s  1t  1u  2s  2t  2u
</p></blockquote>
<p>General USB Reading:<br />
<a href="http://www.beyondlogic.org/usbnutshell/usb4.htm">USB in a NutShell</a> is a pretty good overview of how USB communication goes.<br />
<a href="http://today.java.net/pub/a/today/2006/07/06/java-and-usb.html">This Java and USB tutorial</a> starts with a good overview of USB.<br />
This <a href="http://www.cs.indiana.edu/~bpisupat/work/usb.html">USB and Linux tutorial</a> starts to get into the nitty gritty of USB on Linux.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattcutts.com/blog/reverse-engineering-a-windows-usb-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.228 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-06-18 15:58:20 -->
