[HOW TO] Really go back to HTC stock ROM and solve boot problems - noob guide

Search This thread

razvangrig

Senior Member
Sep 30, 2014
110
39
Bucharest
I managed to solve boot problems with broken Desire 500 HTC's (not booting, orange led blinking, vibrating 7 times etc.)
Just put your phone without battery in a ziplock bag in the freezer for 1 hour (not kidding). Let it sit for another 1/2 hour at room temperature, then insert battery and try booting into fastboot. If it doesn't work, remove battery and try again in half hour. Try until it boots, I tried about 15 times before I managed to boot into fastboot mode. So don't give up. After you manage to boot into fastboot mode, follow this guide to restore your phone functionality.

Works for:
HTC Desire 500 and maybe other HTC phones

If you are on Windows 7, skip this next step. To install ADB and Fastboot drivers on Windows 8 and 10, forum member @kmark23 posted the following solution:

1. Uninstall all drivers for HTC phone
2. Install latest HTC Sync Manager
3. Connect phone in normal mode
4. Connect phone in fastboot mode (system reports unrecognized device)
5. Run regedit as administrator
6. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags
7. Right-click on usbflags, click new > key, name it 0BB40FF00100
8. Select 0BB40FF00100 and in the right window right click > new > binary value
9. Rename created binary value to SkipBOSDescriptorQuery
10. Right click SkipBOSDescriptorQuery > modify binary data, type 01 00 00 00 , click ok
11. Unplug usb cable and plug again.
12. In fastboot cmd window type fastboot devices, press enter and see if your device is listed

Connect your phone directly to the PC and don't use a USB 3.0 port, only 2.0

Links for download are down the page

Your battery should be at least 40% charged before doing this. And of course, do everything at your own risk, I am not responsible for any bricked devices.

INSTRUCTIONS:

Z4U = single sim
Z4DUG = dual sim

Download 0P3ZIMG HTC Europe or Asia for your phone (single or dual sim) and region
If you want to use the RUU files instead, your bootloader must be locked. Instructions on how to relock the bootloader are below. After that, just run the RUU file as admin on your pc and follow on screen istructions, but your phone must have the correct CID (country ID) for the region the RUU is intended for, or else it won't install. If the RUU installer force closes click here for the solution.
You can also extract the ROM file from the RUU then flash it using fastboot, just like 0P3ZIMG files in this guide. To extract the ROM file, run the RUU as admin and after the install wizard don't click nothing, just let the window opened. Click windows Start and in the search box type %temp% and go to the folder. While in temp folder, in the search window in windows explorer type rom.zip and press enter. Copy the file rom.zip to your fastboot folder and use it like 0P3ZIMG files described next in this guide.

Uninstall old usb drivers for HTC, Samsung Kies, and other similar phone software or drivers.
Download and install Java Runtime Environment
Download and install android SDK Tools. After installation is complete, a window will pop-up. Check only platform tools and Google usb driver and download.
Download and install HTC Sync Manager
Download fastboot binaries and extract fastboot-win.zip in a folder on the desktop
Browse to Program Files (x86)\Android\android-sdk\platform-tools and copy files AdbWinApi.dll, AdbWinUsbApi.dll and adb.exe to fastboot-win folder you extracted on the desktop
Reboot your pc.
1. Copy the file 0P3ZIMG for HTC Europe or Asia to fastboot-win folder on the desktop. Rename copied file to Z4DUGIMG.img or Z4UIMG.img, depending on your phone.
2. Inside the fastboot-win folder on the desktop, holding down the shift key, right click on an empty space and then click open command window here
3. Boot your phone in fastboot mode (hold Power and vol – keys)
4. Connect phone to the pc with a good data cable. You should see Fastboot usb on your phone screen and a driver installing on your pc.
5. On the command window opened earlier, type fastboot devices. A device should be listed.
6. Next, on the command window, write the following commands:
fastboot oem lock – wait for the phone to restart, and on the phone screen you should see *Relocked*
type fastboot oem rebootRUU - your phone will go to a black screen with the HTC logo
type fastboot flash zip Z4DUGIMG.zip or fastboot flash zip Z4UIMG.img, depending on your phone
wait, the process is very long. DON’T DO ANYTHING UNTIL IT FINISHES COMPLETELY
After the process is totally completed, type fastboot reboot
Done.

