Monday, December 17, 2012

XBox controller - Windows driver

In my last post I showed how I modded an original XBox controller for use on a PC.  In this post I'll talk about the Windows driver.  When you connect the controller to a computer, Windows recognizes the USB device but without a driver the controller is useless.  If you search on the Internet you'll quickly find XBCD by redcl0ud.  This is the original XBox controller driver, currently at version 1.07.  According to the author this driver works on Windows XP, which is my OS of choice.  So I downloaded the driver and tried it out.  Unfortunately, the driver wouldn't load for me.  XP accepted the driver, but after installation it said there was a problem with the device.  I was convinced my soldering was fine, something must be wrong with the driver itself.

As it happens, the author provides the source code for the driver, and at work I recently had to write a device driver, so I have all the tools necessary to compile the driver.  The first thing I noticed is the source is rather old - it hasn't been updated since 2005.  Even if the driver works on XP, I can guaranty the driver won't work on 64-bit Windows.  I decided to take the time to update the driver and produce version 1.08.  Using newer tools from Microsoft I was able to fix a few problems in the driver's source code, correct issues in the driver INF file, and recompile for both 32-bit and 64-bit Windows.  This updated driver works, I've tested it on XP, 2003, Vista, and Windows 7, both 32-bit and 64-bit.  I'll make this new driver available to anyone who wants a copy, including the updated source code.  You can download the driver here (link updated).  This 7Zip file contains the unsigned 32 and 64-bit versions, the modified source code, and the tools necessary to sign the driver if you have your own digital certificate (read on).

No discussion of the driver would be complete without mentioning 64-bit drivers.  Starting with Vista, Microsoft made a change to 64-bit Windows.  All device drivers must be digitally signed using a what's called a cross-certificate.  These certificates cost at least $100, and quite frankly I'm not going to spend my own money for a certificate so I can sign a free driver.  So if you want to run this driver on 64-bit Windows Vista, 7, or 8 then you have two choices.

  1. The follow website has 4 different methods of loading uncertified drivers under Windows.  The intent is this is used by developers who need to test their code.  So it's up to you to make these changes to your own system.  http://www.raymond.cc/blog/loading-unsigned-drivers-in-windows-7-and-vista-64-bit-x64/
  2. You can sign the driver yourself.  Assuming you have access to a valid certificate, cross certificate from Microsoft, and know how to use the signtool.exe application then you can sign your own driver.

Sunday, December 16, 2012

XBox controller modded for PC use

Recent I was given an original XBox controller, specifically the Contoller S for XBox.  This is the model 2 controller for the original XBox, the second model was slightly smaller and more ergonomic.  The thing is, I don't have an XBox nor do I know anyone with an XBox, so I wasn't sure what to do with it.  What's more, this controller lacked the other half of the breakaway cable, so it's not very useful even if I had an XBox.  But then I learned the original XBox controllers are basically a USB controller and it's really easy to mod the controller for use on a computer.  All you need to do is add a USB connector and load up a special driver.

To add the connector, there are several options.  You can cut the cable and solder in a new end.  You could solder in an entirely new cable.  You could get the breakaway cable and solder in a new connector on that end.  Looking in my box of spare parts I found a USB cable from an old keyboard, so I decided to solder in a completely new cable.  After opening the controller you'll find the connector on the circuit board from the cable.  The wires will be red, white, green, yellow, black (thin), and black (thick) in that order.  If you look at a standard USB cable it will have red, white, green, black, and black.  Literally you wire up the new connector color for color - i.e. red to red, white to white, and so on.  As for the yellow cable which is a part of the XBox cable but not in a USB cable, you leave that wire empty.  Lastly, not all USB cables will have two black wires, and that's alright.  The black wires are the ground wires.  If your USB cable doesn't have two black wires, just connect the one black wire you have to the controller.  It doesn't matter which of the two you connect to.

Here's a picture of the controller after I soldered in the new wire.  You can see the empty slot where the yellow wire was.

And here's a picture of the back side of the board, again note the empty hole where the yellow wire was.


Here's what the finished product looks like - an XBox controller with a USB plug.

In my next post I'll talk about loading the driver for Windows to recognize the controller.

Wednesday, December 12, 2012

Sugar

With kids in the house I find I'm more careful about reading labels in the grocery store.  No big surprise, pretty much everything has too much sugar in it.  But I recently came across several food items that shocked me.

Applesauce
I was shocked to learn that most applesauce brands add sugar.  It's so bad in fact that it's very difficult to find applesauce without added sugar or corn syrup, unless you're shopping at a healthfood store or someplace like Trader Joes.  Seriously, why do they add sugar to applesauce?  Isn't applesauce sweet enough without added sugar?  I guess the answer is no or else they wouldn't do it.

