[TOOL][28-NOV-2017]Universal HTC RUU/ROM Decryption Tool 3.6.8

What's your platform of choice for decryption?

  • Windows (32bit)

    Votes: 40 8.3%
  • Windows (64bit)

    Votes: 370 76.6%
  • Linux (32bit)

    Votes: 12 2.5%
  • Linux (64bit)

    Votes: 63 13.0%
  • MacOS

    Votes: 23 4.8%
  • Android (arm)

    Votes: 15 3.1%
  • Android (arm64)

    Votes: 30 6.2%
  • Other? (hmm)

    Votes: 2 0.4%

  • Total voters
    483
Search This thread

nkk71

Inactive Recognized Developer / Contributor
May 26, 2010
8,741
7,571
53
Beirut
Anyone having issues with the tool?
@nkk71
@topjohnwu has volunteered to try to compile the tool for Mac users. I'm curious to see how that turns out....:eek:

finished with 3.0.2 yesterday - which adds back the functionality of extracting hboot/hosd from the zip(s) itself if possible (one example is M8 6.12.401.4), and some code cleanup,
dunno if i'll upload that today or not, but soon-ish
(maybe I should jump version numbers more... those 3.0.x increments seem too small :laugh:


as for Mac, since it's unix based anyway, i guess so ... well, if I got it to compile on Windows (including the linux bins), then I dont really see how much of a problem Mac's would be
and the only one I have is the wife's.... and you can imagine what would happen if I touch that, let alone wanted to compile anything on it :p
 
  • Like
Reactions: Captain_Throwback

nkk71

Inactive Recognized Developer / Contributor
May 26, 2010
8,741
7,571
53
Beirut
About version 3.0.2 "force extraction"

Though most of the time this will fail, there are / have been several instances where HTC release their RUU either only signed or "mixed"

if we're talking about newer models
  • then the M9 1.xx.xxx.x series was not encrypted at all only signed (so keyfile isnt needed at all)
  • and sometimes the first zip (within the LargeZip) is signed but not encrypted, the rest are, such as the M8 6.12.401.4
in which case:
Code:
+++ Welcome to the HTC RUU Decryption Tool 3.0.2 +++
         by nkk71 and Captain_Throwback         

RUU identified as HTC LargeZip file
Moving 'M8_6.12.401.4.zip' temporarily to working folder


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 'dumped_zips'


Attempting to find suitable keyfile
[B][COLOR="Blue"]Find First Encrypted ZIP
Encrypted zip to be used for testing: '[COLOR="Red"]02_dmp.zip[/COLOR]'[/COLOR][/B]

[B][I]Trying force extraction of hboot/hosd...[/I][/B]
[B][COLOR="Blue"]Archive:  01_dmp.zip
  inflating: tmp/hboot_signedbyaa.img[/COLOR][/B]  
caution: filename not matched:  hosd*
Archive:  02_dmp.zip
warning [02_dmp.zip]:  128 extra bytes at beginning or within zipfile
  (attempting to process anyway)
caution: filename not matched:  hboot*
caution: filename not matched:  hosd*
Archive:  03_dmp.zip
warning [03_dmp.zip]:  128 extra bytes at beginning or within zipfile
  (attempting to process anyway)
caution: filename not matched:  hboot*
caution: filename not matched:  hosd*
Archive:  04_dmp.zip
warning [04_dmp.zip]:  128 extra bytes at beginning or within zipfile
  (attempting to process anyway)
caution: filename not matched:  hboot*
caution: filename not matched:  hosd*
Archive:  05_dmp.zip
warning [05_dmp.zip]:  128 extra bytes at beginning or within zipfile
  (attempting to process anyway)
caution: filename not matched:  hboot*
caution: filename not matched:  hosd*
Archive:  06_dmp.zip
warning [06_dmp.zip]:  128 extra bytes at beginning or within zipfile
  (attempting to process anyway)
caution: filename not matched:  hboot*
caution: filename not matched:  hosd*
... assuming hboot...

Attempting to generate keyfile
bruutveal
---------

SUCCESS!rcing key[loop 3]: 823163/2096384....
[B][I]Successful bruutveal run, key written to: /media/nkk71/RUU/testruns/OUT/tmp/use_keyfile.bin
bruutveal keyfile has been successfully generated '/media/nkk71/RUU/testruns/OUT/tmp/use_keyfile.bin'
Finished: Successfully found decryption key, copied to 'tmp/use_keyfile.bin'[/I][/B]

Decrypting ZIP files
......
......
INFO: RUU modelid: 0P6B10000
INFO: RUU mainver: 6.12.401.4

Finished: Successfully extracted zip files to
             '/media/nkk71/RUU/testruns/OUT'
 

nkk71

Inactive Recognized Developer / Contributor
May 26, 2010
8,741
7,571
53
Beirut
Version 3.0.2 uploaded :)

Changelog in post 2... and also updated post 1, about the methods it "tries" to find a suitable keyfile.

Note that when a new keyfile is generated, the user will be given the following output:
Code:
[B][U]Checking keyfile state[/U][/B]
Moving keyfile to 0PJA_keyfile_3.39.531.7.bin

[B]INFO: the keyfile '0PJA_keyfile_3.39.531.7.bin' generated appears to be new,
      please consider sharing/uploading it, so it can be included in future
      releases of this tool, at:[/B]
http://xdaforums.com/chef-central/android/tool-universal-htc-ruu-rom-decryption-t3382928

I hope you will share any new keys :good:
 

nkk71

Inactive Recognized Developer / Contributor
May 26, 2010
8,741
7,571
53
Beirut
Changelog stash for 3.0.7
(yeah i'm jumping version numbers)

Code:
* Add error handling to copy_file and append_file
* Remove using PATH, instead use it inline
* Fixes for paths with spaces
* Don't use raise()
* Add debug info printing option -P
* Fix readlink does not null terminate string
* Read android-info from RUU.EXE if available, but if
  decryption is successful, update it from there
* Change 'change_dir' to "normal" behaviour (non-zero is fail)
* Add get_basename instead of using basename (for portability; uhm hint hint)

thanks @Zanzibar for testing
 

nkk71

Inactive Recognized Developer / Contributor
May 26, 2010
8,741
7,571
53
Beirut
New 3.0.7 version is up for Windows and Linux
(Changelog in post 2)

You should now be able to run the Tool from anywhere (including PATH) to anywhere (all output files will be in the same drive/location as the RUU)
added the --debuginfo | -P option
@topjohnwu github updated with 3.0.7 ;)
 

topjohnwu

Senior Recognized Developer / Inactive RC
Jan 31, 2012
1,849
61,430
Taipei
New 3.0.7 version is up for Windows and Linux
(Changelog in post 2)

You should now be able to run the Tool from anywhere (including PATH) to anywhere (all output files will be in the same drive/location as the RUU)
added the --debuginfo | -P option

@topjohnwu github updated with 3.0.7 ;)

Nice, will add mac specific code and binaries and pull request :)
 

Captain_Throwback

Recognized Developer
The output, can they be flash on any htc? Like decryption of a9 ruu then can be flashed on any a9 varient? @Captain_Throwback
This tool doesn't somehow change the rules of flashing an RUU.

For an RUU to successfully flash, it has to be for the same device and the model ID and CID have to match.
 

mc9078

