Wednesday, March 24, 2010

How To: Hack a driver to support your hardware

Okay, so for some reason or another you want to install a driver that doesn't officially support your hardware. Maybe it's a (much cooler) driver for a competitor's product, maybe you can't find the driver and you happen to have another driver for a similar device, etc.

So whatever your reasons are, this is possible, though the results can't be guaranteed. Hardware has plenty of differences that require a very specific driver to ensure that it works properly. But if you don't have any other option, read on to find out how to hack support for your hardware into a driver!



Unpack the driver if it's in a zipped file. What you're going to be looking for is the .INF file, this is the file that tells the driver setup file the keys to place in the registry, and what hardware to support.

Open Device Manager. (If you're not sure how to do this, Google is your friend.) Right click on the device you want to install the drivers for, select Properties, click the Details tab. Select Hardware ID from the list, and copy the value out of that window.

Open the .INF file, Windows calls it a "Setup Information" file. Do this in Wordpad or Notepad. You're looking for a line or multiple lines that contain hardware IDs.

Here's an example out of some Symantec Drivers; in this example the hardware ID is the 7 digit alphanumeric preceded by an asterisk.

[SynMfg.NTamd64]
%PS2.SynCompatibleDeviceDesc% = HP__2000__PS2_Inst,*PNP0F13
%PS2.SynCompatibleDeviceDesc% = HP__2000__PS2_Inst,*SYN0002
%PS2.SynCompatibleDeviceDesc% = HP__2000__PS2_Inst,*SYN2000
%PS2.SynDeviceDesc% = HP_ALT_GROUP8_PS2_Inst,*SYN012D
%PS2.SynDeviceDesc% = HP_ALT_GROUP9_PS2_Inst,*SYN012E
%PS2.SynDeviceDesc% = HP_ALT_GROUP3_PS2_Inst,*SYN0137

In this example, the Symantec driver has different profiles for its driver based upon what device is installed. Some drivers may only support a single piece of hardware, or have a few different IDs on a single line separated by commas. In this example, I'd want to probably find out which hardware ID is most similar to my own, so that I don't have driver features enabled or disabled that aren't relevant to my device, and to ensure the best compatibility.

Start another line with the best match for your hardware and including your hardware ID (%something% = somethingelse, YourHardwareID). My touchpad is an ELAN model with hardware ID "*ETD0001" so I would want to add a line like this into the above .INF file:

%PS2.SynDeviceDesc% = HP_ALT_GROUP8_PS2_Inst,*ETD0001

Now, remember that "HP_ALT_GROUP8_PS2_Inst" is a profile (or template if you will) for the driver to use for that device. I might need to use some trial and error to find a profile that will work well with my device, but many drivers just use the same profile for all devices they support and thus you won't need to worry about it.

Now you save the file, and launch the Setup.exe. The driver should now install. Your mileage may vary; certain features in the driver may not function, errors may occur, etc. But if the hardware is a close enough match, you may find yourself pleasantly surprised with the results!

Good luck!

No comments:

Post a Comment