Homebrew Request for an old 3ds tool

acrash

Active Member
OP
Newcomer
Joined
Mar 18, 2020
Messages
32
Trophies
0
Age
44
XP
585
Country
United States
Hi

b2071988 (from romshepherd.com) made a tool for decrypting and re-encrypting .3ds roms.
romshepherd is down. So I can't get the tool from b2071988.
does anyone here have the latest version of the tool (I think v4 or later judging from this).
I think it's just called "3ds_decrypt_encrypt". It seems to be the only windows based tool that can both decrypt and re-encrypt .3ds roms. and it seems to be the tool used by No-Intro (or at least it gives the same MD5 hashes)

Tools like Batch CIA 3DS Decryptor have problems, which i commented on in the last post here

I found (v3) of the tool: https://anonfiles.com/5fJdzarco9/3ds_decrypt_encrypt_v3_rar
but apparently there were some improvements added to a newer version, making (v3) outdated.
I looked on archive.org and this is what I found: https://archive.org/details/3dsEncryptV4
but it seems missing a lot of files. and there is no .bat files to use the program like in (v3). Also, I don't know if this is the last version.

Also, the tool from "b2071988" doesn't deal with .cia for update/DLC (because it only supports .3ds/.cci)
So, if there is such a tool/tools that would both decrypt and re-encrypt .cia giving me correct MD5 hashes, please send them my way.

Also, (last thing I swear)
If you happen to have windows tools that can convert between .cia & .3ds back and forth without trimming, sending them my direction would be appreciated (the tools I found always trim the files).
I think Makerom can do it but for some reason the "-ciatocci" and "-ccitocia" commands don't work. When "-ciatocci" works, it gives me a different hash every time. Can someone give me a script for a .bat file that would work.
so that if we convert: .3ds (MD5=X) ------>.cia ------> .3ds (MD5=Y)
.3ds (MD5=X) ------>.cia ------> .3ds -------> paded .3ds (MD5=Y)
we always have X=Y
or something like
 
Last edited by acrash,

botik

Well-Known Member
Member
Joined
Sep 22, 2017
Messages
138
Trophies
0
XP
2,193
Country
Russia
It is not possible to a <.3ds> file from <.cia> if you have not previously saved the 16 Kb <.3ds> header (ncsdheader.bin). Through the program, it is generated randomly with a different hash and will not work.Only original <.3ds> header will work.
 

acrash

Active Member
OP
Newcomer
Joined
Mar 18, 2020
Messages
32
Trophies
0
Age
44
XP
585
Country
United States
It is not possible to a <.3ds> file from <.cia> if you have not previously saved the 16 Kb <.3ds> header (ncsdheader.bin). Through the program, it is generated randomly with a different hash and will not work.Only original <.3ds> header will work.

So is there a way for me to unpack the files and repack them correctly. Something like:

1- Unpack original .3ds and save the data (or just the header ncsdheader.bin file)
2- Convert the original .3ds file to .cia with a tool like 3dsconv
When you want to get the the original .3ds file back
3- Unpack the .cia file and return ncsdheader.bin to its place (or some place)
4- Repack those files as a new .3ds (and maybe add padding with something like 3dstool)

Would that work to give a hash match between the original .3ds & new .3ds

If so, could you please direct me to the Unpacking and Repacking tools for this to work

{does that mean that what we (or just I) need is something similar to Nkit recover function?}

Me=noob
 
Last edited by acrash,

botik

Well-Known Member
Member
Joined
Sep 22, 2017
Messages
138
Trophies
0
XP
2,193
Country
Russia
I used to do it like this on the command line

###################.3ds-->.cxi_encrypt--->.cxi_decrypt--->.cia#############

.3ds-->.cxi_encrypt
3dstool -xvtf cci game.3ds --header ncsdheader.bin -0 game_encrypt.cxi

.cxi_encrypt--->.cxi_decrypt
3dstool -xvtf cxi game_encrypt.cxi --header ncchheader.bin --exh exheader.bin --exefs exefs.bin --romfs romfs.bin --logo logo.bcma.lz --plain plain.bin
3dstool -cvtf cxi game_decrypt.cxi --not-encrypt --header ncchheader.bin --exh exheader.bin --plain plain.bin --exefs exefs.bin --logo logo.bcma.lz --romfs romfs.bin

.cxi_decrypt--->.cia
makerom -f cia -o game.cia -content game.cxi:0:0


#############.cia--->.cxi_decrypt---->.cxi_encrypt---->.3ds############


.cia--->.cxi_decrypt
ctrtool --contents=file -p game.cia
rename file.0000.* game_decrypt.cxi

.cxi_decrypt---->.cxi_encrypt
3dstool -xvtf cxi game_decrypt.cxi --header ncchheader.bin --exh exheader.bin --exefs exefs.bin --romfs romfs.bin --logo logo.bcma.lz --plain plain.bin
3dstool -cvtf cxi game_encrypt.cxi --header ncchheader.bin --exh exheader.bin --plain plain.bin --exefs exefs.bin --logo logo.bcma.lz --romfs romfs.bin

.cxi_encrypt---->.3ds
3dstool -cvt01267f cci game_encrypt.cxi game.3ds --header ncsdheader.bin
 
Last edited by botik,

lone_wolf323

Well-Known Member
Member
Joined
May 27, 2011
Messages
5,480
Trophies
2
XP
4,918
Country
Canada
So is there a way for me to unpack the files and repack them correctly. Something like:

1- Unpack original .3ds and save the data (or just the header ncsdheader.bin file)
2- Convert the original .3ds file to .cia with a tool like 3dsconv
When you want to get the the original .3ds file back
3- Unpack the .cia file and return ncsdheader.bin to its place (or some place)
4- Repack those files as a new .3ds (and maybe add padding with something like 3dstool)

Would that work to give a hash match between the original .3ds & new .3ds

If so, could you please direct me to the Unpacking and Repacking tools for this to work

{does that mean that what we (or just I) need is something similar to Nkit recover function?}

Me=noob
The question of all this. Is, why exactly would you want to get a .3ds file back when its something almost useless.
 

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,823
Country
United States
Converting from CIA back to ".3ds" will not give you back the original file because CIA doesn't include certain data from the header only relevant to retail cards. If your reason is to use it in emulators like Citra, you can run the CXI directly. If it's for flashcarts, well good luck since 3DS flashcarts have fallen out of popularity in the past few years.
 
Last edited by ihaveahax,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    RedColoredStars @ RedColoredStars: Ready to just leave tis place anyway. The amount of shit talking and bullying behavior that goes...