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
28
XP
97
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
39
Location
Canada
XP
28
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
39
XP
25
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
26
XP
17
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
68
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
46
XP
21
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 :(
 

IverCoder

New Member
Newbie
Joined
May 31, 2023
Messages
1
Trophies
0
Age
34
Location
somewhere in southern philippines
XP
12
Country
Philippines
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.
To anyone having problems with this method, make the filename of your ROMs as short as possible and make sure it doesn't contain any special characters (spaces are fine though). For example, if you have Pokémon X, name it PokemonXBase and/or PokemonXv5. Of course, this is just an example, feel free to use any filename that meets the conditions I stated earlier.

If you are on a laptop, you can speed up the process by disabling Battery saver and plugging in the charger, since decryption is pretty resource-intensive.
 

lawrenciums

New Member
Newbie
Joined
Jun 24, 2023
Messages
1
Trophies
0
Age
19
XP
12
Country
United States
I keep doing this over and over again with a Pokemon X file and it is not working. I got rid of any special characters within the name. I decrypted the CIA file with the decrypt.exe. I have multiple NCCH files and a CCI file and even decrypted those as well to see if those were messing with it for some reason. No matter what I do, Citra will not run it and leaves me on a black screen. Log file says "Failed to open C:\Users\my name\AppData\Roaming/Citra/sdmc/Nintendo 3DS/00000000000000000000000000000000/00000000000000000000000000000000/title/0004000e/000ec500/content/00000000.app". I just literally don't understand what I'm doing wrong. Should I try a different ROM? It's driving me crazy.

Update: tried with a different rom, worked. So it was just that one rom it seems. How strange.
 
Last edited by lawrenciums,

natethepie

New Member
Newbie
Joined
Jul 11, 2023
Messages
1
Trophies
0
Age
23
XP
13
Country
United States
i'm also getting the issue where when i try and decryt my rom it goes to stright to "finished. press any key to exit". without giving anything back just leaving me the same file with zero changes.

is there maybe any other program i can use that does the samething
 

JTcasual

New Member
Newbie
Joined
Aug 6, 2023
Messages
1
Trophies
0
Age
22
XP
13
Country
United States
I want to decrypt my CIA file for the Shin Megami Tensei 4 DLC on 3DS, but I can't get Batch CIA 3DS Decryptor to open. followed all the steps on how to decrypt CIA files on this, but when I go to double click on the decryptor, I get an application error, telling me I have to close it out.
 

JumpMan96

New Member
Newbie
Joined
Sep 3, 2023
Messages
1
Trophies
0
Age
23
XP
4
Country
Australia
I'm trying to use the batch file but it always comes up with an error saying "Windows cannot find [insert file names here]. Make sure you typed the name correctly, and then try again."

Can anyone help?
 

RubyAmaranthus

New Member
Newbie
Joined
Sep 27, 2023
Messages
1
Trophies
0
Age
75
XP
3
Country
Bahrain
I tried and got this error

Parsing NCSD in file "A.3ds":
Parsing Main NCCH
Product code: CTR-N-BG2E
KeyY: BABBDECB93FF50504D27EF1723772CA3
Title ID: 0004000000131E00
Format version: 2
Uses Extra NCCH crypto, keyslot 0x25
********************************
Couldn't find seed in seeddb, checking online...
********************************
Traceback (most recent call last):
File "decrypt.py", line 421, in <module>
File "decrypt.py", line 263, in parseNCSD
File "decrypt.py", line 307, in parseNCCH
File "decrypt.py", line 201, in getNewkeyY
__main__.SeedError: Something Happened :/
Failed to execute script decrypt
[SETTING ERROR] Argument "-rsf" is required

For attack on titan Chains of Humanity
 

SylverReZ

The planet is fine. The people are crazy.
Member
GBAtemp Patron
Joined
Sep 13, 2022
Messages
7,234
Trophies
3
Location
The Wired
Website
m4x1mumrez87.neocities.org
XP
22,188
Country
United Kingdom
I tried and got this error

Parsing NCSD in file "A.3ds":
Parsing Main NCCH
Product code: CTR-N-BG2E
KeyY: BABBDECB93FF50504D27EF1723772CA3
Title ID: 0004000000131E00
Format version: 2
Uses Extra NCCH crypto, keyslot 0x25
********************************
Couldn't find seed in seeddb, checking online...
********************************
Traceback (most recent call last):
File "decrypt.py", line 421, in <module>
File "decrypt.py", line 263, in parseNCSD
File "decrypt.py", line 307, in parseNCCH
File "decrypt.py", line 201, in getNewkeyY
__main__.SeedError: Something Happened :/
Failed to execute script decrypt
[SETTING ERROR] Argument "-rsf" is required

For attack on titan Chains of Humanity
Its easier to do it in GodMode9 or Decrypt9WIP, these older programs are pretty unstable when it comes to newer titles such as SDK7+.
 

PoissonConstant

New Member
Newbie
Joined
Oct 6, 2023
Messages
1
Trophies
0
Age
21
XP
12
Country
Chile
Using my cia file with the batch gets me another cia file named "X (Patch)-decrypted.cia", checking the log it says this:

Parsing CIA in file "X.cia":
Parsing NCCH 0
Product code: CTR-U-A2BA
KeyY: 3DEEEB6AA0BCBCA5EA64E21F90B10058
Title ID: 0004000E001B5100
Format version: 2
Uses Extra NCCH crypto, keyslot 0x25
Not Encrypted

ExHeader offset: 00000200
ExHeader counter: 0004000e001b51000100000000000000
ExHeader size: 2048 bytes
ExeFS offset: 00002E00
ExeFS counter: 0004000e001b51000200000000000000
ExeFS size: 5937664 bytes
RomFS offset: 005AD000
RomFS counter: 0004000e001b51000300000000000000
RomFS size: 64163840 bytes


Done!
[TIK WARNING] Failed to sign header
[TMD WARNING] Failed to sign header

Has somebody solved this?
 

Steve0000

New Member
Newbie
Joined
Oct 21, 2023
Messages
1
Trophies
0
Age
33
XP
2
Country
United States
How do I decrypt Pokemon Y that I bought from The Nintendo e-shop. When I have the files from the sd card the majority of the GB is to a file called 00000002.app. I tried to use the decryptor with this and other files but nothing happens.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: Manual charging