After restoring the whole system, if you still want to root your phone, unlock your bootloader and install ONLY this recovery and latest SuperSU:
PhilZ Touch Recovery 6.59.0
SuperSU

Java Runtime Environment

Android SDK Tools- download and install windows.exe file

HTC Sync Manager

Fastboot binaries

ROM files
 
Last edited:

micko9854

Member
Oct 18, 2014
28
5
I managed to solve boot problems with broken Desire 500 HTC's (not booting, orange led blinking, vibrating 7 times etc.)
Just put your phone without battery in a ziplock bag in the freezer for 1 hour (not kidding). Let it sit for another 1/2 hour at room temperature, then insert battery and try booting into fastboot. If it doesn't work, remove battery and try again in half hour. Try until it boots, I tried about 15 times before I managed to boot into fastboot mode. So don't give up. After you manage to boot into fastboot mode, follow this guide to restore your phone functionality.

Works for:
HTC Desire 500

If you are on Windows 7, skip this next step. To install ADB and Fastboot drivers on Windows 8 and 10, forum member @kmark23 posted the following solution:

1. Uninstall all drivers for HTC phone
2. Install latest HTC Sync Manager
3. Connect phone in normal mode
4. Connect phone in fastboot mode (system reports unrecognized device)
5. Run regedit as administrator
6. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags
7. Right-click on usbflags, click new > key, name it 0BB40FF00100
8. Select 0BB40FF00100 and in the right window right click > new > binary value
9. Rename created binary value to SkipBOSDescriptorQuery
10. Right click SkipBOSDescriptorQuery > modify binary data, type 01 00 00 00 , click ok
11. Unplug usb cable and plug again.
12. In fastboot cmd window type fastboot devices, press enter and see if your device is listed


Links for download are down the page

Your battery should be at least 40% charged before doing this. And of course, do everything at your own risk, I am not responsible for any bricked devices.

INSTRUCTIONS:

Z4U = single sim
Z4DUG = dual sim

Download 0P3ZIMG HTC Europe or Asia for your phone (single or dual sim) and region
If you want to use the RUU files instead, your bootloader must be locked. Instructions on how to relock the bootloader are below. After that, just run the RUU file as admin on your pc and follow on screen istructions, but your phone must have the correct CID (country ID) for the region the RUU is intended for, or else it won't install. If the RUU installer force closes see http://forum.xda-developers.com/showpost.php?p=53081344&postcount=94 for solution.
You can also extract the ROM file from the RUU then flash it using fastboot, just like 0P3ZIMG files in this guide. To extract the ROM file, run the RUU as admin and after the install wizard don't click nothing, just let the window opened. Click windows Start and in the search box type %temp% and go to the folder. While in temp folder, in the search window in windows explorer type rom.zip and press enter. Copy the file rom.zip to your fastboot folder and use it like 0P3ZIMG files described next in this guide.

Uninstall old usb drivers for HTC, Samsung Kies, and other similar phone software or drivers.
Download and install Java Runtime Environment
Download and install android SDK Tools. After installation is complete, a window will pop-up. Check only platform tools and Google usb driver and download.
Download and install HTC Sync Manager
Download fastboot binaries and extract fastboot-win.zip in a folder on the desktop
Browse to Program Files (x86)\Android\android-sdk\platform-tools and copy files AdbWinApi.dll, AdbWinUsbApi.dll and adb.exe to fastboot-win folder you extracted on the desktop
Reboot your pc.
1. Copy the file 0P3ZIMG for HTC Europe or Asia to fastboot-win folder on the desktop. Rename copied file to Z4DUGIMG.img or Z4UIMG.img, depending on your phone.
2. Inside the fastboot-win folder on the desktop, holding down the shift key, right click on an empty space and then click open command window here
3. Boot your phone in fastboot mode (hold Power and vol – keys)
4. Connect phone to the pc with a good data cable. You should see Fastboot usb on your phone screen and a driver installing on your pc.
5. On the command window opened earlier, type fastboot devices. A device should be listed.
6. Next, on the command window, write the following commands:
fastboot oem lock – wait for the phone to restart, and on the phone screen you should see *Relocked*
type fastboot oem rebootRUU - your phone will go to a black screen with the HTC logo
type fastboot flash zip Z4DUGIMG.zip or fastboot flash zip Z4UIMG.img, depending on your phone
wait, the process is very long. DON’T DO ANYTHING UNTIL IT FINISHES COMPLETELY
After the process is totally completed, type fastboot reboot
Done.

