Author Topic: Nintendo 3DS Decrypted Numbered DAT (Untrimmed + Trimmed Roms)  (Read 7263 times)

0 Members and 1 Guest are viewing this topic.

Offline b2071988

  • Full Member
  • ***
  • Posts: 109
Attached is a DAT file for
- 'Decrypted Trimmed 3DS Roms'. Set Size: 1.04 TB (1,154,724,905,472 bytes) Uncompressed as at DAT v1704.
- 'Decrypted Untrimmed 3DS Roms'. Set Size: 1.39 TB (1,538,403,598,336 bytes) Uncompressed as at DAT: v1700.

DAT Updated to v1704: Added 1637 + 1638

Based off the 'No-Intro' - Nintendo - Nintendo 3DS Numbered Set - Latest DAT Update: #1638   + x051   + z011   (2017-01-18 14:21:55)
The DAT also includes the New3DS games as n001, n002, n003 and n004 (These are included as a separate set in No-Intro)

All these 3DS Roms have been decrypted with a homebrew enabled 3DS using Decrypt9WIP and the RomFS+ExeFS data for each partition verified with CTRTOOL.

You can't play decrypted roms with a flashcard (like Gateway or Sky3DS+) on a 3DS console, you need encrypted roms for those flashcarts.
Decrypted roms can be used for playing/testing on 'Citra' 3DS emulator or converting to CIA files to install to your 3DS with 'Simple CIA converter'

Note: There is currently a small bug in Decrypt9WIP where if the game uses crypto-type 0x01 or 0x0A (7.x NCCH or New3DS encryption) some
encrypted data will be left after some/all of the files in the 'ExeFS' partition, use the "" script to clear/zero out this junk data.
If you have decrypted a game using Decrypt9WIP and it doesn't match the DAT file, try running this python script on the rom.
edit: See a few posts below this one for a 'fixed' version of Decrypt9WIP that should decrypt the 3ds roms correctly.


