ROM Hack 3dsconv.py - script to easily convert 3DS ROMs to CIA

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
6,068
Trophies
2
XP
7,794
Country
United States
So I've been working on this about a month or two ago, because I wanted a different way to convert ROMs to the CIA format for those who didn't want to use Wine or wanted something with source code. This is probably mostly replaced by ticket/titlekey/CDN stuff, but I figured it'd still be useful.

Here is 3dsconv.py, a Python script intended for "advanced users" that allows you to convert Nintendo 3DS ROMs to CIAs entirely from the terminal, quickly and easily.

Get the latest release (4.1)
Please read the README and command output for more information.
The only requirements are Python 3 in your PATH. pyaes needed for encryption. On Windows, the provided 3dsconv.exe can be used without Python or pyres.

It was mainly designed to be put in your PATH so you can run it like any other command from anywhere, or to use in own scripts for automation or other purposes.

Some of the features include...
  • Completely offline conversion of any ROM, including encrypted if the ARM9 bootROM is supplied
  • Supports Manual and Download Play
  • Supports converting and automatically detects fully-decrypted, zerokey-encrypted, and encrypted ROMs
  • Set specific output directory
  • Free and open source (MIT license), so you can check it out and modify it however you wish
  • Pure-Python including pyaes, making it very portable
Source: https://github.com/ihaveamac/3dsconv
All releases: https://github.com/ihaveamac/3dsconv/releases
Please report bugs, requests, and other issues on GitHub or this thread. Include your operating system and game you converted (and if it was built using something like 3DS Builder).
 
Last edited by ihaveahax,

TheReturningVoid

0xAAAAAAAA
Member
Joined
Oct 2, 2014
Messages
332
Trophies
0
Location
/dev/urandom
XP
244
Country
Been testing this for a little while now, and I can say that it works pretty well. Haven't tried with some of the newer releases though, so I'll report back once I get a change to test them.
 

gamecaptor

R.I.P. Densetsu. Legends never die!
Member
Joined
Jan 22, 2004
Messages
759
Trophies
2
Location
Hyrule most of the time
XP
3,281
Country
United States
I have always used 3DS Simple CIA Converter v4.3 to convert my .3ds stuff to .cia. The process seems to be pretty much the same, so I'm a little confused as what's different?

That said I just went through the process once and I want to be sure I'm doing it correctly.

I first tried this command and I got this result:
3dsconv ROM.3ds
- processing: ROM (encrypted)
! 000400000017B200.Main.exheader.xorpad couldn't be found.
use --gen-ncchinfo with this ROM.
* done converting!
0 out of 1 roms processed

I Then went through these steps:
1. I ran this command:
3dsconv --gen-ncchinfo ROM.3ds
- processing: ROM (encrypted)
! 000400000017B200.Main.exheader.xorpad couldn't be found.
- saving ncchinfo.bin
- use Decrypt9 on a 3DS system to generate the XORpads.
place the file at the root or in a folder called "Decrypt9".
view the Decrypt9 README and download releases at
https://github.com/d0k3/Decrypt9WIP
* done converting!
0 out of 1 roms processed

2. I then copied the ncchinfo.bin to the root of my 3DS SD card.

3. I started Decrypt9 and selected XORpad Generator Options -> NCCH Padgen

4. I copied the ################.Main.exheader.xorpad from my 3DS SD card back to my 3dsconv folder

5. I then ran this command:
3dsconv ROM.3ds
- processing: ROM (encrypted)
* done converting!
1 out of 1 roms processed

6. It created my ROM.cia file
 

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
6,068
Trophies
2
XP
7,794
Country
United States
I have always used 3DS Simple CIA Converter v4.3 to convert my .3ds stuff to .cia. The process seems to be pretty much the same, so I'm a little confused as what's different?
the two big differences are that, since it's a python script it supports more operating systems than just Windows, and also properly supports decrypted roms. the second one especially, since Decrypt9 can now dump & decrypt game cards at the same time, removing the xorpad step.

it also doesn't need exefs xorpads, which were used for region-freeing, which isn't really necessary (and can break out of region DLC? I'm not sure)
That said I just went through the process once and I want to be sure I'm doing it correctly.
nothing seems wrong in what you did.
 
Last edited by ihaveahax,
  • Like
Reactions: gamecaptor

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
6,068
Trophies
2
XP
7,794
Country
United States
Thanks for this tool!

Quick question though, anyone know how to add makerom to your path on mac?
your PATH would normally include places like /usr/bin. if you're lazy you can just drop makerom into this folder. note you probably won't see it normally from Finder, so use the "Go" menu then "Go to Folder..."

you can also edit .bash_profile in your user folder to add something like:
Code:
export PATH=/Users/username/bin:${PATH}
then make a folder in your user folder called "bin", and put makerom/etc in that.
 

ongo_gablogian

Well-Known Member
Member
Joined
Mar 26, 2010
Messages
191
Trophies
1
XP
593
Country
United States
your PATH would normally include places like /usr/bin. if you're lazy you can just drop makerom into this folder. note you probably won't see it normally from Finder, so use the "Go" menu then "Go to Folder..."

you can also edit .bash_profile in your user folder to add something like:
Code:
export PATH=/Users/username/bin:${PATH}
then make a folder in your user folder called "bin", and put makerom/etc in that.

Thanks, I appreciate the help. I followed those steps and am now getting this error:

ERROR said:
Traceback (most recent call last):
File "3dsconv.py", line 158, in <module>
if not testcommand("makerom"):
File "3dsconv.py", line 77, in testcommand
proc = subprocess.Popen([cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
 

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
6,068
Trophies
2
XP
7,794
Country
United States
I tried both "/usr/bin" and "/users/username/bin".

Btw, Is this a proper command structure?

"python 3dsconv.py game.3ds"
if it's in /usr/bin, you should try "sudo chmod +x /usr/bin". for /Users/username/bin, use "chmod +x ~/bin/makerom"

for using the script, you could use chmod on it:
Code:
chmod +x 3dsconv.py
./3dsconv.py game.3ds
 

ongo_gablogian

Well-Known Member
Member
Joined
Mar 26, 2010
Messages
191
Trophies
1
XP
593
Country
United States
try this:
Code:
sudo chmod +x /usr/bin/makerom

I'm still getting errors, but at least a .cxi file is being built.

ERROR said:
- processing: rom (decrypted)
! makerom had an error.
- full command: makerom -v -f cia -o 0004000000046500-game-conv.cia -content 0004000000046500-game-conv.cxi:0:0
- output:

Traceback (most recent call last):
File "./3dsconv.py", line 375, in <module>
with open(os.path.join(workdir, "%s-game-conv.cia" % tid), "r+b") as cia:
IOError: [Errno 2] No such file or directory: 'work/0004000000046500-game-conv.cia'
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Sicklyboy @ Sicklyboy: *teleports behind you* "Nothing personnel, kiddo" +1