Hacking [Release] CDecrypt v4.x

  • Thread starter Thread starter VitaSmith
  • Start date Start date
  • Views Views 48,648
  • Replies Replies 16
  • Likes Likes 14

VitaSmith

Member
Newcomer
Joined
Dec 10, 2020
Messages
10
Reaction score
23
Trophies
0
Age
46
XP
117
Country
Ireland
CDecrypt is a small application that decrypts/unpacks Wii U NUS Content.

This is an updated version of the original CDecrypt by crediar.

This updated version:
  • Has no external dependency whatsoever (no libOpenSSL or MSVC redistributable)
  • Has its releases built publicly on AppVeyor (which you can validate with the SHA-256 of the archive output in the build log, so that you can confirm that the download doesn't include anything hidden/malicious)
  • Can be compiled for Windows, Linux and macOS
  • Supports long paths on platforms that allow it
  • Supports international characters in path names
  • Does not need the executable to reside in the same directory as the content
  • Accepts either a file or directory (including non .tik/.tmd files)
  • Accepts an optional target directory for extraction
  • And is of course fully Open Source (GPLv3+) with its source on GitHub
You can download the latest Windows release HERE.

Enjoy! ^_^
 
Last edited by VitaSmith,
I'm not planning to do that for the time being, as the vast majority of people will run Windows, and recompiling for Linux is very straightforward (as opposed to compiling anything for Windows, since most Windows users don't have a toolchain available).

Also, some people will want ARM64 Linux binaries, other x86_32 bit binaries and others x86_64 binaries, which makes it a pain in the ass to satisfy everyone. It's just too much effort for too little benefit, when anybody on Linux is just a git clone https://github.com/VitaSmith/cdecrypt.git; cd cdecrypt; make away from a binary.

But if you have trouble compiling CDecrypt on Linux, please let me know (or log an issue in the issue tracker).
 
Last edited by VitaSmith,
It compiles fine, no problem with that.

After a look at the code, you may want to not hardcode the wiiu common keys as these could get you into troubles. Old cdcrypt releases read them from a keys.txt file.

Another suggestion: missing from the old versions is the ability to set an output directory.
 
I considered what you suggest long before officially publishing the project, and rejected both options because:
  1. There are other projects on GitHub with these keys and this is a fork of the Google Code project that already had them. Considering that these have been up for years without any trouble, I don't see the caution being warranted, especially when it would make it exceedingly inconvenient for users.
  2. I don't expect there will be much demand for extraction into a custom directory, and considering that this is a very niche product, there's only so much time I want to invest adding features that few people are going to use.
 
Last edited by VitaSmith,
Well, since I needed an excuse to release a new version, now that I have added macOS compilation support, I have just added the ability to provide an optional target extraction directory (while keeping compatibility with previous versions of CDecrypt that may take both a .tmd and .tik as parameters).
 
  • Like
Reactions: ber71
But if you have trouble compiling CDecrypt on Linux, please let me know (or log an issue in the issue tracker).

Hi... I've tried to compile it on LInux Mint and here's the output of "make":
Code:
[C] cdecrypt.c
cdecrypt.c: In function ‘extract_file_hash’:
cdecrypt.c:241:9: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
  241 |         fread(enc, sizeof(char), BLOCK_SIZE, src);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cdecrypt.c: In function ‘extract_file’:
cdecrypt.c:327:9: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
  327 |         fread(enc, sizeof(char), BLOCK_SIZE, src);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:33: cdecrypt.o] Fehler 1

Next i removed '-Werror' option from the CFLAGS line in "Makefile". Now it compiled fine but when i use it i get an error after a while:
Code:
.
.
.
ERROR: Could not open: '/home/rudi/Arbeit/RetroBat/roms/wiiu/Yoshi/0000000A'

Is this because Linux is case sensitive ? ("/home/rudi/Arbeit/RetroBat/roms/wiiu/Yoshi/0000000a.app" exists, but not "0000000A.app")


EDIT 1:
Because i had a lot of games to convert i switched over to Windows (to avoid the probs described above) and made a small script to batch process all Games in my WiiU-games-folder.

If anyone likes to use iit....
Download "Batch_cdecrypt.txt", place it beside "cdecrypt.exe" and rename it to "Batch_cdecrypt.bat".
Now drag and drop the folder which holds your encrypted games/updates/dlcs into "Batch_cdecrypt.bat" to start the batch decryption.
You'll find decrypted games in same folder where "cdecrypt.exe" is.

EDIT 2:
Fixed a small bug in "Batch_cdecrypt.bat"... so pls re-download it
 

Attachments

Last edited by Rudi Rastelli,
  • Like
Reactions: andreiarturo
For some reason, cdecrypt cant unpack 99seconds (titleid=0005000010182700). Not a bad internet dump, but from funkiiu.
That title can be correctly extracted with the wiiu-things scripts.
 
I compiled on Linux, no problems with that but when trying to use the command 'cdecrypt' it says that it isn't a command.
Edit: I got it working, I had to include the "./" before cdecrypt
 
