ROM Hack [Release] Just another 3DS to CIA converter

drizztbsd

Well-Known Member
OP
Newcomer
Joined
Apr 4, 2016
Messages
66
Trophies
0
XP
138
Country
Italy
Hi,
this is just another 3DS to CIA converter.

This uses only ExHeader XORpads (the first KB of the xorpad) and nothing else.

FEATURES
  • Simple to use
  • Support of zipped roms and xorpads
  • Portable
  • Open Source (GPLv2)
USAGE
Just put your roms in the roms directory, xorpads in the xorpads directory and launch the program.

If you don't have the xorpad the tool will generate an ncchinfo.bin file that must be used with Decrypt9WIP.

You can also use zipped roms and multiple xorpad zipped.
Zipped xorpads must also contains CRC32 of the ROM in filename (TITLEID.CRC32.Main.exheader.xorpad).

An anonymous user released the complete set of exheader xorpads on GitHub (search for it).
If you download his set by using the Download ZIP feature of GitHub, then you can put the zip file inside the xorpad directory and it'll be used automatically

Here you can always find the last release with all-in-one binary for Windows

KNOWN BUGS
Big (more than 2GB) roms cannot be converted (yet) on 32-bit operating systems or if you are using a 32-bit make_cia.

CHANGELOG
v0.2.1
  • Fix ncchinfo.bin generation from roms inside zip files
  • Add a 64-bit make_cia.exe and a warning if you are using a 32-bit OS
 
Last edited by drizztbsd,

jimmyleen

Well-Known Member
Member
Joined
Feb 28, 2016
Messages
1,171
Trophies
0
XP
704
Country
Does anyone else have the knowledge to make uncart convert .3ds to .cia without using a pc?

Edit: unfortunately i'm not that smart to make uncart do anything
 

cearp

瓜老外
Developer
Joined
May 26, 2008
Messages
8,725
Trophies
2
XP
8,510
Country
Tuvalu
open source, thank you!
riku's tool was nice but, source is really important.

Does anyone else have the knowledge to make uncart convert .3ds to .cia without using a pc?
Edit: unfortunately i'm not that smart to make uncart do anything
yes i was thinking that too. using some code from decrypt9 we could decrypt what is needed and convert to cia on the device, all in 1 button press.
but, is it that important? no - but very cool :)

--------------------- MERGED ---------------------------

Does this make the CIA's region free or CryptoFix them? I'd prefer if it didn't.
i think the OP would say if it did this, but even if it did, it's open source so you can change it :)
 
  • Like
Reactions: ihaveahax

jimmyleen

Well-Known Member
Member
Joined
Feb 28, 2016
Messages
1,171
Trophies
0
XP
704
Country
open source, thank you!
riku's tool was nice but, source is really important.


yes i was thinking that too. using some code from decrypt9 we could decrypt what is needed and convert to cia on the device, all in 1 button press.
but, is it that important? no - but very cool :)

--------------------- MERGED ---------------------------


i think the OP would say if it did this, but even if it did, it's open source so you can change it :)

Important? No

More convenient then using a pc? Yes indeed
 

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,827
Country
United States
Does this make the CIA's region free or CryptoFix them? I'd prefer if it didn't.
i think the OP would say if it did this, but even if it did, it's open source so you can change it :)
it doesn't use ExeFS xorpads, so it doesn't use regionfree.

the ExHeader xorpad is only used to change a single byte in it, basically to indicate that it's an SD card title. in the same byte also tells if the code is compressed. (offset 0xD)
 
  • Like
Reactions: cearp

BerserkLeon

Not-so-new member
Member
Joined
Mar 22, 2010
Messages
460
Trophies
1
Age
34
Location
Pennsylvania
XP
538
Country
United States
[!] CXI decryption failed (Check CXIKey)
[!] Actual savedata size, title version and Meta region could not be obtained
[!] Memory Allocation Failure
[!] Content could not be setup for CIA
 

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,827
Country
United States
[!] CXI decryption failed (Check CXIKey)
[!] Actual savedata size, title version and Meta region could not be obtained
[!] Memory Allocation Failure
[!] Content could not be setup for CIA
how much RAM does your computer have and what game are you trying to convert?
 

BerserkLeon

Not-so-new member
Member
Joined
Mar 22, 2010
Messages
460
Trophies
1
Age
34
Location
Pennsylvania
XP
538
Country
United States
how much RAM does your computer have and what game are you trying to convert?
Performance section of task manager reports 7.2GB
Trying to convert SMT: Devil Survivor 2 Record Breaker (ADXE)
or Bravely Second (BSEE)
or Hyrule Warriors Legends (BZHE)
All the games I've tried this with so far don't work... I'm booting D9 from a9lh wih all the needed keys I think.

