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

leonardorg

Active Member
OP
Newcomer
Joined
May 8, 2022
Messages
27
Trophies
0
Age
28
Location
São Paulo
XP
579
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
561
Trophies
0
Age
58
XP
2,465
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,635
Trophies
1
Age
36
XP
5,494
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
27
Trophies
0
Age
28
Location
São Paulo
XP
579
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.
    K3Nv2 @ K3Nv2: Lol rappers still promoting crypto