Misc [Release] CafeKit: Decrypt WUP packages to improve compression

leonardorg

Active Member
OP
Newcomer
Joined
May 8, 2022
Messages
30
Trophies
0
Age
28
Location
São Paulo
XP
599
Country
Brazil
A utility that decrypts Wii U NUS content to save space on compression, then re-encrypts the content with 1:1 output from the original NUS package

This tool is based on cdecrypt, but unlike cdecrypt, this tool doesn't extract the WUP package, it simply decrypts the content to optimize compression by other tools, like zip, rar, 7z, NTFS... while allowing you to re-encrypt it later and get exactly the same content that you had before it's decryption.

In my tests I could get a compression ratio between 60 ~ 75%, so, you will save some hard drive space with this tool to store your favorite games before Nintendo servers go away next month ...

Please, don't blindly trust 100% in this tool yet, I have tested this tool with 18 games so far, and all of them re-encrypted correctly, but we may have some edge cases in some packages, as I don't know if there is knowledge of every obscure feature that a NUS package may hide, so, it's a good idea to re-encrypt your game and check if the re-encrypted output and the original package are the same... you can use tools like HashCheck Shell Extension or any other tool to check for duplicate files ...

You can get this tool from it's release page on github: https://github.com/leonardothehuman/cafeKit/releases/tag/v0.1.1.72

EDIT: Seems like some people may get confuset with the intended usage of this tool, so, as @V10lator said:

The way I understand it is that you do it this way:
- decrypt the content
- compress it with some 3rd party tool
- store the result
Then, when you want to play the game again:
- decompress the archive
- re-encrypt the content
- install the result
Yes, this is a tool to save space on your personal backups, since encrypted data can not be efficiently compressed, this tool decompresses it, when you want to install the game on your WiiU again, you just have to reencrypt it to get exactely what you had before.
 
Last edited by leonardorg,

ber71

Well-Known Member
Member
Joined
Apr 24, 2019
Messages
566
Trophies
0
Age
58
XP
2,491
Country
Spain
Thanks. So we can see this as a kind of nsz container used for nsw games, but for wiiu. Well, not really a container, let's say contents for a well compressed container.

I don't get this

re-encrypts the content with 1:1 output

wdym, is the output decrypted (thus not directly installable), or is it re-encrypted with some null key?
 

V10lator

Well-Known Member
Member
Joined
Apr 21, 2019
Messages
2,664
Trophies
1
Age
36
XP
5,639
Country
Germany
From a quick look this seems to hardcode the Wii U common key, which might be illegal in some countries.
Beside that I wonder why it uses custom crypto implemtations instead of i.e. openSSL and why Windows gets utf8 to utf16 implemtations while other operating systems just use utf8 as is?

Now to the question of @ber71: I can't tell what key gets used to re-encrypt. Would need more time to analyze the sources. My guess is that it just reads the key from the title.tik file through, so it might use the original key, hence producing 1:1 matching output.

//EDIT: @ber71 The way I understand it is that you do it this way:
- decrypt the content
- compress it with some 3rd party tool
- store the result
Then, when you want to play the game again:
- decompress the archive
- re-encrypt the content
- install the result
 
  • Like
Reactions: ber71

leonardorg

Active Member
OP
Newcomer
Joined
May 8, 2022
Messages
30
Trophies
0
Age
28
Location
São Paulo
XP
599
Country
Brazil
From a quick look this seems to hardcode the Wii U common key, which might be illegal in some countries.
Beside that I wonder why it uses custom crypto implemtations instead of i.e. openSSL and why Windows gets utf8 to utf16 implemtations while other operating systems just use utf8 as is?

Now to the question of @ber71: I can't tell what key gets used to re-encrypt. Would need more time to analyze the sources. My guess is that it just reads the key from the title.tik file through, so it might use the original key, hence producing 1:1 matching output.
This tool was based on the latest version of cdecrypt by VitaSmith, I am not an expert of C language, I only have experience with C++ on microcontrollers, on PC I usually use higher level programing languages, so most of things was left as i have found, non object oriented languages messes with my head :wacko:. I believe it's easier to succefuly compile the application if it don't rely on external libraries, also, this utf8 to utf16 implemtations is not used on my tool, it's just some leftover code (it was used just to parse the arguments), also, cafekit makes some Windows api calls, so it will not compile on other oses, the binary was built with embarcadero Dev-C++ so i don't have to install the heavyweight visual studio just to do this, i just wanted that a tool like this existed before the end of the next month, the current code is not that clean code that you would expect from a well refactored code, but it get things done...

//EDIT: @ber71 The way I understand it is that you do it this way:
- decrypt the content
- compress it with some 3rd party tool
- store the result
Then, when you want to play the game again:
- decompress the archive
- re-encrypt the content
- install the result
Yes, that's how this tool is intended to be used, just to save space on my personal backups...
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • SylverReZ @ SylverReZ:
    @mthrnite, Cheetah Girls, the sequel to Action 52's Cheetah Men.
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    Pokemon Black I played that one a lot
  • K3Nv2 @ K3Nv2:
    Honestly never messed with Pokémon on ds much
  • mthrnite @ mthrnite:
    I played pokemon once, was bored, never tried again
  • Psionic Roshambo @ Psionic Roshambo:
    Oh Dragon Quest IX
  • K3Nv2 @ K3Nv2:
    Spent like 5 hours on switch one never touched it again
  • Psionic Roshambo @ Psionic Roshambo:
    Sentinel of the stary skies
  • K3Nv2 @ K3Nv2:
    Ds is 20 years old this year
  • Psionic Roshambo @ Psionic Roshambo:
    So MJ no longer wants to play with it?
  • K3Nv2 @ K3Nv2:
    He put it down when the 3ds came out
  • SylverReZ @ SylverReZ:
    @K3Nv2, RIP Felix does great videos on the PS3 yellow-light-of-death.
  • Jayro @ Jayro:
    Eventhough the New 3DS XL is more powerful, I still feel like the DS Lite was a more polished system. It's a real shame that it never got an XL variant keeping the GBA slot. You'd have to go on AliExpress and buy an ML shell to give a DS phat the unofficial "DS Lite" treatment, and that's the best we'll ever get I'm afraid.
    +1
  • Jayro @ Jayro:
    The phat model had amazingly loud speakers tho.
    +1
  • SylverReZ @ SylverReZ:
    @Jayro, I don't see whats so special about the DS ML, its just a DS lite in a phat shell. At least the phat model had louder speakers, whereas the lite has a much better screen.
    +1
  • SylverReZ @ SylverReZ:
    They probably said "Hey, why not we combine the two together and make a 'new' DS to sell".
  • Veho @ Veho:
    It's a DS Lite in a slightly bigger DS Lite shell.
    +1
  • Veho @ Veho:
    It's not a Nintendo / iQue official product, it's a 3rd party custom.
    +1
  • Veho @ Veho:
    Nothing special about it other than it's more comfortable than the Lite
    for people with beefy hands.
    +1
  • Jayro @ Jayro:
    I have yaoi anime hands, very lorge but slender.
  • Jayro @ Jayro:
    I'm Slenderman.
  • Veho @ Veho:
    I have hands.
    Veho @ Veho: +1