Peanut Butter
For a long time now I've only used "natural" peanut butter.  Natural peanut butter can be made with a single ingredient - peanuts.  Although sometimes they add salt or even a little bit of oil (to help stabilize it).  I was recently on a trip shopping in a major chain grocery store for peanut butter.  One major brand of natural peanut butter (I don't remember which one) boasted on the front of the label that it contained 90% peanuts.  Um, natural peanut butter should be 100% peanuts, so what is this other 10%, and why are they so proud of it?  Reading the ingredients the other 10% was sugar!  Seriously, they put sugar in peanut butter!?!  I couldn't believe it.

Monday, November 26, 2012

Computer Slideshow

I recently needed to create a slideshow of images on the computer set to music.  I've never created a slideshow before so I didn't even know what software to use.  Of course, I want free and/or open source whenever possible.  I researched software to use and I came across several good free pieces of software I wanted to share with others.

Microsoft Photo Story 3
Photo Story is the software I used to actually create the slideshow.  I was very impressed with this piece of software.  Very easy to use and it does a great job.  The finished product was very professional; panning and zooming slides, transitions effects, overlayed text, mixed audio track, etc.  And it's free.

Gimp
Some of the images for the slideshow needed editing; e.g. cropping, color correction, removal of certain elements, etc.  That's where Gimp (free open-source) came in very useful.  This extremely powerful image editor can do just about anything, once you've taken the time to learn this tool.

Audacity
I also needed to edit and mix the audio tracks together for the slideshow.  For this I used Audacity, a great free and open-source program.  Very easy to use, no steep learning curve with this program.

MP3MyMP3
One of the audio tracks I needed for the slideshow, I could not find the audio anywhere except in the background of a youtube video.  I tried to record it using Audacity but that apparently doesn't work for streaming audio/video.  Enter MP3MyMP3.  This free program (with a funny name) allows you to record the audio that is being played out of your sound card.  That may sound like a strange thing to do, but that's the best way to capture streaming audio.  This program worked great, my only complaint with this program was it's a skinned application and I don't particularly care for skinned apps.

VLC
I think the only downside to Photo Story is the output was in Microsoft's proprietary WMV format using a codec that few programs can use.  So I needed to convert this into something a little more common, like MP4.  Fortunately VLC (which I've talked about before) can play WMV using this codec and is even able to convert the file into other formats.

DVD Flick
With the slideshows saved as an MP4 file, I next needed to create a DVD from that video.  Doing some searches I came across DVD Flick.  This great free open-source project allows you to create DVD ISO images from existing video files (e.g. MP4).

ImgBurn
The final step is to burn the DVD ISO onto blank DVDs.  For this I used to tried and true ImgBurn.  Easily the best CD/DVD burning software I've come across.

So there you have it.  A 100% free way to create a slideshow and burn it onto a DVD.

Monday, November 5, 2012

Free Partition and File Management Software

Today I wanted to talk about some free partition and file management software that I think every computer techie should know about.  I've mentioned this before on my blog in other posts, but I wanted to highlight them in their own post.

Back in the last 90s into the early 2000s if you wanted to change partitions on a computer hard drive you typically had to back up all the data, blow away the partitions, create the new partitions, and restore the data - a process that took a long time.  So when this product called PartitionMagic from PowerQuest allowed you to restructure partitions without having to back up and restore the data came along, it seemed just like it's name... magic.  The thought of moving, resizing, changing the type, etc. of partitions on a computer with live data on them was unheard of.  Of course, PartitionMagic wasn't cheap for this cool feature.  Fast forward to today and now there are several good free options for moving, resizing, and otherwise editing partitions.  My favorite is Partition Wizard Home Edition.  This product is built on top of the Linux kernel and is available for download as a bootable CD.  There's also a Windows version, but I recommend the bootable Linux CD.  I use this tool a lot, both at home and work and I've never once had a problem.

Another similar utility is DiskCopy by EaseUS.  This tool allows you to clone partitions and disks which is great if you're replacing on hard drive with another.  I don't use this nearly as much as Partition Wizard, but it's a useful tool to keep around.

If you're looking to destroy data on your hard drive so you can sell/give away your hard drive, look no further than DBAN (Darik's Boot And Nuke).  DBAN is a bootable CD (or floppy) that will securely erase all data on your hard drive.  Most people don't know this, but deleting a file, even reformatting a hard drive, does NOT destroy the data.  There are tools out there that allow you (or someone else) to recover deleted data from a hard drive.  But if you use a tool like DBAN the data cannot be recovered.