Member
Nov 5, 2006
5
1
Thanks for this great tool! I like to know how i can modify the system.img to change some files and recompile to rom.zip which can be flashed under HTC HBOOT? My purpose was to modify the CID XML file to change the startup language. Thanks.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 78
    Welcome to the Universal HTC RUU Decryption and Extraction Tool
    *** by nkk71 and Captain_Throwback ***

    this thread is a continuation of Captain_Throwback's A9 decryption thread


    Disclaimer
    You use this tool and the files produced by it at your own discretion and risk. Though the tool in itself is harmless as it only decrypts RUUs, the files produced by it, if wrongfully flashed on a device, could lead to damage.
    We are not responsible for any wrongfully created or flashed packages produced by the output of this tool.


    Foreword
    First off, we want to thank the great work done by the fantastic devs here on XDA, which has allowed us to put this together.
    The credit goes to them for bringing us the tools to make all this possible.




    Introduction
    HTC's RUUs (Rom Update Utility) whether as a .EXE or a .ZIP come in various formats, and are usually encrypted, so access to the files within is "restricted".​
    The Decryption Tool will decrypt and extract these RUUs, and give you access to the files therein. It will also "assemble" a proper system.img from the various split system files.​
    HTC often changes their RUU formats and decryption keys, and this tool is designed to account for the various formats we've come to see, so far. Please remember this is a Universal Tool (trying to take many variables into account) and as such is a tool under continued development, should we or you come across bugs or new RUU formats, please follow the proper instructions on how to report them.​



    Features
    The tool will decrypt and extract a RUU.EXE or ROM.ZIP, and create:​
    • a workable system.img + boot.img (in OUT/system)
      • system.img
      • boot.img
    • (needed by ROM developers)
      .
      .
    • as well as the remainder of the files (in OUT/firmware), such as
      • firmware
      • preinstalled apps
      • etc.
    • (needed to create firmware packages)
    The tool will use the following sequence to try to find a suitable decryption key (rearranged as of version 3.1.0, since bruutveal is usually considerably slower than a keyfile test):​
    1. User provided keyfile.bin
    2. User provided --device flag
    3. Known keys (stored in the keyfiles folder)
    4. All ruuveal built-in keys
    5. User provided hboot or hosd
    6. Attempt force extraction of hboot or hosd
    If no user provided file is supplied, and the above steps fail; then you will have to provide an hboot or hosd, which you can usually easily extract from a firmware.zip inside the appropriate OTA.zip (those are usually signed but not encrypted, so extraction of hboot/hosd should be easy)​



    Installation instructions
    Download the appropriate zip package for your operating system, and extract the files to the folder of your choice, but keep the folder structure intact, it should be:​
    Linux
    Code:
    -rwxrwxr-x 1 nkk71 nkk71    1702627 May 20 15:12 RUU_Decrypt_Tool[/INDENT]
    [INDENT]drwxrwxr-x 4 nkk71 nkk71       4096 May 17 19:02 bin[/INDENT]
    [INDENT]drwxrwxr-x 3 nkk71 nkk71       4096 May 11 13:44 keyfiles
    Windows
    Code:
    20/05/2016  15:24        10,557,725 RUU_Decrypt_Tool.exe[/INDENT]
    [INDENT]24/01/2016  13:27         3,406,908 cygwin1.dll[/INDENT]
    [INDENT]17/05/2016  15:47    <DIR>          bin[/INDENT]
    [INDENT]18/05/2016  11:15    <DIR>          keyfiles
    The bin and keyfiles folders, have to be in the same folder as the main binary, as shown above.​
    Android Magisk Module
    Please refer to Captain_Throwback's post.​



    Using the tool
    Free disk space info
    At least 5GB of available disk space (but 10GB is more realistic for an HTC One M8 or higher RUU.EXE) (ROMs are big)!​
    The good news is that you can have the program and it's subfolders in one place, but the decryption and extraction, will take place where the actual RUU file is located.​
    For example, I have the tool and it's subfolders on my desktop, but the RUU.EXE is on an external drive:​
    Code:
    [/INDENT]
    [INDENT]C:Usersnkk71DesktopHTC_RUU_Decrypt_Tool_v3.0.0>dir[/INDENT]
    [INDENT]20/05/2016  17:10    <DIR>          .[/INDENT]
    [INDENT]20/05/2016  17:10    <DIR>          ..[/INDENT]
    [INDENT]17/05/2016  15:47    <DIR>          bin[/INDENT]
    [INDENT]24/01/2016  13:27         3,406,908 cygwin1.dll[/INDENT]
    [INDENT]20/05/2016  17:01    <DIR>          keyfiles[/INDENT]
    [INDENT]20/05/2016  15:24        10,557,725 RUU_Decrypt_Tool_3.0.0.exe[/INDENT]
    [INDENT]               2 File(s)     13,964,633 bytes[/INDENT]
    [INDENT]               4 Dir(s)   3,699,408,896 bytes free[/INDENT]
    [INDENT][/INDENT]
    [INDENT]              [/INDENT]
    [INDENT]C:Usersnkk71DesktopHTC_RUU_Decrypt_Tool_v3.0.0>dir I:testhima[/INDENT]
    [INDENT]20/05/2016  17:11    <DIR>          .[/INDENT]
    [INDENT]20/05/2016  17:11    <DIR>          ..[/INDENT]
    [INDENT]28/02/2016  03:23     2,418,411,600 RUU_HIMA_UL_M60_SENSE70_TMUS_MR_TMOUS_3.39.531.7.exe[/INDENT]
    [INDENT]               1 File(s)  2,418,411,600 bytes[/INDENT]
    [INDENT]               2 Dir(s)  100,648,206,336 bytes free[/INDENT]
    [INDENT][/INDENT]
    [INDENT]              [/INDENT]
    [INDENT]C:Usersnkk71DesktopHTC_RUU_Decrypt_Tool_v3.0.0>[/INDENT]
    [INDENT]RUU_Decrypt_Tool_3.0.0.exe I:testhimaRUU_HIMA_UL_M60_SENSE70_TMUS_MR_TMOUS_3.39.531.7.exe[/INDENT]
    [INDENT][/INDENT]
    [INDENT][/INDENT]
    [INDENT]+++ Welcome to the HTC RUU Decryption Tool 3.0.0 +++[/INDENT]
    [INDENT]         by nkk71 and Captain_Throwback[/INDENT]
    [INDENT][/INDENT]
    [INDENT]RUU identified as Executable file[/INDENT]
    [INDENT]...[/INDENT]
    [INDENT]...[/INDENT]
    [INDENT]...[/INDENT]
    [INDENT]Finished: Successfully extracted zip files to[/INDENT]
    [INDENT]             'I:/test/hima/OUT'[/INDENT]
    [INDENT]
    RUU_Decrypt_Tool Usage
    This is a terminal / command prompt program, there is no GUI, so don't try to "double click" it.​
    Code:
    [/INDENT]
    [INDENT][B]RUU_Decrypt_Tool [options] <RUUName: RUU.exe or ROM.zip> [keyfile/hboot/hosd][/B][/INDENT]
    [INDENT][/INDENT]
    [INDENT]   If none of the required arguments are supplied a simple Yes/No interface will be presented.[/INDENT]
    [INDENT][/INDENT]
    [INDENT]   Required arguments (and/or):[/INDENT]
    [INDENT]      -s, --system     extract the system.img and boot.img (for ROM)[/INDENT]
    [INDENT]      -f, --firmware   extract the firmware files[/INDENT]
    [INDENT]      -z, --sdruuzip   copy and rename rom.zip for SD-Card flashing[/INDENT]
    [INDENT]                       Note: this will create a duplicate if the input is already a rom.zip[/INDENT]
    [INDENT][/INDENT]
    [INDENT]   Keyfile Updater arguments:[/INDENT]
    [INDENT]      -o, --offline     disable down/upload of keyfiles[/INDENT]
    [INDENT]      --no-upload       do not upload if a new keyfile is generated[/INDENT]
    [INDENT]      --sync-keyfiles   sync entire keyfile folder (download & upload)[/INDENT]
    [INDENT]                        when used without a RUU the tool will only synchronize the[/INDENT]
    [INDENT]                        keyfiles, otherwise it will download new keyfiles before decrypting[/INDENT]
    [INDENT]                        and upload only if a new keyfile is generated[/INDENT]
    [INDENT][/INDENT]
    [INDENT]   Logging:[/INDENT]
    [INDENT]      -L, --log   log all output to a txt file named[/INDENT]
    [INDENT]                  'RUU_Decrypt_LOG-{MID}_{MAINVER}.txt' in the OUT folder[/INDENT]
    [INDENT][/INDENT]
    [INDENT]   Debugging Options (not usually needed):[/INDENT]
    [INDENT]      -k, --keepall          keep all intermediary files[/INDENT]
    [INDENT]      -c, --slowcleanup      do a 'slow cleanup', ie dont delete files once partially processed[/INDENT]
    [INDENT]      -P, --debuginfo        print debug info (paths and exec)[/INDENT]
    [INDENT][/INDENT]
    [INDENT]   Direct ruuveal support (needed for older devices):[/INDENT]
    [INDENT]      -d, --device DEVICE  specify device (this is only needed for old unruu supported devices)[/INDENT]
    [INDENT]                           please run ruuveal to see the list of DEVICEs supported[/INDENT]
    [INDENT]
    where​
    • <RUUName: RUU.exe or ROM.zip> is the file that you wish to decrypt
      .
    • keyfile/hboot/hosd is an optional keyfile or hboot / hosd (depends on device) if it is not specified, the tool will go through the known keys to try and find a proper one. if it does not, it will inform the user that (s)he needs to provide one.
    As of version 3.6.0 RC1, the tool when called from the command line has to:​
    1. Either include at lease one of the required arguments:
      • -s : system.img and boot.img
      • -f : firmware files
      • -z : rom.zip for SD-Card flashing
      • You can also combine them in the form of -sf for example to create both system.img and extract firmware files.
    2. Or be run for keyfile synchronization only:
      • RUU_Decrypt_Tool --sync-keyfiles
    If neither (1) nor (2) are used, the Tool will present the Y/N interface and any other flags will be disregarded.​
    The other flags should be self-explanatory.​
    NOTE: If using the tool on Windows, you can simply drag & drop the desired exe or zip you want to decrypt onto the RUU_Decrypt_Tool.exe, and a command prompt will open to begin the process.



    Downloads



    User Submitted Keyfiles
    The Tool will automatically download any new keyfiles available before decryption, and will upload a new keyfile if one is generated.​
    The download and/or upload of keyfiles is at the user's discretion. You will be prompted when using the Y/N interface, otherwise from the command line, the following options are available:​
    Code:
      -o, --offline     disable down/upload of keyfiles[/INDENT]
    [INDENT]  --no-upload       do not upload if a new keyfile is generated[/INDENT]
    [INDENT]  --sync-keyfiles   sync entire keyfiles folder (download & upload)[/INDENT]
    [INDENT]
    The default is to both download and upload, and I would recommend those options be used. The keyfiles are only 96 bytes so the transfer of files will be of no significance.​



    Example output
    • Linux (64bit) (I'm using Ubuntu 14.04.3) in post #3
    • Windows 10 (64bit) in post #4
    they're too big to fit into even one post :eek:



    Changelog in post #2



    Credits and Thanks
    @Captain_Throwback for his support, motivation, and overall helpfullness
    @topjohnwu for Mac OS X port and magiskboot
    twogood for unshield
    @kmdm for unruu & ruuveal
    @Flemmard for bruutveal
    @osm0sis for Android Image Kitchen
    @joeykrim for his original Decrypt RUU Thread


    XDA:DevDB Information
    Universal HTC RUU/ROM Decryption Tool, Tool/Utility for the Chef Central

    Contributors
    nkk71, Captain_Throwback
    Source Code: https://github.com/nkk71/HTC-RUU-Decrypt-Tool


    Version Information
    Status:
    Stable
    Current Stable Version: 3.6.8
    Stable Release Date: 2017-11-28

    Created 2016-05-20
    Last Updated 2018-09-03
    23
    Example output: Windows 10 (64bit)

    RUU Decrypt Tool
    Code:
    I:\test\test2>RUU_Decrypt_Tool.exe RUU_M8_WHL_M60_SENSE70_SPCS_MR_Sprint_WWE_6.20.651.3.exe
    
    
    +++ Welcome to the HTC RUU Decryption Tool 3.0.0 +++
             by nkk71 and Captain_Throwback
    
    RUU identified as Executable file
    
    Extracting rom.zip from RUU_M8_WHL_M60_SENSE70_SPCS_MR_Sprint_WWE_6.20.651.3.exe
    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 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 'dumped_zips'
    
    Attempting to find suitable keyfile
    Find First Encrypted ZIP
    Encrypted zip to be used for testing: '01_dmp.zip'
    No proper keyfile, trying known keys instead...
    Testing keyfile '0P3P_keyfile_4.bin'...
    ruuveal
    -------
    
    Invalid zip file - aborting!
    failed to decrypt zip file!
    Testing keyfile '0P6B_keyfile_1.bin'...
    ruuveal
    -------
    
    Invalid zip file - aborting!
    failed to decrypt zip file!
    Testing keyfile '0P6B_keyfile_6.20.654.3.bin'...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: tmpzip.zip
    Archive:  tmpzip.zip
        testing: android-info.txt         OK
        testing: hboot_signedbyaa.img     OK
        testing: sbl1-8974AB-1.img        OK
        testing: sbl1-8974AB-2.img        OK
        testing: sbl1-8974AA-1.img        OK
        testing: sdi.img                  OK
        testing: rpm.img                  OK
        testing: boot_signed.img          OK
        testing: recovery_signed.img      OK
        testing: adsp.img                 OK
        testing: wcnss.img                OK
        testing: radio.img                OK
        testing: rcdata.img               OK
        testing: rfg_1.img                OK
        testing: modem_st1.img            OK
        testing: modem_st2.img            OK
        testing: tz.img                   OK
        testing: pg2fs_spcustom.img       OK
        testing: sensor_hub.img           OK
        testing: tp_SYN3508.img           OK
        testing: tp_SYN3528.img           OK
        testing: splash1.nb0              OK
        testing: rconfig.img              OK
        testing: rfg_2.img                OK
    No errors detected in compressed data of tmpzip.zip.
    INFO: keyfile passed all tests
    Finished: Successfully found decryption key, copied to 'tmp/use_keyfile.bin'
    
    Decrypting ZIP files
    
    Decrypting (1/6) '01_dmp.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: I:/test/test2/OUT/decrypted_zips/dec_01_dmp.zip
    ... immediate cleanup specified, deleting '01_dmp.zip'
    
    Decrypting (2/6) '02_dmp.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: I:/test/test2/OUT/decrypted_zips/dec_02_dmp.zip
    ... immediate cleanup specified, deleting '02_dmp.zip'
    
    Decrypting (3/6) '03_dmp.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: I:/test/test2/OUT/decrypted_zips/dec_03_dmp.zip
    ... immediate cleanup specified, deleting '03_dmp.zip'
    
    Decrypting (4/6) '04_dmp.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: I:/test/test2/OUT/decrypted_zips/dec_04_dmp.zip
    ... immediate cleanup specified, deleting '04_dmp.zip'
    
    Decrypting (5/6) '05_dmp.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: I:/test/test2/OUT/decrypted_zips/dec_05_dmp.zip
    ... immediate cleanup specified, deleting '05_dmp.zip'
    
    Decrypting (6/6) '06_dmp.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: I:/test/test2/OUT/decrypted_zips/dec_06_dmp.zip
    ... immediate cleanup specified, deleting '06_dmp.zip'
    Finished: Successfully decrypted zips to 'decrypted_zips'
    
    Unzipping decrypted ZIP files
    
    Unzipping decrypted zip: (1/6) 'dec_01_dmp.zip'
    Archive:  dec_01_dmp.zip
      inflating: I:/test/test2/OUT/firmware/android-info.txt
      inflating: I:/test/test2/OUT/firmware/hboot_signedbyaa.img
      inflating: I:/test/test2/OUT/firmware/sbl1-8974AB-1.img
      inflating: I:/test/test2/OUT/firmware/sbl1-8974AB-2.img
      inflating: I:/test/test2/OUT/firmware/sbl1-8974AA-1.img
      inflating: I:/test/test2/OUT/firmware/sdi.img
      inflating: I:/test/test2/OUT/firmware/rpm.img
      inflating: I:/test/test2/OUT/firmware/boot_signed.img
      inflating: I:/test/test2/OUT/firmware/recovery_signed.img
      inflating: I:/test/test2/OUT/firmware/adsp.img
      inflating: I:/test/test2/OUT/firmware/wcnss.img
      inflating: I:/test/test2/OUT/firmware/radio.img
      inflating: I:/test/test2/OUT/firmware/rcdata.img
      inflating: I:/test/test2/OUT/firmware/rfg_1.img
      inflating: I:/test/test2/OUT/firmware/modem_st1.img
      inflating: I:/test/test2/OUT/firmware/modem_st2.img
      inflating: I:/test/test2/OUT/firmware/tz.img
      inflating: I:/test/test2/OUT/firmware/pg2fs_spcustom.img
      inflating: I:/test/test2/OUT/firmware/sensor_hub.img
      inflating: I:/test/test2/OUT/firmware/tp_SYN3508.img
      inflating: I:/test/test2/OUT/firmware/tp_SYN3528.img
      inflating: I:/test/test2/OUT/firmware/splash1.nb0
      inflating: I:/test/test2/OUT/firmware/rconfig.img
      inflating: I:/test/test2/OUT/firmware/rfg_2.img
    ... immediate cleanup specified, deleting 'dec_01_dmp.zip'
    
    Unzipping decrypted zip: (2/6) 'dec_02_dmp.zip'
    Archive:  dec_02_dmp.zip
      inflating: I:/test/test2/OUT/firmware/system_1.img
      inflating: I:/test/test2/OUT/firmware/android-info-1.txt
    ... immediate cleanup specified, deleting 'dec_02_dmp.zip'
    
    Unzipping decrypted zip: (3/6) 'dec_03_dmp.zip'
    Archive:  dec_03_dmp.zip
      inflating: I:/test/test2/OUT/firmware/system_2.img
      inflating: I:/test/test2/OUT/firmware/android-info-2.txt
    ... immediate cleanup specified, deleting 'dec_03_dmp.zip'
    
    Unzipping decrypted zip: (4/6) 'dec_04_dmp.zip'
    Archive:  dec_04_dmp.zip
      inflating: I:/test/test2/OUT/firmware/system_3.img
      inflating: I:/test/test2/OUT/firmware/android-info-3.txt
    ... immediate cleanup specified, deleting 'dec_04_dmp.zip'
    
    Unzipping decrypted zip: (5/6) 'dec_05_dmp.zip'
    Archive:  dec_05_dmp.zip
      inflating: I:/test/test2/OUT/firmware/system_4.img
      inflating: I:/test/test2/OUT/firmware/android-info-4.txt
    ... immediate cleanup specified, deleting 'dec_05_dmp.zip'
    
    Unzipping decrypted zip: (6/6) 'dec_06_dmp.zip'
    Archive:  dec_06_dmp.zip
      inflating: I:/test/test2/OUT/firmware/dzdata_16g.hdr
      inflating: I:/test/test2/OUT/firmware/dzdata_16g.img
      inflating: I:/test/test2/OUT/firmware/dzdata_32g.hdr
      inflating: I:/test/test2/OUT/firmware/dzdata_32g.img
    ... immediate cleanup specified, deleting 'dec_06_dmp.zip'
    Finished: Successfully unzipped files to 'firmware'
    
    Moving system img files
       (1/4) moving system_1.img
       (2/4) moving system_2.img
       (3/4) moving system_3.img
       (4/4) moving system_4.img
    Finished: Successfully moved system img files to 'decrypted_system'
    
    Attempting to create system.img
    Multi-part system images (4 parts)
    Sparse Header not found, using simple concatenate
        Please be patient, this can take several minutes...
        (1/4) system_1.img -> system.img
        ... immediate cleanup specified, deleting 'system_1.img'
        (2/4) system_2.img -> system.img
        ... immediate cleanup specified, deleting 'system_2.img'
        (3/4) system_3.img -> system.img
        ... immediate cleanup specified, deleting 'system_3.img'
        (4/4) system_4.img -> system.img
        ... immediate cleanup specified, deleting 'system_4.img'
    finished.
    Finished: Successfully created system.img 'system/system.img'
    
    Testing system.img...
    e2fsck 1.42.13 (17-May-2015)
    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
    system/system.img: 3347/172032 files (0.0% non-contiguous), 602666/688128 blocks
    Finished: system.img successfully passed filesystem check
    
    Adding boot.img to the system folder
    Copying firmware/boot_signed.img to system/boot.img
    
    Removing unneeded work folders
    Finished: Successfully extracted zip files to
                 'I:/test/test2/OUT'

    Output Files
    Code:
    I:\test\test2>dir /s OUT
     Volume in drive I is Seagate Backup Plus Drive
     Volume Serial Number is FC34-DB75
    
     Directory of I:\test\test2\OUT
    
    20/05/2016  15:34    <DIR>          .
    20/05/2016  15:34    <DIR>          ..
    20/05/2016  15:32    <DIR>          firmware
    20/05/2016  15:28    <DIR>          romzip
    20/05/2016  15:34    <DIR>          system
    20/05/2016  15:29    <DIR>          tmp
                   0 File(s)              0 bytes
    
     Directory of I:\test\test2\OUT\firmware
    
    20/05/2016  15:32    <DIR>          .
    20/05/2016  15:32    <DIR>          ..
    07/01/2016  11:35         9,614,336 adsp.img
    07/01/2016  11:56               169 android-info-1.txt
    07/01/2016  11:57               169 android-info-2.txt
    07/01/2016  11:58               169 android-info-3.txt
    07/01/2016  11:58               169 android-info-4.txt
    07/01/2016  11:30               113 android-info.txt
    07/01/2016  11:54        12,996,864 boot_signed.img
    07/01/2016  11:48            13,296 dzdata_16g.hdr
    07/01/2016  11:48         2,439,152 dzdata_16g.img
    07/01/2016  11:49            20,448 dzdata_32g.hdr
    07/01/2016  11:49         2,718,688 dzdata_32g.img
    07/01/2016  11:54         2,096,384 hboot_signedbyaa.img
    28/03/2014  08:51         1,572,864 modem_st1.img
    28/03/2014  08:51         1,572,864 modem_st2.img
    07/01/2016  11:35         4,188,160 pg2fs_spcustom.img
    07/01/2016  11:28        45,945,856 radio.img
    01/07/2014  07:27            57,856 rcdata.img
    28/03/2014  08:51         8,388,608 rconfig.img
    07/01/2016  11:54        21,485,824 recovery_signed.img
    28/03/2014  08:51         1,048,576 rfg_1.img
    28/03/2014  08:51         1,048,576 rfg_2.img
    07/01/2016  11:35           194,816 rpm.img
    07/01/2016  11:35           316,538 sbl1-8974AA-1.img
    07/01/2016  11:35           316,538 sbl1-8974AB-1.img
    07/01/2016  11:35           316,538 sbl1-8974AB-2.img
    07/01/2016  11:35            11,770 sdi.img
    07/01/2016  11:35           209,760 sensor_hub.img
    18/12/2015  10:03         4,194,304 splash1.nb0
    07/01/2016  11:35            95,772 tp_SYN3508.img
    07/01/2016  11:35            95,767 tp_SYN3528.img
    07/01/2016  11:35           366,426 tz.img
    07/01/2016  11:35         4,592,640 wcnss.img
                  32 File(s)    125,920,010 bytes
    
     Directory of I:\test\test2\OUT\romzip
    
    20/05/2016  15:28    <DIR>          .
    20/05/2016  15:28    <DIR>          ..
    20/05/2016  15:28               113 android-info.txt
    20/05/2016  15:28     1,645,418,970 rom.zip
                   2 File(s)  1,645,419,083 bytes
    
     Directory of I:\test\test2\OUT\system
    
    20/05/2016  15:34    <DIR>          .
    20/05/2016  15:34    <DIR>          ..
    20/05/2016  15:34        12,996,864 boot.img
    20/05/2016  15:34     2,818,572,288 system.img
                   2 File(s)  2,831,569,152 bytes
    
     Directory of I:\test\test2\OUT\tmp
    
    20/05/2016  15:29    <DIR>          .
    20/05/2016  15:29    <DIR>          ..
    20/05/2016  15:29                96 use_keyfile.bin
                   1 File(s)             96 bytes
    
         Total Files Listed:
                  37 File(s)  4,602,908,341 bytes
                  14 Dir(s)  96,035,700,736 bytes free
    
    I:\test\test2>
    21
    User submitted keyfiles

    Thanks to the following users for submitting keyfiles to the repo:
    20
    How to report bugs, issues and/or problems
    • Please use short easily readable statements
    • Include the
      • RUU Name (full filename)
      • the version number
      • the link to the thread (where applicable)
      • and the download link
    • Add the terminal output, please either encapsulate it in a hidden code section (similar to the example output in the first post), like this:
      Code:
      this is hidden code section
      or use pastebin, hastebin, etc.



    Changelog

    Code:
    28 November 2017 (version 3.6.8)
    ---------------------------------
    * New: Keyfile folder integrity check (duplicate, empty, and
      incorrectly sized keyfiles)
    * [3.6.8] Keyfile folder integrity check during --sync-keyfiles
    * Fix: keyfile_updater upload (ftp protocol issue), also
      integrate libcurl into keyfile_updater to avoid external linkage
      (no more need for libcurl.so / cygcurl.dll)
    * Fix: "Force extracted" hosd (when the first zip is not
      encrypted) and subsequent keyfile generation (thx @santod040)
    * Fix: Allow magiskboot to segfault, during an attempt
      at force extraction (see posts [URL="https://xdaforums.com/showpost.php?p=74524361&postcount=339"]339[/URL] and [URL="https://xdaforums.com/showpost.php?p=74524655&postcount=340"]340[/URL])
    
    06 September 2017 (version 3.6.5)
    ---------------------------------
    * Fix single sparse system.img RUUs
    * Fix multiple rom_nn.zip RUU.EXEs, also extract and use android-info
      and hboot/hosd from the preupdate zip for automatic keyfile
      generation
    * Disallow keyfile upload if download is disabled or failed
    * Fix up/download of keyfiles when run with command line switches
    * Improve error handling in keyfile_updater
    
    21 July 2017 (version 3.6.0 RC1)
    ---------------------------------
    [B]* Updated command line usage!! (Please see notes)[/B]
    * Add arm and arm64 builds
    * Add Windows 32bit build
    * Add date/timestamp to logfile
    * Add "Process took ..." to output
    * Use magiskboot for hosd unpacking
    * Fix empty folder "error" logging
    
    07 June 2017 (version 3.5.2) RC2
    ---------------------------------
    * Simple Yes/No options interface
    * Automatically create a logfile
    * Download and upload new keyfiles (thanks to Captain_Throwback
      for hosting!!)
    * Only check for boot.img or boot_*.img
    * Wait for enter key to exit on Windows when not called
      from the command prompt
    
    29 September 2016 (version 3.1.0)
    ---------------------------------
    * Rename OUT folder to include MID and mainversion
      (nice when you're decrypting multiple RUUs)
    * Support RUUs with multiple "systemimg" files
    * Improve keyfinder performance
    
    31 May 2016 (version 3.0.7)
    ---------------------------
    * Fix force extraction bug
    * Fix/Improved path handling
      you should now be able to use
      the tool from anywhere (including PATH)
      to anywhere (including lots of spaces)
    [I]  for Windows, the bin/AIK-Windows folder
      need to be writeable (only temporarily)[/I]
    * Added --debuginfo / -P option (see usage in post 1)
    * Other code cleanup and changes
    
    26 May 2016 (version 3.0.2)
    ---------------------------
    * Check if new keyfile, if so copy to main OUT folder
      and inform user to upload
    * Added "attempt force extraction" of hboot/hosd,
      though this will typically fail, some RUUs, have the
      first zip signed, but not encrypted, in which case
      the tool will be able to auto-generate a proper keyfile
    * Minor code fixes and cleanup
    
    22 May 2016 (version 3.0.1)
    ---------------------------
    * Added android-info.txt parsing
    * Added -z (SD-Card zip) option (to OUT)
    * Fixed renaming of keyfile (to OUT)
    * Added -d (--device) option
    * Added auto checking of ruuveal's built in
      decryption keys
    * Updated simg2img to provide progress, and
      [STRIKE]implement "immediate cleanup"[/STRIKE] (no point, since
      it allocates the entire output file from the start)
    * Updated linux binaries to static builds
    * Bring AIK up to date, and fix pause (win) and
      terminal clear (linux)
    * Fixed unencrypted unzip bug
    
    20 May 2016 (version 3.0.0)
    ---------------------------
    * Completely recoded to c/c++
    * Works on 64bit Linux and 64bit Windows
    * Added several user flags, please see usage
    * Autodetects if RUU is in .EXE or .ZIP format
    * Added several new keyfiles
    * Better cleanup to lessen disk space needed
    * Many other code changes and optimizations


    Notes
    • As of version 3.6.0 RC1, the command line usage has changed:
      • --system-only and --firmware-only have been replaced by --system and --firmware instead
      These have become required arguments, please refer to Usage in post #1.
      .
    • Information regarding the Android Magisk Module can be found in Captain_Throwback's post.
    15
    Example output: Linux (64bit) (I'm using Ubuntu 14.04.3)


    RUU Decrypt Tool
    Code:
    nkk71@ubuntu:/media/nkk71/RUU/testruns$ ./RUU_Decrypt_Tool rom.zip hosd_signed.img
    
    
    +++ Welcome to the HTC RUU Decryption Tool 3.0.0 +++
             by nkk71 and Captain_Throwback         
    
    RUU identified as Normal Zip file
    Moving 'rom.zip' temporarily to working folder
    
    Extracting ZIP files
    Normal Zip format detected, using unzip
    Archive:  /media/nkk71/RUU/testruns/OUT/romzip/rom.zip
     extracting: info.bin                
     extracting: zip_0.zip               
     extracting: zip_1.zip               
     extracting: zip_2.zip               
     extracting: zip_3.zip               
     extracting: zip_4.zip               
     extracting: zip_5.zip               
     extracting: zip_6.zip               
     extracting: zip_7.zip               
     extracting: zip_8.zip               
     extracting: zip_9.zip               
     extracting: zip_10.zip              
     extracting: zip_11.zip              
     extracting: zip_12.zip              
     extracting: zip_13.zip              
     extracting: zip_14.zip              
     extracting: zip_15.zip              
     extracting: zip_16.zip              
     extracting: zip_17.zip              
     extracting: zip_18.zip              
     extracting: zip_19.zip              
     extracting: zip_20.zip              
     extracting: zip_21.zip              
     extracting: zip_22.zip              
     extracting: zip_23.zip              
     extracting: zip_24.zip              
    Finished: Successfully extracted zip files to 'dumped_zips'
    
    Attempting to find suitable keyfile
    Find First Encrypted ZIP
    Encrypted zip to be used for testing: 'zip_0.zip'
    User supplied hosd...
    Android Image Kitchen - UnpackImg Script
    by osm0sis @ xda-developers
     
    Supplied image: my_hosd_signed.img
     
    Setting up work folders...
     
    Splitting image to "split_img/"...
    BOARD_KERNEL_CMDLINE console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 user_debug=31 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 cma=20M@0-0xffffffff androidboot.hardware=htc_pme
    BOARD_KERNEL_BASE 80000000
    BOARD_NAME hosd:0
    BOARD_PAGE_SIZE 4096
    BOARD_KERNEL_OFFSET 00008000
    BOARD_RAMDISK_OFFSET 01000000
    BOARD_TAGS_OFFSET 00000100
     
    Unpacking ramdisk to "ramdisk/"...
     
    Compression used: gzip
    19567 blocks
     
    Done!
    Attempting to generate keyfile
    bruutveal
    ---------
    
    SUCCESS!rcing key[loop 1]: 575968/786208...
    Successful bruutveal run, key written to: /media/nkk71/RUU/testruns/OUT/tmp/use_keyfile.bin
    bruutveal keyfile has been successfully generated '/media/nkk71/RUU/testruns/OUT/tmp/use_keyfile.bin'
    Working directory cleaned.
    Finished: Successfully found decryption key, copied to 'tmp/use_keyfile.bin'
    
    Decrypting ZIP files
    
    Decrypting (1/25) 'zip_0.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_0.zip
    ... immediate cleanup specified, deleting 'zip_0.zip'
    
    Decrypting (2/25) 'zip_1.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_1.zip
    ... immediate cleanup specified, deleting 'zip_1.zip'
    
    Decrypting (3/25) 'zip_2.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_2.zip
    ... immediate cleanup specified, deleting 'zip_2.zip'
    
    Decrypting (4/25) 'zip_3.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_3.zip
    ... immediate cleanup specified, deleting 'zip_3.zip'
    
    Decrypting (5/25) 'zip_4.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_4.zip
    ... immediate cleanup specified, deleting 'zip_4.zip'
    
    Decrypting (6/25) 'zip_5.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_5.zip
    ... immediate cleanup specified, deleting 'zip_5.zip'
    
    Decrypting (7/25) 'zip_6.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_6.zip
    ... immediate cleanup specified, deleting 'zip_6.zip'
    
    Decrypting (8/25) 'zip_7.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_7.zip
    ... immediate cleanup specified, deleting 'zip_7.zip'
    
    Decrypting (9/25) 'zip_8.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_8.zip
    ... immediate cleanup specified, deleting 'zip_8.zip'
    
    Decrypting (10/25) 'zip_9.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_9.zip
    ... immediate cleanup specified, deleting 'zip_9.zip'
    
    Decrypting (11/25) 'zip_10.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_10.zip
    ... immediate cleanup specified, deleting 'zip_10.zip'
    
    Decrypting (12/25) 'zip_11.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_11.zip
    ... immediate cleanup specified, deleting 'zip_11.zip'
    
    Decrypting (13/25) 'zip_12.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_12.zip
    ... immediate cleanup specified, deleting 'zip_12.zip'
    
    Decrypting (14/25) 'zip_13.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_13.zip
    ... immediate cleanup specified, deleting 'zip_13.zip'
    
    Decrypting (15/25) 'zip_14.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_14.zip
    ... immediate cleanup specified, deleting 'zip_14.zip'
    
    Decrypting (16/25) 'zip_15.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_15.zip
    ... immediate cleanup specified, deleting 'zip_15.zip'
    
    Decrypting (17/25) 'zip_16.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_16.zip
    ... immediate cleanup specified, deleting 'zip_16.zip'
    
    Decrypting (18/25) 'zip_17.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_17.zip
    ... immediate cleanup specified, deleting 'zip_17.zip'
    
    Decrypting (19/25) 'zip_18.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_18.zip
    ... immediate cleanup specified, deleting 'zip_18.zip'
    
    Decrypting (20/25) 'zip_19.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_19.zip
    ... immediate cleanup specified, deleting 'zip_19.zip'
    
    Decrypting (21/25) 'zip_20.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_20.zip
    ... immediate cleanup specified, deleting 'zip_20.zip'
    
    Decrypting (22/25) 'zip_21.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_21.zip
    ... immediate cleanup specified, deleting 'zip_21.zip'
    
    Decrypting (23/25) 'zip_22.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_22.zip
    ... immediate cleanup specified, deleting 'zip_22.zip'
    
    Decrypting (24/25) 'zip_23.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_23.zip
    ... immediate cleanup specified, deleting 'zip_23.zip'
    
    Decrypting (25/25) 'zip_24.zip'
    Encrypted zip detected, running ruuveal...
    ruuveal
    -------
    
    Decrypted RUU (zip) written to: /media/nkk71/RUU/testruns/OUT/decrypted_zips/dec_zip_24.zip
    ... immediate cleanup specified, deleting 'zip_24.zip'
    Finished: Successfully decrypted zips to 'decrypted_zips'
    
    Unzipping decrypted ZIP files
    
    Unzipping decrypted zip: (1/25) 'dec_zip_0.zip'
    Archive:  dec_zip_0.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/android-info.txt  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/radio.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/rcdata.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/splash1.nb0  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/adsp.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/rfg_3.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/android-info2.txt  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/sensor_hub.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/tp_SYN3708.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/gpt_main_16g.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/gpt_main_64g.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/gpt_main_32g.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/pmic-8996-1.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/pg2fs_ship_signkey.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/apppreload.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/rpm-8996-1.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/tz-8996-1.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/hyp-8996-1.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/modemst2.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/modemst1.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/cota.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/partition_info  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/dsp.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/fsc.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/venus.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/aboot_signed.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/cs_CY8C.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/hosd_signed.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/keymaster.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/xbl-8996-1.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/slpi.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/recovery_signed.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/lksecapp.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/boot_signed.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/usb_typec.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/cmnlib64.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/usb_typec_otp.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/backup_android-info.txt  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/devcfg-8996-1.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/cmnlib32.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/apdp-8996-1.img  
    ... immediate cleanup specified, deleting 'dec_zip_0.zip'
    
    Unzipping decrypted zip: (2/25) 'dec_zip_1.zip'
    Archive:  dec_zip_1.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_00  
    ... immediate cleanup specified, deleting 'dec_zip_1.zip'
    
    Unzipping decrypted zip: (3/25) 'dec_zip_2.zip'
    Archive:  dec_zip_2.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_01  
    ... immediate cleanup specified, deleting 'dec_zip_2.zip'
    
    Unzipping decrypted zip: (4/25) 'dec_zip_3.zip'
    Archive:  dec_zip_3.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_02  
    ... immediate cleanup specified, deleting 'dec_zip_3.zip'
    
    Unzipping decrypted zip: (5/25) 'dec_zip_4.zip'
    Archive:  dec_zip_4.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_03  
    ... immediate cleanup specified, deleting 'dec_zip_4.zip'
    
    Unzipping decrypted zip: (6/25) 'dec_zip_5.zip'
    Archive:  dec_zip_5.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_04  
    ... immediate cleanup specified, deleting 'dec_zip_5.zip'
    
    Unzipping decrypted zip: (7/25) 'dec_zip_6.zip'
    Archive:  dec_zip_6.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_05  
    ... immediate cleanup specified, deleting 'dec_zip_6.zip'
    
    Unzipping decrypted zip: (8/25) 'dec_zip_7.zip'
    Archive:  dec_zip_7.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_06  
    ... immediate cleanup specified, deleting 'dec_zip_7.zip'
    
    Unzipping decrypted zip: (9/25) 'dec_zip_8.zip'
    Archive:  dec_zip_8.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_07  
    ... immediate cleanup specified, deleting 'dec_zip_8.zip'
    
    Unzipping decrypted zip: (10/25) 'dec_zip_9.zip'
    Archive:  dec_zip_9.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_08  
    ... immediate cleanup specified, deleting 'dec_zip_9.zip'
    
    Unzipping decrypted zip: (11/25) 'dec_zip_10.zip'
    Archive:  dec_zip_10.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_09  
    ... immediate cleanup specified, deleting 'dec_zip_10.zip'
    
    Unzipping decrypted zip: (12/25) 'dec_zip_11.zip'
    Archive:  dec_zip_11.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_10  
    ... immediate cleanup specified, deleting 'dec_zip_11.zip'
    
    Unzipping decrypted zip: (13/25) 'dec_zip_12.zip'
    Archive:  dec_zip_12.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_11  
    ... immediate cleanup specified, deleting 'dec_zip_12.zip'
    
    Unzipping decrypted zip: (14/25) 'dec_zip_13.zip'
    Archive:  dec_zip_13.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_12  
    ... immediate cleanup specified, deleting 'dec_zip_13.zip'
    
    Unzipping decrypted zip: (15/25) 'dec_zip_14.zip'
    Archive:  dec_zip_14.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_13  
    ... immediate cleanup specified, deleting 'dec_zip_14.zip'
    
    Unzipping decrypted zip: (16/25) 'dec_zip_15.zip'
    Archive:  dec_zip_15.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_14  
    ... immediate cleanup specified, deleting 'dec_zip_15.zip'
    
    Unzipping decrypted zip: (17/25) 'dec_zip_16.zip'
    Archive:  dec_zip_16.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_15  
    ... immediate cleanup specified, deleting 'dec_zip_16.zip'
    
    Unzipping decrypted zip: (18/25) 'dec_zip_17.zip'
    Archive:  dec_zip_17.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_16  
    ... immediate cleanup specified, deleting 'dec_zip_17.zip'
    
    Unzipping decrypted zip: (19/25) 'dec_zip_18.zip'
    Archive:  dec_zip_18.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_17  
    ... immediate cleanup specified, deleting 'dec_zip_18.zip'
    
    Unzipping decrypted zip: (20/25) 'dec_zip_19.zip'
    Archive:  dec_zip_19.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_18  
    ... immediate cleanup specified, deleting 'dec_zip_19.zip'
    
    Unzipping decrypted zip: (21/25) 'dec_zip_20.zip'
    Archive:  dec_zip_20.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_19  
    ... immediate cleanup specified, deleting 'dec_zip_20.zip'
    
    Unzipping decrypted zip: (22/25) 'dec_zip_21.zip'
    Archive:  dec_zip_21.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_20  
    ... immediate cleanup specified, deleting 'dec_zip_21.zip'
    
    Unzipping decrypted zip: (23/25) 'dec_zip_22.zip'
    Archive:  dec_zip_22.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_21  
    ... immediate cleanup specified, deleting 'dec_zip_22.zip'
    
    Unzipping decrypted zip: (24/25) 'dec_zip_23.zip'
    Archive:  dec_zip_23.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/system.img_22  
    ... immediate cleanup specified, deleting 'dec_zip_23.zip'
    
    Unzipping decrypted zip: (25/25) 'dec_zip_24.zip'
    Archive:  dec_zip_24.zip
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/dzdata_16g.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/dzdata_32g.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/dzdata_16g.hdr  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/dzdata_64g.hdr  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/cache.img  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/dzdata_32g.hdr  
      inflating: /media/nkk71/RUU/testruns/OUT/firmware/dzdata_64g.img  
    ... immediate cleanup specified, deleting 'dec_zip_24.zip'
    Finished: Successfully unzipped files to 'firmware'
    
    Moving system img files
       (1/23) moving system.img_00
       (2/23) moving system.img_01
       (3/23) moving system.img_02
       (4/23) moving system.img_03
       (5/23) moving system.img_04
       (6/23) moving system.img_05
       (7/23) moving system.img_06
       (8/23) moving system.img_07
       (9/23) moving system.img_08
       (10/23) moving system.img_09
       (11/23) moving system.img_10
       (12/23) moving system.img_11
       (13/23) moving system.img_12
       (14/23) moving system.img_13
       (15/23) moving system.img_14
       (16/23) moving system.img_15
       (17/23) moving system.img_16
       (18/23) moving system.img_17
       (19/23) moving system.img_18
       (20/23) moving system.img_19
       (21/23) moving system.img_20
       (22/23) moving system.img_21
       (23/23) moving system.img_22
    Finished: Successfully moved system img files to 'decrypted_system'
    
    Attempting to create system.img
    Multi-part system images (23 parts)
    Sparse Image detected, using simg2img
        Please be patient, this can take several minutes...
    finished.
    Finished: Successfully created system.img 'system/system.img'
    
    Testing system.img...
    e2fsck 1.42.9 (4-Feb-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
    system: 4674/242880 files (0.0% non-contiguous), 848835/971227 blocks
    Finished: system.img successfully passed filesystem check
    
    Adding boot.img to the system folder
    Copying firmware/boot_signed.img to system/boot.img
    
    Restoring 'rom.zip' to normal folder
    
    Removing unneeded work folders
    Finished: Successfully extracted zip files to
                 '/media/nkk71/RUU/testruns/OUT'

    Output Files
    Code:
    nkk71@ubuntu:/media/nkk71/RUU/testruns$ ls -lR OUT/
    OUT/:
    total 12
    drwxrwxr-x 2 nkk71 nkk71 4096 May 20 15:16 firmware
    drwxrwxr-x 2 nkk71 nkk71 4096 May 20 15:17 system
    drwxrwxr-x 2 nkk71 nkk71 4096 May 20 15:13 tmp
    
    OUT/firmware:
    total 368136
    -rw-rw-r-- 1 nkk71 nkk71   933120 Apr 23 23:07 aboot_signed.img
    -rwxrwxr-x 1 nkk71 nkk71 11527168 Apr 23 22:40 adsp.img
    -rw-rw-rw- 1 nkk71 nkk71      177 Apr 23 23:50 android-info2.txt
    -rw-rw-rw- 1 nkk71 nkk71      969 Apr 23 23:50 android-info.txt
    -rw-rw-r-- 1 nkk71 nkk71    13248 Apr 23 22:40 apdp-8996-1.img
    -rw-rw-r-- 1 nkk71 nkk71 62914560 Apr 23 22:56 apppreload.img
    -rw-rw-r-- 1 nkk71 nkk71      969 Apr 23 23:54 backup_android-info.txt
    -rw-rw-r-- 1 nkk71 nkk71 41371109 Apr 23 23:07 boot_signed.img
    -rw-rw-r-- 1 nkk71 nkk71  6136028 Apr 23 22:52 cache.img
    -rw-rw-r-- 1 nkk71 nkk71   193152 Apr 23 22:40 cmnlib32.img
    -rw-rw-r-- 1 nkk71 nkk71   239642 Apr 23 22:40 cmnlib64.img
    -rw-rw-r-- 1 nkk71 nkk71 62914560 Apr 23 22:56 cota.img
    -rwxrwxr-x 1 nkk71 nkk71    18906 Apr 23 22:40 cs_CY8C.img
    -rw-rw-r-- 1 nkk71 nkk71    39738 Apr 23 22:40 devcfg-8996-1.img
    -rw-rw-r-- 1 nkk71 nkk71 16777216 Apr 23 22:40 dsp.img
    -rw-rw-r-- 1 nkk71 nkk71    12512 Apr 23 22:55 dzdata_16g.hdr
    -rw-rw-r-- 1 nkk71 nkk71  2229472 Apr 23 22:55 dzdata_16g.img
    -rw-rw-r-- 1 nkk71 nkk71    20592 Apr 23 22:55 dzdata_32g.hdr
    -rw-rw-r-- 1 nkk71 nkk71  2545264 Apr 23 22:55 dzdata_32g.img
    -rw-rw-r-- 1 nkk71 nkk71    24384 Apr 23 22:56 dzdata_64g.hdr
    -rw-rw-r-- 1 nkk71 nkk71  2776384 Apr 23 22:56 dzdata_64g.img
    -rwxrwxr-x 1 nkk71 nkk71     1024 Apr 23 22:40 fsc.img
    -rw-rw-r-- 1 nkk71 nkk71    17408 Apr 23 22:30 gpt_main_16g.img
    -rw-rw-r-- 1 nkk71 nkk71    17408 Apr 23 22:30 gpt_main_32g.img
    -rw-rw-r-- 1 nkk71 nkk71    17408 Apr 23 22:30 gpt_main_64g.img
    -rw-rw-r-- 1 nkk71 nkk71 44893669 Apr 23 23:07 hosd_signed.img
    -rw-rw-r-- 1 nkk71 nkk71   260050 Apr 23 22:40 hyp-8996-1.img
    -rw-rw-r-- 1 nkk71 nkk71   226026 Apr 23 22:40 keymaster.img
    -rw-rw-r-- 1 nkk71 nkk71    57370 Apr 23 22:40 lksecapp.img
    -rwxrwxr-x 1 nkk71 nkk71  2097152 Apr 23 22:40 modemst1.img
    -rwxrwxr-x 1 nkk71 nkk71  2097152 Apr 23 22:40 modemst2.img
    -rw-rw-r-- 1 nkk71 nkk71     1499 Apr 23 22:30 partition_info
    -rwxrwxr-x 1 nkk71 nkk71     3388 Apr 23 22:40 pg2fs_ship_signkey.img
    -rw-rw-r-- 1 nkk71 nkk71    42763 Apr 23 22:40 pmic-8996-1.img
    -rw-r--r-- 1 nkk71 nkk71 55010304 Apr 23 23:50 radio.img
    -rw-rw-r-- 1 nkk71 nkk71      302 Apr 23 23:50 rcdata.img
    -rw-rw-r-- 1 nkk71 nkk71 43177449 Apr 23 23:07 recovery_signed.img
    -rw-rw-r-- 1 nkk71 nkk71   837120 Apr 23 23:50 rfg_3.img
    -rw-rw-r-- 1 nkk71 nkk71   229440 Apr 23 22:40 rpm-8996-1.img
    -rw-rw-r-- 1 nkk71 nkk71   466832 Apr 23 22:40 sensor_hub.img
    -rwxrwxr-x 1 nkk71 nkk71  3597312 Apr 23 22:40 slpi.img
    -rw-rw-r-- 1 nkk71 nkk71  7471104 Apr 23 23:50 splash1.nb0
    -rwxrwxr-x 1 nkk71 nkk71   203069 Apr 23 22:40 tp_SYN3708.img
    -rw-rw-r-- 1 nkk71 nkk71  1478674 Apr 23 22:40 tz-8996-1.img
    -rw-rw-r-- 1 nkk71 nkk71    32768 Apr 23 22:40 usb_typec.img
    -rw-rw-r-- 1 nkk71 nkk71    22248 Apr 23 22:40 usb_typec_otp.img
    -rw-rw-r-- 1 nkk71 nkk71  2067968 Apr 23 22:40 venus.img
    -rwxrwxr-x 1 nkk71 nkk71  1848492 Apr 23 22:40 xbl-8996-1.img
    
    OUT/system:
    total 3400988
    -rw-rw-r-- 1 nkk71 nkk71   41371109 May 20 15:17 boot.img
    -rw-rw-r-- 1 nkk71 nkk71 4009508864 May 20 15:17 system.img
    
    OUT/tmp:
    total 4
    -rw-rw-r-- 1 nkk71 nkk71 96 May 20 15:13 use_keyfile.bin
    nkk71@ubuntu:/media/nkk71/RUU/testruns$