Tried 3dsconv.py too. Get:
- processing: CTR-P-ADXE (encrypted)
! make_cia had an error.
- full command: make_cia -o 0004000000159500-game-conv.cia --savesize=128 --content0=0004000000159500-game-conv.cxi --id_0=0 --index_0=0 --content1=0004000000159500-manual.cfa --index_1=1
- output:
then what I posted before.
I had an error compiling make_cia so I grabbed the binary from d0k3's github. might that be the issue?

here's that one.

gcc --std=c99 -Wall -I. -c -o utils.o utils.c
gcc --std=c99 -Wall -I. -c -o ctr_crypto.o ctr_crypto.c
gcc --std=c99 -Wall -I. -c -o settings.o settings.c
In file included from settings.c:21:0:
settings.h:44:1: error: conflicting types for 'CERT_CONTEXT'
CERT_CONTEXT;
^
In file included from c:\app\x86_64-w64-mingw32\include\windows.h:95:0,
from lib.h:32,
from settings.c:19:
c:\app\x86_64-w64-mingw32\include\wincrypt.h:2657:5: note: previous declaration of 'CERT_CONTEXT' was here
} CERT_CONTEXT,*PCERT_CONTEXT;
^
make: *** [settings.o] Error 1
 
Last edited by BerserkLeon,

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,827
Country
United States
Performance section of task manager reports 7.2GB
Trying to convert SMT: Devil Survivor 2 Record Breaker (ADXE)
or Bravely Second (BSEE)
or Hyrule Warriors Legends (BZHE)
All the games I've tried this with so far don't work... I'm booting D9 from a9lh wih all the needed keys I think.

Tried 3dsconv.py too. Get:
- processing: CTR-P-ADXE (encrypted)
! make_cia had an error.
- full command: make_cia -o 0004000000159500-game-conv.cia --savesize=128 --content0=0004000000159500-game-conv.cxi --id_0=0 --index_0=0 --content1=0004000000159500-manual.cfa --index_1=1
- output:
then what I posted before.
I had an error compiling make_cia so I grabbed the binary from d0ke's github. might that be the issue?

here's that one.

gcc --std=c99 -Wall -I. -c -o utils.o utils.c
gcc --std=c99 -Wall -I. -c -o ctr_crypto.o ctr_crypto.c
gcc --std=c99 -Wall -I. -c -o settings.o settings.c
In file included from settings.c:21:0:
settings.h:44:1: error: conflicting types for 'CERT_CONTEXT'
CERT_CONTEXT;
^
In file included from c:\app\x86_64-w64-mingw32\include\windows.h:95:0,
from lib.h:32,
from settings.c:19:
c:\app\x86_64-w64-mingw32\include\wincrypt.h:2657:5: note: previous declaration of 'CERT_CONTEXT' was here
} CERT_CONTEXT,*PCERT_CONTEXT;
^
make: *** [settings.o] Error 1
I don't know if the one from d0k3's github is 32-bit or 64-bit. not really sure how to build it on Windows but I'll give something a shot.
 

BerserkLeon

Not-so-new member
Member
Joined
Mar 22, 2010
Messages
460
Trophies
1
Age
34
Location
Pennsylvania
XP
538
Country
United States
I don't know if the one from d0k3's github is 32-bit or 64-bit. not really sure how to build it on Windows but I'll give something a shot.
Well if it's 64 bit I'm on a 64bit machine. If it's 32 bit it should run on a 64 bit machine.
All 3 roms are smaller than 3GB, so does it need much more RAM than the ROM size?

there's also this it spits out, didn't notice before.

work/000400000017ea00-game-conv.cia
CTR-P-BZHE.cia
Traceback (most recent call last):
File "C:\app\3dsconv.py", line 325, in <module>
os.rename("work/%s-game-conv.cia" % tid, cianame)
WindowsError: [Error 2] The system cannot find the file specified

But strangely, there is a work dir with the cxis and cfas in it.
 
Last edited by BerserkLeon,

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,827
Country
United States
Well if it's 64 bit I'm on a 64bit machine. If it's 32 bit it should run on a 64 bit machine.
All 3 roms are smaller than 3GB, so does it need much more RAM than the ROM size?
yeah but I think if it's a 32-bit executable, it will have limited 4gb ram or something. I don't know.

here, I tried building it on 64-bit windows 8.1 through cygwin though it should still work fine through the command prompt. tell me how it goes. I think the DLL should be next to the exe if you don't have cygwin.
 

Attachments

  • make_cia.zip
    1.1 MB · Views: 394

BerserkLeon

Not-so-new member
Member
Joined
Mar 22, 2010
Messages
460
Trophies
1
Age
34
Location
Pennsylvania
XP
538
Country
United States
using 3dsconv as it spits out more;

