[DEPRECATED] Universal HTC RUU/ROM Decryption Tool (v2.0.0) - new link inside

Search This thread

JochenP

Senior Member
Nov 29, 2015
405
135
Cologne
Nice, glad you enjoyed it;

and no the md5's will be different; the recovery_signed.img is just a file, so it will only be as long as it needs to be, the one backed up by twrp, will be a full partition backup (the contents would be the same, except for the padding at the end)

... just as if you flashed TWRP into the partition, the actual fastboot flash will write the TWRP.img file, but if you take a backup, the whole partition will be backed up, even though the contents are "technically" the same....
hope that makes sense :eek:

yes - that make sense and is now clear - thank you for your explanation :good:
 
  • Like
Reactions: nkk71

-stim

Member
Feb 26, 2016
9
1
Confirmed working with Linux Mint Cinnamon 17. 3 64-bit out of the box.
Decrypted RUU_HIA_AERO_UL_M60_SENSE7GP_ATT_Cingular_US_1.27.502.5.exe with Universal_HTC_Decrypt_Tool-v2.0.0 with no issues. Thanks guys!


If anyone needs a zip or RUU decrypted and doesn't have access to Linux, Shoot me a PM and let me know. If you point me in the direction of the zip or RUU you need I will decrypt it for you using these tools.
 
Last edited:
  • Like
Reactions: hotned

Captain_Throwback

Recognized Developer
Thank you @Captain_Throwback and @nkk71 for this tool. So much easier than doing it within Windows. Now who should I donate to? Captain_Throwback you refer to giving credit to nkk71 so should he be the one I donate to, or should I spit it between the 2 of you?
After discussing with @nkk71, we think a split in the donations is fair. He suggested 50/50, but I believe he deserves more than me, so a 60 (for him) 40 (for me) split would be fine.

You might also want to consider donating to the other people mentioned in the OP, as without their tools/source code/work this wouldn't be possible either.

Even if you don't donate anything to us (as it's not why we do this anyway), you thanks and kind words are appreciated!
 

jbfountain

Senior Member
Feb 15, 2015
653
395
65
Castaic, California
After discussing with @nkk71, we think a split in the donations is fair. He suggested 50/50, but I believe he deserves more than me, so a 60 (for him) 40 (for me) split would be fine.

You might also want to consider donating to the other people mentioned in the OP, as without their tools/source code/work this wouldn't be possible either.

Even if you don't donate anything to us (as it's not why we do this anyway), you thanks and kind words are appreciated!

Ok. That's 7 people to donate to. I don't want the donations to be really small so I will start with you and nkk71, and then work on the rest a few at a time. I'm not rich (insert chuckle), and this tool is definitely worth more than I can afford, but I will do my best. Thanks again for making this tool available for all.

Using XDA to unleash the power of Android on my S6 Edge Plus & HTC One M9
 

jbfountain

Senior Member
Feb 15, 2015
653
395
65
Castaic, California
@Captain_Throwback I took care of everyone the best I could except for @Twogood, @Flemmard, and @A.S._id. I couldn't find twogood, and Flemmard and A.S._id didn't have donation links. I did PM the later two to thank them and ask them if they did have a donation link to please send it to me. If you have any info on how I can donate to those 3 please forward it to me. Thanks again to all those involved in making this tool possible.
Cheers
 

Flemmard

Inactive Recognized Developer
Apr 3, 2007
157
989
Bischheim
@Captain_Throwback I took care of everyone the best I could except for @Twogood, @Flemmard, and @A.S._id. I couldn't find twogood, and Flemmard and A.S._id didn't have donation links. I did PM the later two to thank them and ask them if they did have a donation link to please send it to me. If you have any info on how I can donate to those 3 please forward it to me. Thanks again to all those involved in making this tool possible.
Cheers

Thank you :) Even if kmdm did most of the work ^^
 

nkk71

Inactive Recognized Developer / Contributor
May 26, 2010
8,743
7,571
50
Beirut
@Captain_Throwback I took care of everyone the best I could except for @Twogood, @Flemmard, and @A.S._id. I couldn't find twogood, and Flemmard and A.S._id didn't have donation links. I did PM the later two to thank them and ask them if they did have a donation link to please send it to me. If you have any info on how I can donate to those 3 please forward it to me. Thanks again to all those involved in making this tool possible.
Cheers

