JWUDTool - a Java WiiU Disc Image tool!

Discussion in 'Wii U - Homebrew' started by Maschell, Dec 13, 2016.

  1. Maschell
    OP

    Maschell GBAtemp Advanced Fan

    Member
    884
    1,282
    Jun 14, 2008
    Gambia, The
    JWUDTool 0.1

    Here is just a simple program that uses the (http://gbatemp.net/threads/jnuslib-java-nus-library.452954/).
    The usage should be pretty self explaining.

    Features

    • Compressing .wud and splitted wud files into .wux
    • Extracting .app/-h3/.tmd/.cert/.tik files from a .wud/.wux or splitted .wud
    • Extracting just the contents/hashes/ticket.
    • Decrypting the full game partition from a .wud/.wux or splitted .wud
    • Decrypting specific files the game partition from a .wud/.wux or splitted .wud
    • Verify a image / Compare two images (for example a .wud with .wux to make sure its legit)
    Download

    Release: https://github.com/Maschell/JWUDTool/releases/
    Source: https://github.com/Maschell/JWUDTool

    Usage

    Optional:
    - Copy the common.key into the folder next to the .jar or provide the key via the command line
    - Copy the game.key into the folder next to the wud image or provide the key via the command line

    usage:
    -commonkey <WiiU common key> Optional. HexString. Will be used if no "common.key" in the
    folder of this .jar is found
    -compress Compresses the input to a .wux file.
    -decrypt Decrypts full the game partition of the given wud.
    -decryptFile <regular expression> Decrypts full the game partition of the given wud.
    -extract <all|content|ticket|hashes> Extracts files from the game partition of the given wud
    (Arguments optional)
    -help shows this text
    -in <input file> Input file. Can be a .wux, .wud or a game_part1.wud
    -noVerify Disables verification after compressing
    -out <output path> The path where the result will be saved
    -overwrite Optional. Overwrites existing files
    -titlekey <WUD title key> Optional. HexString. Will be used if no "game.key" in the
    folder of the wud image is found
    -verify <wudimage1|wudimage2> Compares two WUD images to find differencess


    Getting .app files from an Wii U Image:

    Extract .app etc. from a WUD:
    Get .app files from "game.wud" to the folder "extracted" with game.key in the same folder
    Code:
    java -jar JWUDTool.jar -in "game.wud" -out "extracted" -extract all
    
    Extract .app etc. from a WUX (compressed WUD):
    Get .app files from "game.wux" to the folder "extracted" with game.key in the same folder
    Code:
    java -jar JWUDTool.jar -in "game.wux" -out "extracted" -extract all
    
    Extract .app etc. from a splitted WUD (dump with wudump):
    Get .app files from "game_part1.wud" to the folder "extracted" with game.key in the same folder
    Code:
    java -jar JWUDTool.jar -in "game_part1.wud" -out "extracted" -extract all
    
    Compressing examples:

    Compress a .wud to .wux:
    Compress a "game.wud" to "game.wux"
    Code:
    java -jar JWUDTool.jar -in "game.wud" -compress
    
    Compress a splitted game_part1.wud to .wux:
    Compress a "game_part1.wud" from a wudump dump to "game.wux"
    Code:
    java -jar JWUDTool.jar -in "game_part1.wud" -compress
    
    Decryption examples:

    Decrypt a WUD image to game files
    Input can be a .wud, game_part1.wud or a .wux. This decrypted the full game partition.
    Given a game.key and common.key in the same folder.
    Code:
    java -jar JWUDTool.jar -in "game.wud" -decrypt //WUD
    java -jar JWUDTool.jar -in "game.wux" -decrypt //WUX
    java -jar JWUDTool.jar -in "game_part1.wud" -decrypt //game_part1
    
    Decrypt a single file from an WUD image
    Input can be a .wud, game_part1.wud or a .wux. This decrypted the full game partition.
    Given a game.key and common.key in the same folder.

    Extracting the code/app.xml file.
    Code:
    java -jar JWUDTool.jar -in "game.wud" -decryptFile /code/app.xml
    java -jar JWUDTool.jar -in "game.wux" -decryptFile /code/app.xml
    java -jar JWUDTool.jar -in "game_part1.wud" -decryptFile /code/app.xml
    
    Extracting all .bfstm files.
    Code:
    java -jar JWUDTool.jar -in "game.wud" -decryptFile /.*.bfstm
    java -jar JWUDTool.jar -in "game.wux"  -decryptFile /.*.bfstm
    java -jar JWUDTool.jar -in "game_part1.wud" -decryptFile /.*.bfstm
    
    Extracting the folder /content/Sound
    Code:
    java -jar JWUDTool.jar -in "game.wud" -decryptFile /content/Sound/.*
    java -jar JWUDTool.jar -in "game.wux"  -decryptFile /content/Sound/.*
    java -jar JWUDTool.jar -in "game_part1.wud" -decryptFile /content/Sound/.*
    
    Compiling

    Add the "jnuslib.jar" into the library path and load the other dependicies throuugh maven.

    Credits

    Maschell

    Thanks to:
    Crediar for CDecrypt (https://github.com/crediar/cdecrypt)
    All people who have contributed to vgmtoolbox (https://sourceforge.net/projects/vgmtoolbox/)
    Exzap for the .wux file format (https://gbatemp.net/threads/wii-u-image-wud-compression-tool.397901/)
    FIX94 for wudump (https://gbatemp.net/threads/wudump-dump-raw-images-from-a-wiiu-game-disc.451736/)
    The creators of lombok for lombok https://projectlombok.org/index.html
     
    Last edited by Maschell, May 15, 2017
    fejich, lordelan, I pwned U! and 7 others like this.
  2. Dylon99

    Dylon99 Lord of Dank

    Member
    541
    325
    Jan 12, 2016
    Netherlands
    Some cave in the mariana trench
    Good stuff Maschell! :yayu:
     
    Maschell likes this.
  3. fejich

    fejich Newbie

    Newcomer
    7
    7
    Nov 26, 2016
    Switzerland
    awesome!!!!
     
    Maschell likes this.
  4. kavid

    kavid GBAtemp Advanced Fan

    Member
    547
    38
    Sep 28, 2008
    Switzerland
    no gui
     
  5. tunip3

    tunip3 [debugger active]

    Member
    619
    103
    Oct 31, 2016
    United Kingdom
    can we have some usage examples of a full line
     
  6. lafleche

    lafleche GBAtemp Fan

    Member
    377
    81
    Jan 4, 2007
    Netherlands
    Very nice tool
    I compressed all my wud files into wux with wudcompress.....A real discspace saver.
    This tool can extract both encrypted as decrypted files from them.

    Even the lego movie wud/wux (venom release) which cannot be extracted bij discu extracts like a charm....

    — Posts automatically merged - Please don't double post! —

    Sample extracting files for Wupinstaller
    Java -jar jwudtool -extract all -in nameofwudorwux -out pathtodirectory

    To make it easy place file with common.key into jar directory.
    Rename disc key file to game.key
     
    Maschell likes this.
  7. tunip3

    tunip3 [debugger active]

    Member
    619
    103
    Oct 31, 2016
    United Kingdom
    how do you use it
     
  8. lafleche

    lafleche GBAtemp Fan

    Member
    377
    81
    Jan 4, 2007
    Netherlands
    Please read!!! Will not repeat myself
     
  9. tunip3

    tunip3 [debugger active]

    Member
    619
    103
    Oct 31, 2016
    United Kingdom
    i wrote that befor i saw the wcomand and i meant how would you decrypt to loadiine format
     
  10. lafleche

    lafleche GBAtemp Fan

    Member
    377
    81
    Jan 4, 2007
    Netherlands
    I guess something like
    Java -jar jwudtool -decrypt -in nameofwudorwux -out pathtodirectory

    With again a common.key and a game.key file instead of passing them as argument
     
  11. H_Oz

    H_Oz Newbie

    Newcomer
    5
    1
    May 19, 2016
    Thanks a lot for this tool, it's very useful!
    I'd like to report one small issue that I had, I don't know if it's a bug or not, but it might be worth mentioning it: I have the splitted .wuds of my discs (generated by wudump made by FIX94) on a FAT32 external hard disk. I was testing the compress feature (obviously saving the output file on the internal hard disk becasue of the 4GB limit on FAT32 partitions) and with 2 of my .wuds (Star Fox Zero and Tokyo Mirage Sessions #FE) at some point (around 70/80%) it stopped verifying the image after the compression. However hitting Enter on the keyboard made it continue without problems. As I said I don't know if it's a bug of JWUDTool or something else.
     
    Maschell likes this.
  12. riyyi

    riyyi Member

    Newcomer
    19
    2
    Sep 13, 2009
    Netherlands
    I'm trying to extract the .app data from this .wud but it's not working. This is the command I use.

    Code:
    java -jar JWUDTool.jar -commonkey 6a0b87fc98b306ae3366f0e0a88d0b06a2813313 -titlekey BA3A06F9DAB9E0EE9B175ABF4A05E1B3 -extract all -in [NAME].wud
    I have the game.wud and game.key, but not a common.key file, could someone send me that?
    And yes in case you are wondering the game is Just Dance 2016 [PAL]
     
    Last edited by riyyi, Feb 21, 2017
  13. lafleche

    lafleche GBAtemp Fan

    Member
    377
    81
    Jan 4, 2007
    Netherlands
    Not allowed to distribute common.key here.
    Very strange you managed to find the Sha of the common key but not the key itself :-)
    Google it.... The Sha should not be part of your command
     
  14. riyyi

    riyyi Member

    Newcomer
    19
    2
    Sep 13, 2009
    Netherlands
    Okay, I managed to get it to work. I couldnt find a common.key file, but the common key was wrong.
    So I Googled for another and added that as an argument instead.
     
  15. cucholix

    cucholix No-Intro

    Member
    455
    207
    Jan 17, 2017
    Chile
    You can dump common.key from a retail disc, use FIX94's wudump tool it will dump the common.key first, no need to wait dump the whole game.
     
  16. M4rM0rKuch3N

    M4rM0rKuch3N Newbie

    Newcomer
    1
    0
    May 1, 2017
    Australia
    Hi.. Can somehow the title.tik be used instead of the game.key ?
     
  17. Maschell
    OP

    Maschell GBAtemp Advanced Fan

    Member
    884
    1,282
    Jun 14, 2008
    Gambia, The
    In theory yes, but not with the existing tools

    Edit: only when you also have the title.tmd and now the offset of the game partiton (you could maybe bruteforce it?)
     
    Last edited by Maschell, May 2, 2017
  18. nexusmtz

    nexusmtz GBAtemp Maniac

    Member
    1,242
    428
    Feb 17, 2016
    United States
    Can you give a little background there? I have two discs with identical title.tik files, but with different game.key files, and the game.key files are not interchangeable. How would someone find the proper key if one tik could produce multiple candidate derivations? I didn't think that the .tik was related to the WUD encryption.
     
  19. Maschell
    OP

    Maschell GBAtemp Advanced Fan

    Member
    884
    1,282
    Jun 14, 2008
    Gambia, The
    Oh, I was missing something. You need the game.key for the partition offset of the game partition (and getting the title.tmd/title.key).

    You could probably bruteforce the partition offset though. But you still need the tmd
     
    Last edited by Maschell, May 2, 2017
    nexusmtz likes this.
  20. Maschell
    OP

    Maschell GBAtemp Advanced Fan

    Member
    884
    1,282
    Jun 14, 2008
    Gambia, The
    I added some examples to the first post!