PDA

View Full Version : How to patch drivers (on WM5) ?


TheBlasphemer
20th February 2006, 12:48 PM
Hi,

I'm trying to patch the keyboard driver on my HTC Universal to still work if the clam is closed.
I patched one byte in the dll to change the return value of a specific function, and re-signed it using some kind of signing package with the sign.bat.
However, upon copying it to my device, after a soft-reset it seems like the keyboard driver just wouldn't load.
None of the keys worked, and in the start menu all shortcuts with shortkeys were prefixed with a & character.

Is there anything special I need to do to get this driver to load ?

Thanks,
TB

undergrid
20th February 2006, 12:54 PM
We have seen the same thing. As I understand it, under WM5 drivers have to be signed to be loaded, by changing the byte you've probably invalidated the signing on the DLL thus stopping it loading.

TheBlasphemer
20th February 2006, 12:56 PM
We have seen the same thing. As I understand it, under WM5 drivers have to be signed to be loaded, by changing the byte you've probably invalidated the signing on the DLL thus stopping it loading.

As I said, I (tried to) re-sign it using some kind of sign.bat :P
Source of sign.bat is:

@echo off
if "%1" == "" goto oops
if not exist %1 goto oops2
signcode -spc TestCert_Privileged.cer -v TestCert_Privileged.pvk %1
goto exit
:oops
echo Usage: sign [filename]
goto exit
:oops2
echo %1 not found.
echo.
:exit

levenum
20th February 2006, 03:50 PM
You have to make sure that the certificate is known to the device.
Even test certificates that come with MS Visual studio need to be registered on the device before you can use them.
Search this forum on how to add certificates to devices (there are several threads on this)

TheBlasphemer
20th February 2006, 04:56 PM
Got tired of trying to import a patched keybddr.dll,
So instead I wrote an app to patch the driver when already loaded, mwuhahaha!