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

ihaveahax

Well-Known Member
OP
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,854
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,319
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,070
Trophies
2
XP
7,854
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,070
Trophies
2
XP
7,854
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
597
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,070
Trophies
2
XP
7,854
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
597
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
  • Psionic Roshambo @ Psionic Roshambo:
    Having every channel is fun lol
  • D @ diamondsofmayhem:
    Actually, finally found someone who was looking for the same thing. https://gbatemp.net/threads/lost-hyrule-warriors-legends-v1-6-0-ntr-plugin.628141/ to no avail.
  • D @ diamondsofmayhem:
    well, sorry for bugging yall with this.
  • Xdqwerty @ Xdqwerty:
    good night
  • Sicklyboy @ Sicklyboy:
    sup nerds
    +1
  • BigOnYa @ BigOnYa:
    Sup dawg, watching old rap vids so feel like I gotta talk...Real
  • BigOnYa @ BigOnYa:
    Not really just funny. I'm definitely a nerd!
  • ShinyLuxio @ ShinyLuxio:
    Hi there, it's any way to recover original LFCS if I don't have a NAND backup?
  • ShinyLuxio @ ShinyLuxio:
    Bought second hand 3DS, it seems it was "unbanned" but that was before I bought it
  • K3Nv2 @ K3Nv2:
    I got these in today for $20 stink buds they aren't that bad https://a.co/d/fOMSn8g
    +1
  • ShinyLuxio @ ShinyLuxio:
    @BigOnYa thanks but my question isn't there
  • BigOnYa @ BigOnYa:
    You ask your questions there, create a new thread if its not already answered, then eventually a 3ds genius will respond.
  • ShinyLuxio @ ShinyLuxio:
    I will, thanks
    +1
  • BigOnYa @ BigOnYa:
    No prob and btw, welcome to gbatemp! :grog:
  • BigOnYa @ BigOnYa:
    @K3Nv2 I got some cheapies at wallys, that are pretty good, already have lost a few expensive ones (one falls out and gone, can't find) while cutting grass so bought some cheap ones, and of course never lose these cheap ones. (Cheap meaning only $35, compared to air buds which I only have 1 of 2 now)
  • BigOnYa @ BigOnYa:
    They need to add air tags to they airbuds..
  • The Real Jdbye @ The Real Jdbye:
    @BigOnYa the airtags are bigger than the airpods, they won't fit
    +1
  • BigOnYa @ BigOnYa:
    Be cool tech tho. Of course they want to lose them anyways. Buy and buy again.
  • K3Nv2 @ K3Nv2:
    Apple could make a find my AirPods thing pretty easily
    +1
  • BigOnYa @ BigOnYa:
    You would think, esp using bluetooth, not GPS, like a "your getting hot-er" meter on your phone.
  • BigOnYa @ BigOnYa:
    I think they should tie up diddy, and let all the victims come and abuse him, we'll make a holiday of it every year. (jk, maybe)
  • BigOnYa @ BigOnYa:
    Crazy, the rich get away with this shit, and I can't shit without the poop police checking my asshole every time I shit, or have my toilet seatbelt on.
    BigOnYa @ BigOnYa: Crazy, the rich get away with this shit, and I can't shit without the poop police checking my...