Java Runtime Environment:
http://java.com/en/

Android SDK Tools - download and install file installer_r24.4.1-windows.exe
http://developer.android.com/sdk/index.html#Other

HTC Sync Manager
http://www.htc.com/us/software/htc-sync-manager/

Download fastboot binaries:
https://www.htcdev.com/process/legal_fastboot_win

ROM files
http://forum.gsmhosting.com/vbb/f485/htc-mtk-spd-qualcomm-cpu-flash-files-jamesjerss-updated-02-10-2015-a-1949859/#post11057152

Does this solve problem with vibrations from rumrunner proto 0.71 S-OFF or vibrations still stay?And can i use only disabled driver signature enforcement on windows 8.1 without modifying registry i run windows 8.1 on BIOS not UEFI and have legacy boot mode so i can on F8 select disable driver signature enforcement on number 7.
 
Last edited:

razvangrig

Senior Member
Sep 30, 2014
110
39
Bucharest
This should solve any software caused problems, since it rewrites the bootloader, radio, recovery, system partition and data partition. Your phone will be S-ON and unrooted, just like it came from the factory. I don't know about the driver signature enforcement on windows 8.1, I didn't try it. I only tested the above solution on windows 10, both Legacy and UEFI boot.
If you are S-OFF you can use any RUU .exe file if you do this:
Boot into fastboot mode, enter the command "fastboot oem readcid". Make a note of your original CID.
Enter the command "fastboot oem writecid 11111111
Enter the command "fastboot read cid" - it should confirm your CID is 11111111
Reboot the bootloader.
Don't forget, before you flash the RUU you have to relock the bootloader with fastboot oem lock command
 
Last edited:
  • Like
Reactions: TheRealJoker31

sharleyP

New member
Nov 6, 2015
2
0
It doesn't work. After I type fastboot flash zip Z4UIMG.img i get an error "FAILED (remote: 12 signature verify fail)".
 

razvangrig

Senior Member
Sep 30, 2014
110
39
Bucharest
It doesn't work. After I type fastboot flash zip Z4UIMG.img i get an error "FAILED (remote: 12 signature verify fail)".

Your bootloader must be locked before you flash
Your must flash the file matching your phone CID, otherwise it won't install. HTC signed encrypted files check the country id and firmware version before they install. So you can not downgrade the firmware, only upgrade it. Try the RUU_Z4_DUG_Asia file if the European does not work. Check your phone CID with fastboot oem readcid and see for wich country your phone is.
 
Last edited:
  • Like
Reactions: TheRealJoker31

sharleyP

New member
Nov 6, 2015
2
0
Your bootloader must be locked before you flash
Your must flash the file matching your phone CID, otherwise it won't install. HTC signed encrypted files check the country id and firmware version before they install. So you can not downgrade the firmware, only upgrade it. Try the RUU_Z4_DUG_Asia file if the European does not work. Check your phone CID with fastboot oem readcid and see for wich country your phone is.

Bootloader is locked. I performed all steps form your instruction. I tried Asian file but it also does not work - same error. My CID is HTC__032 - Eastern Europe.
 
Last edited:

razvangrig

Senior Member
Sep 30, 2014
110
39
Bucharest
Bootloader is locked. I performed all steps form your instruction. I tried Asian file but it also does not work - same error. My CID is HTC__032 - Eastern Europe.

When you connect your phone, don't use a USB3.0 port, only 2.0. I have the same CID as you and had no error flashing European HTC file. Try with the bootloader unlocked, try another data cable, remove phone battery and start the process again. You can copy Z4DUGIMG to your SD card and reboot the phone in fastboot. Hboot scans the SD card, and the update should automatically begin, but I haven't tried this. As a last solution, use Rumrunner s-off to get s-off (works with Desire 500). After S-OFF write your CID with command "fastboot oem writecid 11111111" (SuperCID) and you should be able to install any HTC firmware for this phone.
 