Many thanks, very much appreciated. You are an officer and a gentleman :good:

Hopefully we'll soon (as time permits) have a small update to the tool :eek: , including a Windows version :cyclops:
 
  • Like
Reactions: Captain_Throwback

longnt2007

Senior Member
Nov 2, 2015
100
139
Thanks for the decryption tool, I've used for decrypt firmware from HTC D728W, notice that firmware name begin with 2PQ8IMG (HTC A9 is 2PQ9IMG) so if I leave original filename 2PQ8IMG.zip, the tool stuck forever at "Looking for android-info.txt..."

So I've renamed rom file to 2PQ9IMG.zip, the decryption tool now working fine and try to search hboot/hosd.img to build new keyfile 2PQ8_keyfile_1.bin, but in this firmware hosd.img named as hosd_verified.img, so I must extract hosd_verified.img and enter it in terminal console to build a new keyfile. After that all system files have been extracted successful :good:
 

Attachments

  • 2PQ8_keyfile_1.zip
    235 bytes · Views: 125

reachedxyz

Member
Apr 3, 2012
34
12
Hi sir
Please hepl me, error code
Code:
Welcome to the RUU extraction and decryption script!

No ruu.exe found. Proceeding to rom.zip decryption/extraction...

Extracting ZIP files
    LargeZip format detected, using ruuveal
ruuveal
-------

Large zip format detected containing 6 zipfile(s)
Dumped (copied) zip file to: 01_dmp.zip
Dumped (copied) zip file to: 02_dmp.zip
Dumped (copied) zip file to: 03_dmp.zip
Dumped (copied) zip file to: 04_dmp.zip
Dumped (copied) zip file to: 05_dmp.zip
Dumped (copied) zip file to: 06_dmp.zip
Finished: Successfully extracted zip files to '/home/androidrepair/Desktop/Tool_HTC/Burn_HTC/working/extract'

Looking for android-info.txt in encrypted ROM zips...

Model ID found by extracting android-info.txt from rom zip. Model ID identified as: 0P6B
Looking for keyfile: 0P6B_keyfile_6.bin
Found matching keyfile! Using keyfile: 0P6B_keyfile_6.bin

Decrypting ZIP files

Decrypting 01_dmp.zip
    Encrypted zip detected, running ruuveal...
ruuveal
-------

Invalid zip file - aborting!
failed to decrypt zip file!
Processing ZIP... 32768/56555916
ERROR: could not decrypt file (err=249)

/home/androidrepair/Desktop/Tool_HTC/Burn_HTC/working/decrypt/decrypted_system
/home/androidrepair/Desktop/Tool_HTC/Burn_HTC/out

Attempting to create system.img
ERROR: No system image files found, aborting!

Renaming and moving files...

mv: cannot stat ‘/home/androidrepair/Desktop/Tool_HTC/Burn_HTC/working/decrypt/decrypted_all/boot_signed.img’: No such file or directory
Rom.zip has been renamed for your device.

Boot image extracted from firmware.zip. boot.img & system.img can be used as base for building a new ROM.

Script complete! Files can be found in the 'out' folder. Enjoy your decrypted system!
 

Captain_Throwback

Recognized Developer
No. File zip not bad. error key devices by Tool. You have check key for m8. Thanks
Well, you didn't answer my question, but I'll guess as to which ROM you were trying to decrypt. In which case, delete the file tools/keyfiles/0P6B_keyfile_6.bin and drop the attached keyfiles in there instead. Then let me know if it decrypts for you.
 

Attachments

  • 0P6B_keyfiles.zip
    446 bytes · Views: 27

nkk71

Inactive Recognized Developer / Contributor
May 26, 2010
8,743
7,571
50
Beirut
You have share problem create file key.bin

What's a "share problem create file key.bin"?

For the M8 the 6.xx.xxx.x series RUUs have 2 possible keyfiles, something we haven't encountered before... one is in the original tool files, the other was linked by Captain_Throwback above. perhaps if you re-read the post you'll get it working
 

glennsamuel32

Senior Member
Feb 25, 2014
68
18
Thanks @Captain_Throwback and @nkk71

