[Desire HD General] androidmodd:
Aahk2 is out please use that method instead, fully automated and much easier :) :

http://xdaforums.com/showthread.php?t=2367322

Warning thanks to hacktrix2006:

THIS GUIDE IS MAINLY this guide (http://tau.shadowchild.nl/attn1/?cat=6) SIMPLIFIED TO SOME EXTENT. with parts that werent included in the guide added to the guide and resources added to the ace-tools folder that would have to be downloaded separately.

PREFACE:

Download this and unzip it somewhere (reccommend C:\ root folder): http://www.multiupload.nl/MXW371YT87

Full HTC Desire HD guide to root, S-OFF/Sim Unlock

1.Unlock the bootloader at http://htcdev.com/bootloader/

2.Copy your Unlock_code.bin file that you got in the email to the ace-tools folder.

step 2.2: reboot into fastboot

step 2.3: execute in cmd-prompt "fastboot flash unlocktoken Unlock_code.bin"

3.Download rooted stock rom: http://www.multiupload.nl/20T9R21IGY

(link to rom thread: http://xdaforums.com/showthread.php?t=1382235&highlight=rooted+stock )

step 3.2 Make a effen GOLDCARD!!!

3.3 copy the ROM zip file to your SD card.

4.Install recovery image:

Open cmd and type:

•cd (eg cd C:\ace-tools)

Ensure your phone is connected to your PC and then boot into bootloader, then navigate to fastboot.

In cmd:

•fastboot flash recovery recovery1.img

5.boot into recovery through bootloader and Install the ROM you placed on the SD card, (via install zip fileselect the rom zip)

6.Reboot the phone, ensure the rom is working fine and you have root access you can test this by turning on usb debugging then:

•Adb shell

•Su

You should see the $ turn into a #. If this happens, congrats you have root access.

Then type this:

•Exit

Then again:

•Exit

Then:

•Adb push boot.img /data/local/tmp

•adb shell

root

dd if=/dev/block/mmcblk0p22 of=/data/local/tmp/boot.img

•adb pull /data/local/tmp/boot.img

•adb push goldcard /data/local/tmp

•adb shell

root

chmod 775 /data/local/tmp/goldcard

•adb shell

root

cat /sys/class/mmc_host/mmc2/mmc2:*/cid

take note of the string of numbers and letters that appear.

then:

•adb shell /data/local/tmp/goldcard -c -o /data/local/tmp/goldcard.img

•adb shell

root

dd if=/data/local/tmp/goldcard.img of=/dev/block/mmcblk1

•adb push misc_version /data/local/tmp

•adb shell chmod 775 /data/local/tmp/misc_version

•adb shell /data/local/tmp/misc_version -s 1.11.111.1

7.If this is all fine boot into bootloader again.

From bootloader go to fastboot.

Go back to the cmd window on your PC from earlier, type in:

•Fastboot oem lock

Then type:

•fastboot oem rebootRUU

•fastboot flash zip firmware.zip

•fastboot reboot-bootloader

unlock the bootloader again using the Unlock_code.bin you got from HTC:

•fastboot flash unlocktoken Unlock_code.bin

then flash boot.img in ace-tools folder:

•fastboot flash boot boot.img

next:

•fastboot flash recovery recovery.img

8.boot to recovery again then:

•adb push gfree /tmp/

•adb shell chmod 775 /tmp/gfree

•adb shell /tmp/gfree -f

reboot to bootloader and you should see it says S-OFF at the top of the screen, if It does congrats your done.

VICTORY:

View attachment 1858622

I have also posted this over at modaco:

http://www.modaco.com/topic/361797-...-30android-235-guide-to-root-s-offsim-unlock/