Below is a folder link which contains a python script ( that can be used to decrypt some specific 3ds roms on your PC
with the help of some additional data. You'll need Python 2.7 installed and also the PyCrypto library as I use that to do the AES decryption.

First, Download the "" python 2.7 script and place it in a folder, in the folder with the script make two folders named 'UPDATE' and 'DATA'.
Download the '3DS_UPDATES' 7z archive (~460mb) and extract the contents to the 'UPDATE' folder, (you should have ~100 files with the .rp6 and .rp7 file extensions)
Download the 'Additional Data' for the 3ds rom you want to decrypt and extract the contents into the 'DATA' folder (you should have fp0, hp0, rp1, smdh, cbmd files)
(Note: I recommend to decrypt each 3ds rom one by one. Some games like 'Pokemon Sun+Moon' have the same filename due to having the same superblock hash.)

Once done, run the python script with the filename of the 3DS rom as the first option (see as below) and wait for the Rom to be Decrypted, may take a while for big roms.
Only registered users can see contents. Please click here to Register or Login.
The Python 2.7 Script, Update Data and Extra Data files can be downloaded from here:
Only registered users can see contents. Please click here to Register or Login.
« Last Edit: January 19, 2017 - 13:41:04 by b2071988 »

Offline player594

  • Newbie
  • *
  • Posts: 9
How do I go about downloading the roms

Sent from my Nexus 7 using Tapatalk

Offline b2071988

  • Full Member
  • ***
  • Posts: 109
This is just a DAT file that contains the filesizes and checksums of the decrypted roms, based off clean roms from the no-intro set.

I don't have the 3DS Roms available for download, but if you own a 3DS that can run the 'Decrypt9WIP' homebrew (I run mine from Arm9LoaderHax) you can
put the encrypted .3ds rom file in the 'D9Game' folder on your 3DS SD card, run Decrypt9WIP and select 'Content Decryptor -> NCCH/NCSD Decryptor' option.
After the decryption is done, the decrypted rom will be the same rom file you placed in the 'D9Game' folder (as the rom is decrypted in place)

Maybe a request topic for '3DS Decrypted Roms' can be made, but I'm not sure what section to place it in...

edit: also I would love a verification of the hashes. If you decrypt a 'no-intro' 3ds rom (with Decrypt9WIP) post the name/number here if your rom doesn't match the DAT.
(Note: The 4 Gigabyte games will need to be trimmed (or have last 512 bytes removed and re-added after decryption) as the 3DS SD card is FAT32 and doesn't support 4gb files.)

« Last Edit: January 10, 2017 - 05:28:20 by b2071988 »

Offline rsolv825

  • Newbie
  • *
  • Posts: 30
Thanks for all this hard work.

I don't know much about 3DS decryption/encryption, and whether it is worth archiving decrypted vs. encrypted (I assume Citra will eventually support encrypted roms?), but assuming decryption is still a universal ROM (i.e. not device specific) I agree it would be great if on No-Intro we had (Decrypted) and (Encrypted) dats for 3DS like we do for DS to at least have a choice. They should be interested/willing in doing this if someone knows how to properly submit this work.

Also, I assume there is no way to decrypt with a PC program currently? Eventually it would be best if there were a way to decrypt all on PC, or at least a program that can do decryption if you feed it keys generated on a 3DS that only have to be generated once and then passed around.
« Last Edit: July 28, 2016 - 20:52:38 by rsolv825 »

Offline b2071988

  • Full Member
  • ***
  • Posts: 109
It is possible to partially decrypt a 7.x crypto-method game (type 0x01 / Key 0x25) and the new 3ds exclusive (type 0x0A / Key 0x18) games.
You can't decrypt standard crypto (type 0x00 / Key 0x2C) games yet as we need a bootrom dump to get the decryption keys (as it is impossible to brute-force)
When key 0x2C is leaked / dumped, then Citra may possibly support encrypted games (may have to supply it the keys in a file) although you could just decrypt them on your PC.
(It possible that  no-intro hasn't added decrypted rom data as they are waiting for a PC tool that can decrypt and encrypt the roms so they can verify the hashes as not everyone can decrypt roms)

You can find the crypto-type of an encrypted 3DS game at 0x418B (also at 0x118B), when a rom is decrypted, 0x418B will be 0x00 and 0x418F will be 0x04 (bit3 set)
The original crypto-type of a Decrypted Rom can be found at 0x118B (which seems to be a backup header that is untouched when the game is decrypted)

I saw on another forum that there is a bug with Decrypt9WIP where it leaves a bit of encrypted data after the end of the ExeFS files (only on 01+0A crypto) because it doesn't round up to the next sector size.
(So looks like i'll have to re-do all the 7.x and New3DS games again if it gets fixed and a new version is released (seems easily fixable by a PC app, but will re-decrypt a few to check)
(I probably should of done this when its known that the roms are decrypted properly, as bugs like the above one can affect the hashes of a lot (if not all) of the decrypted roms)

A 3DS rom is made up of multiple sections, for a 7.x game / New3DS Exclusive game, these are the parts you can decrypt on a PC:

Partition 0 - Game Data - ExHeader - Unable to Decrypt, seems to be a list the 'services' the game accesses/uses? (size: always 2048 bytes - always uses Key: 0x2C)
Partition 0 - Game Data - ExeFS - Partially decryptable:
- ExeFS Filename Table (512 bytes) - Always uses Key 0x2C for backward compatibility with old firmware.
- Game Banner (size varies, approx 1mb) - Always uses Key 0x2C for backward compatibility with old firmware.
- Game Icon (always 13.6kb) - Uses Key 0x2C for backward compatibility with old firmware.
- Game .code and other exeFS files use Key 0x25 or 0x18 (depending on the crypto-type)
Partition 0 - Game Data - RomFS - Fully Decryptable (Contains the game data - usually the majority of the used rom space)
Partition 1 - Game Manual (size is usually 1mb to 5mb) - RomFS - Unable to Decrypt, always uses Key 0x2C.
Partition 2 - Download-Play Data (size varies on game, not all games have it) - RomFS - Unable to Decrypt, always uses Key 0x2C.
Partition 6 - New3DS Updater (size ranges from 4mb to 32mb) - RomFS - Unable to Decrypt, always uses Key 0x2C.
Partition 7 - Old3DS Updater (size ranges from 4mb to 32mb) - RomFS - Unable to Decrypt, always uses Key 0x2C.

The decrypted updaters for Old3DS and New3DS seem to be shared between multiple games.
with two different games that both update to 9.2.0E the updaters are exactly the same.

You could extract these sections from a decrypted rom (only a few mb) and inject them into the encrypted rom to make those sections decrypted.,
then decrypt the other sections like partition 0 RomFS (which is where most of the data in a game is) with the known keys to get a fully decrypted rom.
(or you can use a 3DS to generate XORPADs for these sections then XOR the encrypted data with the XORPAD, a benefit of this is you can re-encrypt the roms too)

edit: If you want to try and brute-force key 0x2C (who knows, you could get lucky), here is the first 16 bytes of 3DS rom #0004 Partition 0 RomFS.
Decrypt using AES-128-CTR (Counter mode). A GPU brute-forcer using Cuda or OpenCL would be nice but I don't know any coding languages)
Only registered users can see contents. Please click here to Register or Login.
Once you have the KeyX of Key 0x2C, here is some test data you can use to verify if you have the correct key.:
Only registered users can see contents. Please click here to Register or Login.
Note: ROL is a Rotate Left (Value, Number of Bits to Rotate, Size of the value in Bits [128]) and ^ is a bit-wise XOR.
« Last Edit: January 05, 2017 - 16:45:24 by b2071988 »

Offline s4nQy29A

  • Hero Member
  • *****
  • Posts: 1054
Re: Nintendo 3DS Decrypted (Numbered) DATs (For Citra / CIA convertion)
« Reply #5 on: January 06, 2017 - 15:34:30 »

Many thanks for your work!!

1. Do you still have your encrypted and decrypted ROMs? Would it be possible for you to create patches from the encrypted to the decrypted versions? Are those patches always just some KB in size or was that Pokemon patch you provided an exception?

2. When you speak of "trimmed", is that a reversible "format"? I mean is it always possible converting from untrimmed to trimmed and vice versa without losing data?
- PW = "romshepherd"
- I recommend a DL manager like "jDownloader"
- Archive with "*.part"? ALL parts needed!
- Please provide a fixdatfile (hash values) for missing files!
- Missing any No-Intro ROMs? Look [You are not allowed to view links] Register or Login and click on "Thanks"! :p

Offline player594

  • Newbie
  • *
  • Posts: 9
Re: Nintendo 3DS Decrypted (Numbered) DATs (For Citra / CIA convertion)
« Reply #6 on: January 06, 2017 - 15:57:06 »
So how do you decrypt on the PC? Didnt think that was possible.

Sent from my SM-G900V using Tapatalk

Offline b2071988

  • Full Member
  • ***
  • Posts: 109
Re: Nintendo 3DS Decrypted (Numbered) DATs (For Citra / CIA convertion)
« Reply #7 on: January 06, 2017 - 17:06:33 »
1. Yes, I still have the trimmed decrypted set (uncompressed), making a patch from 'encrypted to decrypted' would be the same size as the rom itself.
If we had the decryption keys we could decrypt the rom using a computer. (two of the three keys rom decryption have been found)
The Pokemon Sun Rom used the exact same RomFS between region (which is the majority of the rom) same with Pokemon Moon.
The only thing that changes is the update partitions, game manual and the rom header, which are all fairly small (~50mb total)

2. Untrimmed roms are padded with FF's to make the size match the 'rom chip size'
(for 3DS the 'rom chip sizes' are 128mb, 256mb, 512mb, 1gb, 2gb or 4gb)
Trimming just removes this extra un-needed 'padding' data, it can easily be restored.
I have a program called Rom_tool which shows "CTR_Toolkit - CCI Tool Version 3.1 (C) 3DSGuy 2013" when I run it.
I use that to trim and untrim roms, I'm unsure of where I got it from. The command line usage is fairly simple:
Batch file to trim all 3ds roms:
Only registered users can see contents. Please click here to Register or Login.Batch file to untrim all 3ds roms:
Only registered users can see contents. Please click here to Register or Login.
I don't really see a point in keeping the padding in decrypted roms, but if you really want it you can easily restore it.

You can partially decrypt roms that use the '7.x NCCH' (and New3DS) encryption method, I explained it a few months ago in a few posts above this one.

There is a python script in that mega link that can decrypt some roms but it requires a few files from the decrypted rom
(which are the files that are encrypted with the key0x2C like the ExeFS header, update partition etc) these are injected to the correct
place in the rom and the parts that can be decrypted by a PC are decrypted and hopefully the output rom matches the decrypted one.
I did decrypt a few encrypted roms with the script and checked the output file and the hashes matched the decrypted rom so I assume everything is done correctly.
The Update partitions (~30mb each) are shared between some Roms, so I included them in a separate download.

To use the python script you'll need Python 2.7 installed and the 'PyCrypto' library as well as I use that to do the Decryption. Usage is in the first post.

If the bootrom dump or the KeyX for 'slot 0x2C' is released then we can fully decrypt a 3DS rom using a computer instead of a 3DS.
The 3DS has many many encryption keys, a lot are currently unknown, google for "3ds AES keys", you'll see a few that have been discovered.

3DS cartridges use one of three encryption keys.
Keyslot 0x2C = Original NCCH - for 6.x and Lower Firmware games.
Keyslot 0x25 = 7.x NCCH - for 7.x and Higher Firmware games.
Keyslot 0x18 = Only used on New3DS games.

The '7.x NCCH' roms started being released at around no-intro Number #1000 and up.

KeyX = Hard-coded key, either set by the 3DS boot-rom or one of the system/firmware files.
KeyY = Stored in the rom file (the first 16 bytes of the partition RSA-2048 SHA-256 signature)
These keys are combined by the 3DS Hardware Keyscrambler to make a 'NormalKey' which is used to decrypt the game.

« Last Edit: January 07, 2017 - 06:32:23 by b2071988 »

Offline b2071988

  • Full Member
  • ***
  • Posts: 109
Re: Nintendo 3DS Decrypted (Numbered) DATs (For Citra / CIA convertion)
« Reply #8 on: January 10, 2017 - 02:46:21 »
Created a DAT file for an untrimmed 3DS Decrypted set.

Modifcation to fix Decrypt9WIP '7.x + New3DS' ExeFS Decryption.
PS: I'm not a programmer, so the source modifcation may look bad, but it "works for me" :)

I've only tested Decrypting '.3ds' roms, This fix may break other features like CIA decryption etc.

The 'modified Source Code + compiled modified Source Code' is attached (see output folder for compiled 'Decrypt9WIP.bin' for use with A9LH)
I suggest only using this 'fixed version' to decrypt .3ds roms, use the original Decrypt9WIP if you need to use the other features like gamecart dumping etc.

Requires a 3DS Console with Arm9LoaderHax and Luma3DS Custom firmware installed.
Decrypt9WIP requires the "AESKeyDB.bin" file to decrypt some things, place it in the 'Files9' folder.
Copy the 'Decrypt9WIP.bin' file to your 'SD:\Luma\Payloads\' folder and rename it to "left_decrypt9WIP_fix.bin".

Place your encrypted 3ds roms in 'SD:\D9Game\' folder, start Decrypt9WIP by holding 'left' on the d-pad then turning on your 3DS.
Select 'Content Decryptor -> NCCH/NCSD file options... -> NCCH/NCSD Decryptor' and wait while roms are decrypted.

Tested on these Encrypted 3DS Roms:
1108 - Tetris Ultimate (USA) (En,Fr,Es,Pt).3ds
1115 - Safari Quest (Europe) (En,Fr,De,Es,It,Nl).3ds
1144 - Fujiko F. Fujio Characters Daishuugou! SF Dotabata Party!! (Japan).3ds

Explanation of the Problem:
Decrypt9WIP was leaving data after some of the ExeFS files if the game being decrypted was using
Encryption type (0x01 or 0x0A). This junk data was 00's encrypted using Key0x2C (Original NCCH key)

Originally Nintendo just encrypted the entire ExeFS partition with Key0x2C (Encryption Type 0x00)

When they introduced the 7.x Encryption Method with Key0x25 (Encryption Type 0x01) they needed to keep the 'Icon' and 'Banner'
readable on older Firmware, so if you were on firmware 5.x, you could insert the gamecard into your 3DS and be able to see the
game, but when you tried to start the game, the 3DS checked the minimum firmware required (e.g 7.x) and showed the update prompt.
This is the reason why the 'Icon' and 'Banner' ExeFS files are always encrypted with Key0x2C, these are the files loaded by the home menu.

This meant that people on older firmware would be forced to update to 7.x if they wanted to play newer games.
If you had an older firmware your 3DS wouldn't know the correct decryption key so the game wasn't able to be played.
When the 3DS updated, it would know to use new 7.x encryption key (loaded by the firmware) when the game was run.
Nintendo couldn't encrypt the entire ExeFS partition with the new Encryption Key0x25 as they needed backwards compatibility.

With the new 7.x encryption method (Type 0x01), Nintendo still encrypted the entire ExeFS partition with the older Key0x2C
(original NCCH key), but they added a new section to the encryption code that decrypts anything that isn't 'Icon' or 'Banner'
with Key0x2C (original NCCH key) and then re-encrypts that file with the newer Key0x25 (7.x Key) encryption key.

For Decryption, you need to first decrypt with the entire ExeFS with the original Key0x2C, then encrypt any file that isn't
'Icon' or 'Banner' (e.g Code) with Key0x2C (which undoes the previous 'decryption') and then decrypt it with Key0x25.

Note: For the 'New3DS Only' games (Encryption type 0x0A) you need to use Key0x18 instead of Key0x25.

Source Code:
Pulled from 'master' branch of "[You are not allowed to view links] Register or Login" (Latest commit 0659d93)
In Source file: "decryptor\game.c" (at around Line 360)
In Section:
Only registered users can see contents. Please click here to Register or Login.
edit: I'm not entirely sure if the ExeFS filesizes need to be rounded up to a multiple of 16 bytes.
The encryption works on 16 byte blocks. encryption method used is 'AES 128 bit CTR' (Counter Mode)
so far all of the ExeFS file sizes in the ExeFS headers that I've seen have all been a multiple of 16 bytes.

Only registered users can see contents. Please click here to Register or Login.
« Last Edit: January 10, 2017 - 09:45:03 by b2071988 »