Last edited:
  • Like
Reactions: TheRealJoker31
Jul 11, 2015
39
1
Stuttgart
When you connect your phone, don't use a USB3.0 port, only 2.0. I have the same CID as you and had no error flashing European HTC file. Try with the bootloader unlocked, try another data cable, remove phone battery and start the process again. You can copy Z4DUGIMG to your SD card and reboot the phone in fastboot. Hboot scans the SD card, and the update should automatically begin, but I haven't tried this. As a last solution, use Rumrunner s-off to get s-off (works with Desire 500). After S-OFF write your CID with command "fastboot oem writecid 11111111" (SuperCID) and you should be able to install any HTC firmware for this phone.

I got the CID HTC__102 and i f*cked up my phone. I didn't done a Backup. I tried to Flash James Rom and the U.F.O Rom, but it failed with unlocked bootloader and S-ON... I have Radio-14.16.36Q4.22
I tried it with the Ruu Asian Version, but it doesn't sends/loads the 5 Files to my Phone... It just goes on and on, over 10 minutes... there are just the dots .. , ... , .... , .... , ..... , ...... , and so on.
I relocked it before trying the Ruu Thing. Bootloader Shows Relocked. I got TWCM installed an having the Single Sim Version from Germany :)
I hope you can help me! Thanks very much :)

I Forget to say, that i can see my device with fastboot devices, but i got a couple of Errors trying to install al the roms, i done also the Complete Wipes. And i got no OS installed!!
 
Last edited:

razvangrig

Senior Member
Sep 30, 2014
110
39
Bucharest
I got the CID HTC__102 and i f*cked up my phone. I didn't done a Backup. I tried to Flash James Rom and the U.F.O Rom, but it failed with unlocked bootloader and S-ON... I have Radio-14.16.36Q4.22
I tried it with the Ruu Asian Version, but it doesn't sends/loads the 5 Files to my Phone... It just goes on and on, over 10 minutes... there are just the dots .. , ... , .... , .... , ..... , ...... , and so on.
I relocked it before trying the Ruu Thing. Bootloader Shows Relocked. I got TWCM installed an having the Single Sim Version from Germany :)
I hope you can help me! Thanks very much :)

I Forget to say, that i can see my device with fastboot devices, but i got a couple of Errors trying to install al the roms, i done also the Complete Wipes. And i got no OS installed!!

Have you tried flashing the 0P3ZIMG Z4_U HTC Europe using fastboot commands and didn't work? Have you used a usb 2.0 port?
Check out this thread also and try the roms there for your hboot version
 
Last edited:

razvangrig

Senior Member
Sep 30, 2014
110
39
Bucharest
Yes, Sir. Tried that already. I am using USb2.0 Ports, yeah.

The =P3ZIMG Z4_U HTC Europe is the first one from the Forum-site you send or? The one with ~689MB?
Trying it again now, adding a Screenshot

http://www.xup.in/dl,66261527/HTC_FLASH.PNG/

Download the European RUU Z4_U (not the 0P3ZIMG). Run the RUU on your computer until the wizard comes up. While the RUU wizard is open, open Explorer in Windows and type %temp% in the navigation bar. There will be two folders with long encrypted names. In one of them you will find ROM.zip. Open it with 7zip and extract recovery.img or recovery_signed.img. Put it in the location were you've installed Android SDK tools. This is the stock HTC recovery and it is needed to run the RUU. Boot the phone into bootloader (power off, hold down volume and press power) and highlight FASTBOOT using the volume rocker and pressing power. Then connect the USB cable. You should see FASTBOOT USB.
Unlock your bootloader
Open a command prompt in ADB folder. Flash the stock recovery extracted in step 3 above using the following command:
fastboot flash recovery recovery.img or fastboot flash recovery recovery_signed.img
Relock the bootloader using the following command:
fastboot oem lock
Re-run the RUU on your PC
 