Last edited by EliteMario97,
I compiled on Linux, no problems with that but when trying to use the command 'cdecrypt' it says that it isn't a command.
Edit: I got it working, I had to include the "./" before cdecrypt
In Linux environments ./ is used to execute a file in the current directory. Using ../ will execute a file in the parent directory. Without using ./ or ../ or giving a full or relative path, it is assumed that the file can be found in $PATH.
 
Hey guys.
I "googled" a lot, but I can't find anything regarding to my needs.
How can i use a parameter to decrypt to another target folder?

Code:
cdecrypt "path to game\title.tik" "path to game\title.tmd"
works fine but extracts the files within the source folder.

On GitHub it says
Code:
cdecrypt <NUS file or directory> [<target directory or existing file>]

But if I use something like
Code:
cdecrypt "path to game\title.tik" "path to game\title.tmd" "C:\temp"
Code:
cdecrypt "path to game\" "C:\temp"
Code:
cdecrypt "path to game\title.tik" "C:\temp"
Code:
cdecrypt "path to game\title.tik" [C:\temp]
or similar, it does nothing.

I think i missed something, but I don't get what
[btw.: I'm on Win10]
 
Last edited by Rashka,
Not sure if anyone will want it, but made a logo for this (mainly for myself, since I like having apps with icons).

Included are also the files I used, grabbed them off the web or created them, and combined in GIMP.
 

Attachments

  • cdecrypt.png
    cdecrypt.png
    161.9 KB · Views: 202
  • resources.zip
    resources.zip
    343.4 KB · Views: 91
Hi... I've tried to compile it on LInux Mint and here's the output of "make":
Code:
[C] cdecrypt.c
cdecrypt.c: In function ‘extract_file_hash’:
cdecrypt.c:241:9: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
  241 |         fread(enc, sizeof(char), BLOCK_SIZE, src);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cdecrypt.c: In function ‘extract_file’:
cdecrypt.c:327:9: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
  327 |         fread(enc, sizeof(char), BLOCK_SIZE, src);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:33: cdecrypt.o] Fehler 1

Next i removed '-Werror' option from the CFLAGS line in "Makefile". Now it compiled fine but when i use it i get an error after a while:
Code:
.
.
.
ERROR: Could not open: '/home/rudi/Arbeit/RetroBat/roms/wiiu/Yoshi/0000000A'

Is this because Linux is case sensitive ? ("/home/rudi/Arbeit/RetroBat/roms/wiiu/Yoshi/0000000a.app" exists, but not "0000000A.app")


EDIT 1:
Because i had a lot of games to convert i switched over to Windows (to avoid the probs described above) and made a small script to batch process all Games in my WiiU-games-folder.

If anyone likes to use iit....
Download "Batch_cdecrypt.txt", place it beside "cdecrypt.exe" and rename it to "Batch_cdecrypt.bat".
Now drag and drop the folder which holds your encrypted games/updates/dlcs into "Batch_cdecrypt.bat" to start the batch decryption.
You'll find decrypted games in same folder where "cdecrypt.exe" is.

EDIT 2:
Fixed a small bug in "Batch_cdecrypt.bat"... so pls re-download it
Currently I have the same problem "ERROR: Could not open: '/home/rudi/Arbeit/RetroBat/roms/wiiu/Yoshi/0000000A", I have been very specific about my spelling and even check the permissions on all of the folders in the path and it still gives me the same error.

Any thoughts?
 
Hi... I've tried to compile it on LInux Mint and here's the output of "make":
Code:
[C] cdecrypt.c
cdecrypt.c: In function ‘extract_file_hash’:
cdecrypt.c:241:9: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
  241 |         fread(enc, sizeof(char), BLOCK_SIZE, src);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cdecrypt.c: In function ‘extract_file’:
cdecrypt.c:327:9: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
  327 |         fread(enc, sizeof(char), BLOCK_SIZE, src);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:33: cdecrypt.o] Fehler 1

Next i removed '-Werror' option from the CFLAGS line in "Makefile". Now it compiled fine but when i use it i get an error after a while:
Code:
.
.
.
ERROR: Could not open: '/home/rudi/Arbeit/RetroBat/roms/wiiu/Yoshi/0000000A'

Is this because Linux is case sensitive ? ("/home/rudi/Arbeit/RetroBat/roms/wiiu/Yoshi/0000000a.app" exists, but not "0000000A.app")


EDIT 1:
Because i had a lot of games to convert i switched over to Windows (to avoid the probs described above) and made a small script to batch process all Games in my WiiU-games-folder.

If anyone likes to use iit....
Download "Batch_cdecrypt.txt", place it beside "cdecrypt.exe" and rename it to "Batch_cdecrypt.bat".
Now drag and drop the folder which holds your encrypted games/updates/dlcs into "Batch_cdecrypt.bat" to start the batch decryption.
You'll find decrypted games in same folder where "cdecrypt.exe" is.

EDIT 2:
Fixed a small bug in "Batch_cdecrypt.bat"... so pls re-download it
I'm currently experiencing the same error ERROR: Can't open '/Downloads/FunKiiU-master/install/00050000101c9400, the spelling is correct. I have checked file permissions and it does not appear to be that. Can anybody give me any suggestions?
 
Can you please post a tutorial for CDecrypt for desktop mode use in Steam Deck? How do you assign destination directories? Is there a GUI now?
 

Site & Scene News

Popular threads in this forum