D:\3dscia>3dsconv.py --xorpads=xorpads CTR-P-BZHE.3ds
- processing: CTR-P-BZHE (encrypted)
! make_cia had an error.
- full command: make_cia -o 000400000017ea00-game-conv.cia --savesize=512 --content0=000400000017ea00-game-conv.cxi --id_0=0 --index_0=0 --content1=000400000017ea00-manual.cfa --index_1=1
- output:
[!] CXI decryption failed (Check CXIKey)
[!] Actual savedata size, title version and Meta region could not be obtained
[!] Memory Allocation Failure
[!] Content could not be setup for CIA
[!] Failed to generate 000400000017ea00-game-conv.cia

work/000400000017ea00-game-conv.cia
CTR-P-BZHE.cia
Traceback (most recent call last):
File "C:\app\3dsconv.py", line 325, in <module>
os.rename("work/%s-game-conv.cia" % tid, cianame)
WindowsError: [Error 2] The system cannot find the file specified

though... it popped up faster this time.
 

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,827
Country
United States
using 3dsconv as it spits out more;

D:\3dscia>3dsconv.py --xorpads=xorpads CTR-P-BZHE.3ds
- processing: CTR-P-BZHE (encrypted)
! make_cia had an error.
- full command: make_cia -o 000400000017ea00-game-conv.cia --savesize=512 --content0=000400000017ea00-game-conv.cxi --id_0=0 --index_0=0 --content1=000400000017ea00-manual.cfa --index_1=1
- output:
[!] CXI decryption failed (Check CXIKey)
[!] Actual savedata size, title version and Meta region could not be obtained
[!] Memory Allocation Failure
[!] Content could not be setup for CIA
[!] Failed to generate 000400000017ea00-game-conv.cia

work/000400000017ea00-game-conv.cia
CTR-P-BZHE.cia
Traceback (most recent call last):
File "C:\app\3dsconv.py", line 325, in <module>
os.rename("work/%s-game-conv.cia" % tid, cianame)
WindowsError: [Error 2] The system cannot find the file specified

though... it popped up faster this time.
I'll have to figure out "WindowsError: [Error 2] The system cannot find the file specified". for now, don't use --output=<dir>.

here, I built it again using mingw or something (you can tell I don't build on Windows often!). I don't know if you need other files yet, tell me if you need something.
 

Attachments

  • make_cia.exe.zip
    107.6 KB · Views: 363
  • Like
Reactions: BerserkLeon

BerserkLeon

Not-so-new member
Member
Joined
Mar 22, 2010
Messages
460
Trophies
1
Age
34
Location
Pennsylvania
XP
538
Country
United States
i'm not using --output, just --xorpads
if that's the issue, I'll try throwing everything in the same folder...

nope, same thing.

3ds-to-cia prints
[!] CXI decryption failed (Check CXIKey)
[!] Actual savedata size, title version and Meta region could not be obtained
[!] Memory Allocation Failure
[!] Content could not be setup for CIA
[!] Failed to generate cia\CTR-P-ADXE.cia
Error during CIA creation of 'roms\CTR-P-ADXE.3ds'
Relaunch the program with -v for more informations.


/work is something 3dsconv made without my intervention.

Anyway thanks very much for the help. I wasn't expecting such an immediate response.
 
Last edited by BerserkLeon,

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,827
Country
United States
i'm not using --output, just --xorpads
if that's the issue, I'll try throwing everything in the same folder...

nope, same thing.

3ds-to-cia prints
[!] CXI decryption failed (Check CXIKey)
[!] Actual savedata size, title version and Meta region could not be obtained
[!] Memory Allocation Failure
[!] Content could not be setup for CIA
[!] Failed to generate cia\CTR-P-ADXE.cia
Error during CIA creation of 'roms\CTR-P-ADXE.3ds'
Relaunch the program with -v for more informations.

yeah I'm not sure anymore. I don't know the sizes of the games you're trying to convert but make_cia (and makerom too) aren't very efficient on memory I think. :(
/work is something 3dsconv made without my intervention.
good to know
 
Last edited by ihaveahax,

drizztbsd

Well-Known Member
OP
Newcomer
Joined
Apr 4, 2016
Messages
66
Trophies
0
XP
138
Country
Italy
[!] CXI decryption failed (Check CXIKey)
[!] Actual savedata size, title version and Meta region could not be obtained
[!] Memory Allocation Failure
[!] Content could not be setup for CIA

Thank you.
I released v0.2.1 with a 64-bit prebuilt make_cia.exe for Windows and a big warning if you are using a 32-bit Windows.
 
  • Like
Reactions: BerserkLeon

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    rvtr @ rvtr: Spam bots again.