I downloaded http://dl3.htc.com/application/RUU_HIMA_UL_M60_SENSE70_ATT_MR_NA_Gen_Unlock_3.35.617.12.exe for the M9 Unlocked...

Everything went ok and I even got the "green" script complete message...
But there were a lot of 'cautions' and the system.img is 4.7gb...
I'm coming from Samsung ROM's and those top out at 2.4gb, and so I just wanted to make sure it's normal...

Here's the final output...

Finished: Successfully created system.img in '/home/glenn/android/M9/Decrypt/out'

Renaming and moving files...

Rom.zip has been renamed for your device.

Boot image extracted from firmware.zip. boot.img & system.img can be used as base for building a new ROM.

Script complete! Files can be found in the 'out' folder. Enjoy your decrypted system!
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 29
    UPDATE: This version of the tool is now deprecated. Please use the updated version!
    (and thank @nkk71 while you're at it!!)


    [TOOL][LINUX|WINDOWS][64bit][20-MAY-2016]Universal HTC RUU/ROM Decryption Tool 3.0.0









    ----------------------------------------------------
    Original Post:

    First of all, I want to state that I deserve credit for none of this - all I did was aggregate some of the great work done by the fantastic devs here on XDA.

    BIG Thanks @nkk71, for his idea to make this work universally on all encrypted HTC RUUs and all his hard work to make it happen! All I really did was post the thread.

    Prerequisites:
    - A system running a 64-bit Linux distro (tested on Ubuntu 15.10 & 16.04 LTS)
    - At least 5GB of available disk space (ROMs are big)

    readme.txt:
    Code:
    *** Captain_Throwback & nkk71's RUU decryption scripts for HTC Devices ***
    
    INSTALLATION STEPS:
    Extract files into folder of your choice, being sure to preserve the folder structure. The decrypt-htc binary and this readme file should be the only files in the root folder.
    
    Download the encrypted RUU or encrypted rom zip of your choice from HTC (or wherever).
    
    Place RUU.exe in the "place_ruu_here" folder or the ROM.zip in the "place_rom_zip_here" folder.
    
    Run ./decrypt-htc and wait for script to complete (you may be prompted for input if there are issues).
    
    The script will output 3 files (to the "out" folder): boot.img, system.img & the encrypted rom zip you started with (or was extracted from the RUU), named for SD card flashing on your device (if your device has an SD card). There will also be a folder with the extracted firmware for your device that can be used however you see fit :).
    NOTE: For the A9, for example, the rom.zip will be named 2PQ9IMG.zip. Each device has a specific filename which will be reflected.

    Below is a script of the expected output of the script when processing a RUU.exe.
    Code:
    Welcome to the RUU extraction and decryption script!
    
    Extracting temporary files...
    Extracting rom zip files...
    Extracting rom.zip...done.
    Extracting android-info.txt...done.
    Cleaning up...
    Done!
    
    Extracting ZIP files
        LargeZip format detected, using ruuveal
    ruuveal
    -------
    
    Large zip format detected containing 7 zipfile(s)
    Dumped (copied) zip file to: 01_dmp.zip
    Dumped (copied) zip file to: 02_dmp.zip
    Dumped (copied) zip file to: 03_dmp.zip
    Dumped (copied) zip file to: 04_dmp.zip
    Dumped (copied) zip file to: 05_dmp.zip
    Dumped (copied) zip file to: 06_dmp.zip
    Dumped (copied) zip file to: 07_dmp.zip
    Finished: Successfully extracted zip files to '/home/throwback/android/decrypt/tool/working/extract'
    
    Model ID found by extracting android-info.txt from RUU. Model ID identified as: 0PJA
    
    Looking for keyfile: 0PJA_keyfile_2.bin
    Found matching keyfile! Using keyfile: 0PJA_keyfile_2.bin
    
    Decrypting ZIP files
    
    Decrypting 01_dmp.zip
        Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /home/throwback/android/decrypt/tool/working/decrypt/decrypted_zips/dec_01_dmp.zip
    
    Decrypting 02_dmp.zip
        Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /home/throwback/android/decrypt/tool/working/decrypt/decrypted_zips/dec_02_dmp.zip
    
    Decrypting 03_dmp.zip
        Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /home/throwback/android/decrypt/tool/working/decrypt/decrypted_zips/dec_03_dmp.zip
    
    Decrypting 04_dmp.zip
        Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /home/throwback/android/decrypt/tool/working/decrypt/decrypted_zips/dec_04_dmp.zip
    
    Decrypting 05_dmp.zip
        Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /home/throwback/android/decrypt/tool/working/decrypt/decrypted_zips/dec_05_dmp.zip
    
    Decrypting 06_dmp.zip
        Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /home/throwback/android/decrypt/tool/working/decrypt/decrypted_zips/dec_06_dmp.zip
    
    Decrypting 07_dmp.zip
        Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /home/throwback/android/decrypt/tool/working/decrypt/decrypted_zips/dec_07_dmp.zip
    
    Unzipping decrypted zips
    Archive:  decrypted_zips/dec_01_dmp.zip
      inflating: decrypted_all/android-info.txt  
      inflating: decrypted_all/aboot_signed.img  
      inflating: decrypted_all/radio.img  
      inflating: decrypted_all/splash1.nb0  
      inflating: decrypted_all/adsp.img  
      inflating: decrypted_all/rfg_1.img  
      inflating: decrypted_all/rfg_2.img  
      inflating: decrypted_all/ramdisk.img  
      inflating: decrypted_all/android-info2.txt  
      inflating: decrypted_all/sensor_hub.img  
      inflating: decrypted_all/emmc_appsboot.mbn  
      inflating: decrypted_all/persist.img  
      inflating: decrypted_all/dt.img    
      inflating: decrypted_all/bootloader  
      inflating: decrypted_all/gpt_main_32g.img  
      inflating: decrypted_all/pg2fs_ship_signkey.img  
      inflating: decrypted_all/apppreload.img  
      inflating: decrypted_all/cota.img  
      inflating: decrypted_all/gpt_main_64g.img  
      inflating: decrypted_all/sbl1-8994-1.img  
      inflating: decrypted_all/sdi.img   
      inflating: decrypted_all/hosd_signed.img  
      inflating: decrypted_all/rpm-8994-1.img  
      inflating: decrypted_all/pmic-8994-1.img  
      inflating: decrypted_all/boot_signed.img  
      inflating: decrypted_all/recovery_signed.img  
      inflating: decrypted_all/cpe.img   
      inflating: decrypted_all/tz-8994-1.img  
      inflating: decrypted_all/hyp-8994-1.img  
      inflating: decrypted_all/tp_SYN3351.img  
      inflating: decrypted_all/tp_MXM11876.img  
      inflating: decrypted_all/cir.img   
      inflating: decrypted_all/backup_android-info.txt  
    
    Archive:  decrypted_zips/dec_04_dmp.zip
      inflating: decrypted_all/system.img_02  
    
    Archive:  decrypted_zips/dec_03_dmp.zip
      inflating: decrypted_all/system.img_01  
    
    Archive:  decrypted_zips/dec_07_dmp.zip
      inflating: decrypted_all/dzdata_16g.img  
      inflating: decrypted_all/dzdata_32g.img  
      inflating: decrypted_all/dzdata_16g.hdr  
      inflating: decrypted_all/dzdata_32g.hdr  
      inflating: decrypted_all/dzdata_64g.hdr  
      inflating: decrypted_all/dzdata_64g.img  
    
    Archive:  decrypted_zips/dec_06_dmp.zip
      inflating: decrypted_all/system.img_04  
    
    Archive:  decrypted_zips/dec_02_dmp.zip
      inflating: decrypted_all/system.img_00  
    
    Archive:  decrypted_zips/dec_05_dmp.zip
      inflating: decrypted_all/system.img_03  
    
    7 archives were successfully processed.
    
    Move system img files to system folder
    ‘decrypted_all/system.img_00’ -> ‘decrypted_system/system.img_00’
    ‘decrypted_all/system.img_01’ -> ‘decrypted_system/system.img_01’
    ‘decrypted_all/system.img_02’ -> ‘decrypted_system/system.img_02’
    ‘decrypted_all/system.img_03’ -> ‘decrypted_system/system.img_03’
    ‘decrypted_all/system.img_04’ -> ‘decrypted_system/system.img_04’
    Finished: Successfully decrypted RUU to '/home/throwback/android/decrypt/tool/working/decrypt'
    
    /home/throwback/android/decrypt/tool/working/decrypt/decrypted_system
    /home/throwback/android/decrypt/tool/out
    
    Attempting to create system.img
        Multi-part system images
        Sparse Image detected, using simg2img
            Please be patient, this can take several minutes...finished.
    Testing system.img...
    e2fsck 1.42.12 (29-Aug-2014)
    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
    /home/throwback/android/decrypt/tool/out/system.img: 4685/286720 files (0.0% non-contiguous), 1041188/1146880 blocks
    Finished: Successfully created system.img in '/home/throwback/android/decrypt/tool/out'
    
    Renaming and moving files...
    
    Rom.zip has been renamed for your device.
    
    Boot image extracted from firmware.zip. boot.img & system.img can be used as base for building a new ROM.
    
    Script complete! Files can be found in the 'out' folder. Enjoy your decrypted system!
    (above output is from M9 RUU)


    Important Notes:
    • If decrypting a rom.zip that is "combined" (meaning the first zip isn't encrypted), you will see the following error message at the top of the ruuveal section:
      • Code:
        invalid htc aes encrypted zip file!
      This just indicates that the first zip file isn't encrypted. The script will continue and complete with no issues, so this isn't a concern.
    • You may also see these messages:
      • Code:
        caution: filename not matched:  system.img*
      • Code:
        1 archive had fatal errors.
      These errors indicate that the first zip doesn't contain a system image to be extracted, which is fine (that's the zip that contains the firmware). This isn't a concern either.
    • The last issue you might notice is this:
      • Code:
        warning [../out/firmware.zip]:  256 extra bytes at beginning or within zipfile
          (attempting to process anyway)
      The extra 256 bytes is HTC's signature on the unencrypted firmware zip. This also is nothing to worry about.
    As long as you have all of the output files at the end of the script, everything should be fine.

    Thanks:
    twogood for unshield
    @kmdm for unruu & ruuveal
    @Flemmard for bruutveal
    @osm0sis for Android Image Kitchen
    @A.S._id for ANDROID_IMG_REPACK_TOOLS
    11
    Additional Info

    Change Log:
    January 11, 2016 - v2.0.0
    • Complete overhaul of existing script and process
    • Now works on any encrypted RUU/ROM for any HTC device with a known decryption key
    • For devices with unknown keyfile, user can provide hboot or hosd image (based on same software version is preferable) and a new keyfile will be created. You can share the new keyfile so that it can be added to our database.
    • Improved script output and error handling

    January 1, 2016 - v1.5.3
    • Fixed the binary problem - should now work on PCs other than mine :eek:

    January 1, 2016 - v1.5.2
    • Back to bash script (for now) to ensure compatibility with other PCs

    January 1, 2016 - v1.5.1
    • Some script and binary cleanup (back end stuffs)

    December 31, 2015 - v1.5
    • Compile script into binary format (back end stuffs)

    December 31, 2015 - v1.4.1
    • Back-end cleanup to use "working" folder for zip processing

    December 31, 2015 - v1.4
    • Added code to handle "combined" zips where first zip file is already decrypted

    December 31, 2015 - v1.3
    • Can now handle encrypted rom zips!
    • Kill script if no files found
    • Script renamed from decrypt.sh to decrypt-htc.sh
    • Renames rom.zip from ruu (or provided rom.zip) to 2PQ9IMG.zip (or whatever corresponds to that for other applicable devices) automatically and puts in "out" folder

    December 31, 2015 - v1.2
    • Added unshield and libunshield to zip so manual compilation is no longer necessary (thanks @nkk71)

    December 30, 2015 - v1.1
    • Added version number
    • Modified script to allow for usage on multiple HTC devices

    December 30, 2015
    • Initial version
    10
    Mine [emoji6]

    Sent from my HTC One M9 using Tapatalk
    6
    Updated this (just now) to allow for handling of other devices which use the same type of encrypted RUU (like the Desire 626s, for example).
    6
    v1.2 is up! No more compilation of libunshield is necessary, thanks to @nkk71's help! Seriously, give that guy some love!