Homebrew Batch CIA 3DS Decryptor - A simple batch file to decrypt CIA & 3DS

kevman323

Well-Known Member
Newcomer
Joined
Oct 10, 2015
Messages
46
Trophies
0
Age
27
XP
86
Country
United States
After messing with this, I found two things that will mess up this tool. If it won't decrypt a file for you, make sure it's not one of these things.

1. Strange characters will mess it up. I saw this elsewhere where somebody talked about the ! character messing things up, but any strange character, like Japanese text, etc. will cause issue. Examples I had were ! in multiple games, é in a pokemon game name, and the roman numerals Ⅳ used instead of IV in street Fighter for some reason.

2. The second issue is less clear, but it affects mostly DLC, and anything with a lot of NCCH files. Internally, in the batch script, it takes all NCCH files, and combines them into a variable for creating the cia. If there are too many files, the batch variable hits a hidden 8191 character limit, and the command fails because it is cut off.

Fixing this is out of my league, but as a workaround, rename the file temporarily to a one character name. If a file still has too many NCCH files, this may not work, but for me, this fixed conversion issues for all 4 of the files I had issues with by renaming them to "a.cia" temporarily.

Lastly, I still have one cia that is giving me issues, but it seems to be an issue with "decrypt.exe", and likely can't be fixed easily. Still, I hope this helps some of those with issues.
 
  • Like
Reactions: tgm0

Gee7220

New Member
Newbie
Joined
Aug 17, 2022
Messages
1
Trophies
0
Age
38
Location
Canada
XP
18
Country
Canada
Hi, hoping someone can help me, I didn't find the solution in the comments... when I run the .bat file it doesn't decrypt the .3ds file I have in the folder. here is a copy of the log;

Parsing NCSD in file "Fire Emblem - Awakening (USA).3ds":
Parsing Main NCCH
Product code: CTR-P-AFEE
KeyY: 3B84AC414BC38A70533FC8BABD3E00BD
Title ID: 00040000000A0500
Format version: 2

ExHeader offset: 00000200
ExHeader counter: 00040000000a05000100000000000000
ExHeader size: 2048 bytes
ExeFS offset: 00000C00
ExeFS counter: 00040000000a05000200000000000000
ExeFS size: 2913792 bytes
RomFS offset: 002C9000
RomFS counter: 00040000000a05000300000000000000
RomFS size: 1119567872 bytes

Parsing Manual NCCH
Traceback (most recent call last):
File "decrypt.py", line 421, in <module>
File "decrypt.py", line 263, in parseNCSD
File "decrypt.py", line 278, in parseNCCH
File "decrypt.py", line 74, in __new__
ValueError: Buffer size too small (0 instead of at least 512 bytes)
Failed to execute script decrypt
[MAKEROM ERROR] Content 0 is corrupt
 

hussammfj

New Member
Newbie
Joined
Nov 13, 2022
Messages
1
Trophies
0
Age
38
XP
15
Country
Argentina
To anyone getting the 'running the batch goes directly to finish with no new file generated' - try dragging the CIA file to decrypt.exe (just clicking decrypt.exe does not work, you have to give it a file to chew on) and it should run through and generate a bunch on NCCH files. Then double click on the .bat and it will run through and generate a decrypted CIA/CCI.
Make sure everything is in the same folder.

i just signed up to the forums to say THANK YOU ARE, YOU ARE FUCKING AMAZING !!!...
 

GLTTRPRNCS

New Member
Newbie
Joined
Mar 16, 2023
Messages
1
Trophies
0
Age
25
XP
7
Country
United States
To anyone getting the 'running the batch goes directly to finish with no new file generated' - try dragging the CIA file to decrypt.exe (just clicking decrypt.exe does not work, you have to give it a file to chew on) and it should run through and generate a bunch on NCCH files. Then double click on the .bat and it will run through and generate a decrypted CIA/CCI.
Make sure everything is in the same folder.
Followed these steps, but the final CIA file it generated was still encrypted according to Citra. When i ran the batch file it did delete the NCCH files, but it still jumped straight to finish.
 
Last edited by GLTTRPRNCS,

UnfortunateLoaf

Member
Newcomer
Joined
May 1, 2019
Messages
15
Trophies
0
Location
Castle of Auuughh
XP
58
Country
Mexico
Hi, I'm trying to decrypt a .3ds rom in order to turn it into a CIA from GodMode9, as if I tried directly gm9 gave a "Operation Falied" message, so then I decide to use this script and even after following @masterofphysics advice, I get no new file at all, I'm not sure if it's because the .3ds is from JPN region or some other locale problem. Any help would be greaatly appreciated, thanks.
 
Last edited by UnfortunateLoaf,

Kanay

New Member
Newbie
Joined
Mar 25, 2023
Messages
1
Trophies
0
Age
45
XP
3
Country
Poland
To anyone getting the 'running the batch goes directly to finish with no new file generated' - try dragging the CIA file to decrypt.exe (just clicking decrypt.exe does not work, you have to give it a file to chew on) and it should run through and generate a bunch on NCCH files. Then double click on the .bat and it will run through and generate a decrypted CIA/CCI.
Make sure everything is in the same folder.
Hello and excuse me, but it just deletes NCCH files and doesn't give anything back :(
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • SylverReZ @ SylverReZ:
    Hope they made lots of spaget
  • K3N1 @ K3N1:
    Chill dog
  • SylverReZ @ SylverReZ:
    Chilli dog
  • Skelletonike @ Skelletonike:
    Damn, I'm loving the new zelda.
  • xtremegamer @ xtremegamer:
    loving the new zelda, i started a game, it was so fucking good, so i
    am waiting on my friend to get home so we can start a new one together
  • Skelletonike @ Skelletonike:
    I just dislike that they don't let me choose the voices before the game starts. Happened with botw as well, had to change to japanese and restart.
  • K3N1 @ K3N1:
    But the important question is can you choose gender
  • Skelletonike @ Skelletonike:
    Same way you can choose Gerald's gender.
  • Skelletonike @ Skelletonike:
    *Geralt, damn autocorrect.
  • Psionic Roshambo @ Psionic Roshambo:
    But can he be trans? Lol
  • K3N1 @ K3N1:
    Zelda transforms into link
  • Psionic Roshambo @ Psionic Roshambo:
    Link I'm not the princess your looking for.... *Pulls a crying game*
  • K3N1 @ K3N1:
    *skirt up* it's exactly what I always wanted
  • Skelletonike @ Skelletonike:
    Just scanned all my zelda amiibos, took a while but didn't get anything that cool, did get the lon lon ranch hylian fabrics though.
  • Skelletonike @ Skelletonike:
    It was pretty funny when I scanned wolf link and got a shit load of meat.
  • K3N1 @ K3N1:
    @Skelletonike, btw I ran that custom for mgs4 on the deck I'm amazed it got that far in game
  • K3N1 @ K3N1:
    Plug in*
  • K3N1 @ K3N1:
    Your favorite activity
  • BentlyMods @ BentlyMods:
    My fav actvity is:

    mario-dancing.gif
  • Psionic Roshambo @ Psionic Roshambo:
    Do the Mario lol
  • K3N1 @ K3N1:
    🍑
  • K3N1 @ K3N1:
    Whoever developed Bramble was smoking that good shit fucking gnomes
    K3N1 @ K3N1: Whoever developed Bramble was smoking that good shit fucking gnomes