Android - How to downgrade an HTC Desire to stock version?

I finally succeeded !! (YOUHOU!! You can't believe how proud I am !)

First of all, I want to indicate that links on XDA (those that goes in multiupload.com, that redirect to lnx.lu), SUCKS! I can't believe it. You have to download a "download manager", with so many related ads and apps you must install. It's a shame. (I am very angry agains't them (lnx.lu) for wasting my time just because they are greedy).

Now, the real answer !

You need to downgrade your hboot version before running the RUU rom, for that, it's quite easy :

First, you choose your ROM on that page, and notice the ROM version

Then, you go here (if the link is down, you can download the source code here!) and define the CID and the ROM version.

For the CID, if you don't know it, just set to 11111111 or HTC__022. If you want to try something more precise, you can try the one related to your carrier from this link.

Keep the download file to a specific directory (for this case, it will be /tmp/mtd0.img).

Now you need the flash_image tool, if you can't find one, here's a link. Download it to /tmp/flash_image

Now some command line. For that, you'll need the Android SDK and a correct USB driver (adb should return a device when connected, with debug on).

Do these commands :

// go to the sdk/platform-tools/ dir
adb push /tmp/flash_image /data/flash_image
adb push /tmp/mtd0.img /data/mtd0.img

// Make sure those files were updated with :
adb shell ls /data

// Then run
adb shell

// You will be in your terminal's shell, now do these commands :

chmod 755 /data/flash_image
/data/flash_image misc /data/mtd0.img

CTRL+C // To quit the terminal's shell and go back to your computer shell

// Now reboot to RUU mode
adb reboot oem-78

Once the phone is on RUU mode (showing a grey HTC logo), run the .exe rom you downloaded previously, wait for it to finish, and voilà! You're done ! :)

Here's the doc I followed for the commands.