Jul 11, 2015
39
1
Stuttgart
Download the European RUU Z4_U (not the 0P3ZIMG). Run the RUU on your computer until the wizard comes up. While the RUU wizard is open, open Explorer in Windows and type %temp% in the navigation bar. There will be two folders with long encrypted names. In one of them you will find ROM.zip. Open it with 7zip and extract recovery.img or recovery_signed.img. Put it in the location were you've installed Android SDK tools. This is the stock HTC recovery and it is needed to run the RUU. Boot the phone into bootloader (power off, hold down volume and press power) and highlight FASTBOOT using the volume rocker and pressing power. Then connect the USB cable. You should see FASTBOOT USB.
Unlock your bootloader
Open a command prompt in ADB folder. Flash the stock recovery extracted in step 3 above using the following command:
fastboot flash recovery recovery.img or fastboot flash recovery recovery_signed.img
Relock the bootloader using the following command:
fastboot oem lock
Re-run the RUU on your PC

For me ist not: recovery_signed, ist boot_signed, flashed it with the command: fastboot Flash recovery boot_signed.img , went fine, and then fastboot oem lock while in fastboot it restarted and showed above again Relocked, and then started RUU again and it's doing the same Thing, it just don't proceeds, it stays at 0/5 files.
EDIT: I didn't said that my phone Shows the black Background with silver/White HTC Logo during this try to send the 5 files, or whatever it tries to do...
 
Last edited:

razvangrig

Senior Member
Sep 30, 2014
110
39
Bucharest
For me ist not: recovery_signed, ist boot_signed, flashed it with the command: fastboot Flash recovery boot_signed.img , went fine, and then fastboot oem lock while in fastboot it restarted and showed above again Relocked, and then started RUU again and it's doing the same Thing, it just don't proceeds, it stays at 0/5 files.

I think there is a problem with your fastboot drivers or with the data cable you are using. I will try to get the recovery.img for your phone. What is your Hboot ver.?
 
Last edited:
  • Like
Reactions: TheRealJoker31
Jul 11, 2015
39
1
Stuttgart
For me ist not: recovery_signed, ist boot_signed, flashed it with the command: fastboot Flash recovery boot_signed.img , went fine, and then fastboot oem lock while in fastboot it restarted and showed above again Relocked, and then started RUU again and it's doing the same Thing, it just don't proceeds, it stays at 0/5 files.

I think there is a problem with your fastboot drivers or with the data cable you are using. I will try to get the recovery.img for your phone. What is your Hboot ver.?

Okay thank you. I got HBOOT-1.03.0001
 

razvangrig

Senior Member
Sep 30, 2014
110
39
Bucharest
Okay thank you. I got HBOOT-1.03.0001

Download ROM for hBoot 1.03 Build 1.34.401.1
Download firmware_1.34.401.1

Put ROM file on sd-card
Put firmware file in fastboot folder and rename to "firmware.zip"
Boot into CWM or TWRP recovery
Make full wipe (data, cache, system, dalvik cache)
Install the ROM zip file from SD-card
Reboot the phone in bootloader
Connect your device on PC
Enter next commands:

fastboot oem rebootRUU
fastboot flash zip firmware.zip
fastboot reboot
 
  • Like
Reactions: TheRealJoker31
Jul 11, 2015
39
1
Stuttgart
Download ROM for hBoot 1.03 Build 1.34.401.1
Download firmware_1.34.401.1

Put ROM file on sd-card
Put firmware file in fastboot folder and rename to "firmware.zip"
Boot into CWM or TWRP recovery
Make full wipe (data, cache, system, dalvik cache)
Install the ROM zip file from SD-card
Reboot the phone in bootloader
Connect your device on PC
Enter next commands:

fastboot oem rebootRUU
fastboot flash zip firmware.zip
fastboot reboot

Should the Bootloader be locked or unlocked during that process?
I think Unlocked, else i can't install TWRP/CWM
 

razvangrig

Senior Member
Sep 30, 2014
110
39
Bucharest
Last edited:
  • Like
Reactions: TheRealJoker31
Jul 11, 2015
39
1
Stuttgart
Before you install the ROM from sd-card using CWM, your bootloader needs to be unlocked
Before flashing firmware.zip using fastboot, you need to relock the bootloader

Unlocked it, installed TWRP, Wiped but it failed, maybe cause there were no Folder like /data /System, started to install it from the zip.