Similar to DBAN is SDelete from SysInternals.  SDelete is a command line utility for Windows that allows you to securely delete a single file, multiple files, or entire directories.  If you need to wipe an entire disk use DBAN, but if you want to delete some files and not others, use SDelete.

And finally, assuming you accidentally deleted a file/folder and didn't use a tool like SDelete or DBAN, you can try and recover those files using a recovery tool.  My favorite is NTFSUndelete.

Thursday, November 1, 2012

How to crask WPA/WPA2 wireless routers

It's long been know that wireless routers with WEP might as well be wide open.  This form of "security" can be cracked in seconds or minutes.  That's why anyone with half a brain has their wireless router set to WPA/WPA2.  So imagine my surprise when I read an article recently detailing the steps to cracking WPA/WPA2 in under 10 hours.  What's more, it doesn't matter how long your wireless password is, whether you're using TKIP or AES, etc.  The hack uses a security flaw the gain access to the network.  Here's how to do it.

First, you need to download Backtrack Linux version 5 R2 or greater (version 5 R3 is the latest version as of writing this).  Download an ISO and burn that ISO onto a DVD.  Or if you wish you can follow their guide to create a bootable USB drive.

Next you need to boot your laptop off the DVD (or USB drive).  Thanks to Linux's live CD, you don't have to install Backtrack Linux, you can run it in memory.

Once Linux has loaded, run the command "iwconfig" to list available wireless adapters in your computer.  For most computers your wireless adapter will be "wlan0."

Next run "airmon-ng start wlan0" to place your wireless card into monitor mode.  Once successful, it will print out the name of your monitor session, which is typically "mon0."

Now we need to find the BSSID of the router you wish to attack.  Type "airodump-ng wlan0" to list available wireless networks.  (If this command fails, use "airodump-ng mon0" instead).  The first column is the BSSID.  Once you see your router, press Ctrl+C to stop the refreshing and write down the BSSID.

Now you're ready to attack.  Run the command "reaver -i mon0 -b BSSID -vv" where 'BSSID' is the value for your router.  Sit back and let it run.  This would be a good thing to run overnight as it can take upwards of 10 hours.


So how does this work you ask?  Well it takes advantage of a convenience feature called WPS or "WiFi Protected Setup."  WPS is a feature to allow you to add new devices to your network without having to type in the wireless password.  But as is usually the case, convenience and security are on opposite ends.  If you want convenience you give up security.  Me personally, I'd rather have a secure network, especially since I've never used WPS.  So the way to protect yourself from this attack is to disable WPS on your router.  But be warned, not all routers with WPS allow you to disable this feature.  What's more, some routers that do support disabling WPS are still vulnerable even when WPS is disabled (in other words disabling WPS doesn't truly disable WPS).  I was pleased to discover my new Linksys E3200 wireless router does allow me to disable WPS and I was not able to hack my wireless network.  Before you check your router's settings, I suggest you visit the manufacturers webpage and look for an updated firmware.

To learn more about this WPA/WPA2 crack, read this LifeHacker article.

Tuesday, October 30, 2012

How to cook rice

Whether you're having Asian, Indian, or Mexican food - a very common side dish is rice.  I feel like rice should be one of the easiest things in the world to cook, I mean there are literally billions of people in this world who eat rice with every meal.  But for whatever reason, rice has long been one of the hardest things for me to cook.  Every time I cooked rice it ended up as this sticky gooey substance that looked more like paste and less like food.  About a year ago I decided to do something about it and so I researched how to properly cook rice.  Ever since then I've been making rice worthy of serving in the finest of restaurants.  And I wanted to share the secrets with everyone.

Really it comes down to two tricks to yield perfect rice.

Step 1
Before you cook the rice, you need to rinse or wash the rice.  You can do this in a colander, sieve, or strainer.  The other method (what I do) is to wash the rice in the pot you're going to cook it in.  Place your rice in the pot and fill with lots of water.  Use your hands (or a spoon) to stir the rice.  Let the rice settle and pour out as much of the water as you can.  Then add the measured amount of water for cooking.

What you're doing in step 1 is removing the excess starch on the rice.  If you cook the rice without doing this the excess starch actually thickens the water as the rice cooks preventing all the water from evaporating cleanly.

Step 2
The second step, when the rice is cooking do NOT stir the rice.  Put the rice and water in a pot and bring to a boil.  Once it boils, turn the heat down to low and let it simmer.  But do NOT stir the rice during cooking.  If you stir the rice you release starch which again will result in a thick gooey mess.

If you follow these two simple steps you two will make wonderful rice you can be proud of.