Formatting User Data
Formatting Cache
Formatting System
Writting Data
Flashing System
EDIT:
Flashing Boot
Flashing Recovery
Setting Symlinks and permissions
Unmount System
Unmount Data
Unmount Cache
Install complete!
Please reboot your System.
updating Partition Details....
E: Unable to Mount /data ; /system ; /devlog

Okay, i rebooted, it started, works now. What is with the Firmware zip?
Should i Flash it? And i would like to Flash a ROM, i think every ROM is better than the Stock.
But which Rom should i use? did you tried one?
I just want WhatsApp and a Performance boost, while waiting 40days on the Nexus 6p, Sir! :)
Thank you very much!!!!
 
Last edited:

razvangrig

Senior Member
Sep 30, 2014
110
39
Bucharest
Okay, i rebooted, it started, works now. What is with the Firmware zip?
Should i Flash it? And i would like to Flash a ROM, i think every ROM is better than the Stock.
But which Rom should i use? did you tried one?
I just want WhatsApp and a Performance boost, while waiting 40days on the Nexus 6p, Sir! :)
Thank you very much!!!!

firmware.zip rewrites all partitions (hboot, radio, recovery etc) and turns your phone back to stock, unrooted and s-off

Don't know about wich rom is better, I know only 2 roms for single sim, UFO and james Rom. My desire 500 is dual sim
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    I managed to solve boot problems with broken Desire 500 HTC's (not booting, orange led blinking, vibrating 7 times etc.)
    Just put your phone without battery in a ziplock bag in the freezer for 1 hour (not kidding). Let it sit for another 1/2 hour at room temperature, then insert battery and try booting into fastboot. If it doesn't work, remove battery and try again in half hour. Try until it boots, I tried about 15 times before I managed to boot into fastboot mode. So don't give up. After you manage to boot into fastboot mode, follow this guide to restore your phone functionality.

    Works for:
    HTC Desire 500 and maybe other HTC phones

    If you are on Windows 7, skip this next step. To install ADB and Fastboot drivers on Windows 8 and 10, forum member @kmark23 posted the following solution:

    1. Uninstall all drivers for HTC phone
    2. Install latest HTC Sync Manager
    3. Connect phone in normal mode
    4. Connect phone in fastboot mode (system reports unrecognized device)
    5. Run regedit as administrator
    6. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags
    7. Right-click on usbflags, click new > key, name it 0BB40FF00100
    8. Select 0BB40FF00100 and in the right window right click > new > binary value
    9. Rename created binary value to SkipBOSDescriptorQuery
    10. Right click SkipBOSDescriptorQuery > modify binary data, type 01 00 00 00 , click ok
    11. Unplug usb cable and plug again.
    12. In fastboot cmd window type fastboot devices, press enter and see if your device is listed

    Connect your phone directly to the PC and don't use a USB 3.0 port, only 2.0

    Links for download are down the page

    Your battery should be at least 40% charged before doing this. And of course, do everything at your own risk, I am not responsible for any bricked devices.

    INSTRUCTIONS:

    Z4U = single sim
    Z4DUG = dual sim

    Download 0P3ZIMG HTC Europe or Asia for your phone (single or dual sim) and region
    If you want to use the RUU files instead, your bootloader must be locked. Instructions on how to relock the bootloader are below. After that, just run the RUU file as admin on your pc and follow on screen istructions, but your phone must have the correct CID (country ID) for the region the RUU is intended for, or else it won't install. If the RUU installer force closes click here for the solution.
    You can also extract the ROM file from the RUU then flash it using fastboot, just like 0P3ZIMG files in this guide. To extract the ROM file, run the RUU as admin and after the install wizard don't click nothing, just let the window opened. Click windows Start and in the search box type %temp% and go to the folder. While in temp folder, in the search window in windows explorer type rom.zip and press enter. Copy the file rom.zip to your fastboot folder and use it like 0P3ZIMG files described next in this guide.

    Uninstall old usb drivers for HTC, Samsung Kies, and other similar phone software or drivers.
    Download and install Java Runtime Environment
    Download and install android SDK Tools. After installation is complete, a window will pop-up. Check only platform tools and Google usb driver and download.
    Download and install HTC Sync Manager
    Download fastboot binaries and extract fastboot-win.zip in a folder on the desktop
    Browse to Program Files (x86)\Android\android-sdk\platform-tools and copy files AdbWinApi.dll, AdbWinUsbApi.dll and adb.exe to fastboot-win folder you extracted on the desktop
    Reboot your pc.
    1. Copy the file 0P3ZIMG for HTC Europe or Asia to fastboot-win folder on the desktop. Rename copied file to Z4DUGIMG.img or Z4UIMG.img, depending on your phone.
    2. Inside the fastboot-win folder on the desktop, holding down the shift key, right click on an empty space and then click open command window here
    3. Boot your phone in fastboot mode (hold Power and vol – keys)
    4. Connect phone to the pc with a good data cable. You should see Fastboot usb on your phone screen and a driver installing on your pc.
    5. On the command window opened earlier, type fastboot devices. A device should be listed.
    6. Next, on the command window, write the following commands:
    fastboot oem lock – wait for the phone to restart, and on the phone screen you should see *Relocked*
    type fastboot oem rebootRUU - your phone will go to a black screen with the HTC logo
    type fastboot flash zip Z4DUGIMG.zip or fastboot flash zip Z4UIMG.img, depending on your phone
    wait, the process is very long. DON’T DO ANYTHING UNTIL IT FINISHES COMPLETELY
    After the process is totally completed, type fastboot reboot
    Done.

    After restoring the whole system, if you still want to root your phone, unlock your bootloader and install ONLY this recovery and latest SuperSU:
    PhilZ Touch Recovery 6.59.0
    SuperSU

    Java Runtime Environment

    Android SDK Tools- download and install windows.exe file

    HTC Sync Manager

    Fastboot binaries

    ROM files
    1
    This should solve any software caused problems, since it rewrites the bootloader, radio, recovery, system partition and data partition. Your phone will be S-ON and unrooted, just like it came from the factory. I don't know about the driver signature enforcement on windows 8.1, I didn't try it. I only tested the above solution on windows 10, both Legacy and UEFI boot.
    If you are S-OFF you can use any RUU .exe file if you do this:
    Boot into fastboot mode, enter the command "fastboot oem readcid". Make a note of your original CID.
    Enter the command "fastboot oem writecid 11111111
    Enter the command "fastboot read cid" - it should confirm your CID is 11111111
    Reboot the bootloader.
    Don't forget, before you flash the RUU you have to relock the bootloader with fastboot oem lock command
    1
    It doesn't work. After I type fastboot flash zip Z4UIMG.img i get an error "FAILED (remote: 12 signature verify fail)".

    Your bootloader must be locked before you flash
    Your must flash the file matching your phone CID, otherwise it won't install. HTC signed encrypted files check the country id and firmware version before they install. So you can not downgrade the firmware, only upgrade it. Try the RUU_Z4_DUG_Asia file if the European does not work. Check your phone CID with fastboot oem readcid and see for wich country your phone is.
    1
    Bootloader is locked. I performed all steps form your instruction. I tried Asian file but it also does not work - same error. My CID is HTC__032 - Eastern Europe.

    When you connect your phone, don't use a USB3.0 port, only 2.0. I have the same CID as you and had no error flashing European HTC file. Try with the bootloader unlocked, try another data cable, remove phone battery and start the process again. You can copy Z4DUGIMG to your SD card and reboot the phone in fastboot. Hboot scans the SD card, and the update should automatically begin, but I haven't tried this. As a last solution, use Rumrunner s-off to get s-off (works with Desire 500). After S-OFF write your CID with command "fastboot oem writecid 11111111" (SuperCID) and you should be able to install any HTC firmware for this phone.
    1
    For me ist not: recovery_signed, ist boot_signed, flashed it with the command: fastboot Flash recovery boot_signed.img , went fine, and then fastboot oem lock while in fastboot it restarted and showed above again Relocked, and then started RUU again and it's doing the same Thing, it just don't proceeds, it stays at 0/5 files.

    I think there is a problem with your fastboot drivers or with the data cable you are using. I will try to get the recovery.img for your phone. What is your Hboot ver.?