ROM Hack Converting to CIA on linux

mid-kid

GBAtemp spamBOT
OP
Member
Joined
Aug 2, 2012
Messages
879
Trophies
0
Age
25
XP
1,163
Country
Hi, I've succesfully installed Palantine's CFW, and I have a few games there, but I want to be able to convert some games to CIA.
My windows machine olny has 2g of ram, and swapping on windows looks like the memory graph is having a spasm attack, taking ages to convert.
So, on my linux laptop, with 2g of ram, and 4g of actually working swap space, I want to be able to convert my games.
The first steps are very straight-forward, use 3DS_Multi_Decryptor to get dem xorpads, but after that, the information on how to convert is spread all over the internet and I can't find a simple document stating which tools I need, and how to use them, so I set out on an expedition by myself.
I've installed devkitARM, makerom and ctrtool (from this Project_CTR, and patched a file documented here), added them to my path and set the correct variables, but that's not what's wrong.
I've created a tools directory, containing some files from Queno138's pack (rsfgen.py, rom.rsf), rom_tool.exe downloaded from the original thread, ExInjector.exe downloaded from the original thread, slot0x25KeyxX.bin, padxorer compiled from this pastebin).

This document documents the steps I've taken to convert a .3ds to .cia, I've tried both Animal Crossing and Kid Icarus:
# Extract encrypted contents
ctrtool -p --exheader=exheader.bin --romfs=romfs.bin --exefs=exefs.bin game.3ds

# Use padxorer to decrypt the contents of this, using the xorpads
# Everything from now on needs the decrypted stuff, you can delete the encrypted files and rename the decrypted ones
padxorer part.bin pad.xorpad

# Extract exefs to obtain icon and banner
ctrtool --exefsdir=exefs --decompresscode -t exefs exefs.bin

# For manual/download play, use rom_tool to create manual.cfa and dlp.cfa
# Apparently rom_tool does not work natively on linux
wine rom_tool.exe --extract=. game.3ds
# This outputs appdata and updatedata too, just remove it

# Create rsf file
cp dummy.rsf game.rsf
python2 rsfgen.py game

# Create cxi
makerom -f cxi -o game.cxi -target t -desc app:5 -rsf game.rsf -icon icon.bin -banner banner.bin -exefslogo -code code.bin -exheader exheader.bin -romfs romfs.bin

# Inject original exheaders
wine ExInjector.exe -rom game.cxi -exheader exheader.bin -sd

# Create CIA
makerom -f cia -o game.cia -content game.cxi:0:0 -content manual.cfa:1:1

I've studied Queno138's "build and make.bat" to create this document.
This looks right to me, but whenever I boot the game on CFW, it's stuck on the 3DS logo.
Am I missing something?
 

Vappy

Well-Known Member
Member
Joined
May 23, 2012
Messages
1,508
Trophies
2
XP
2,613
Country
Do you get any garbage output from ctrtool if you try inputting decrypted exheader, exefs or romfs? You shouldn't need the '-desc app:5' flag with makerom, rsfgen or ExInjector should take care of that. Also shouldn't be necessary to use both of those, try with just one or the other? Do you get any garbage output from ctrtool if you try inputting exheader, exefs or romfs?
 

mid-kid

GBAtemp spamBOT
OP
Member
Joined
Aug 2, 2012
Messages
879
Trophies
0
Age
25
XP
1,163
Country
Do you get any garbage output from ctrtool if you try inputting decrypted exheader, exefs or romfs? Do you get any garbage output from ctrtool if you try inputting exheader, exefs or romfs?

Inputting... how?

You shouldn't need the '-desc app:5' flag with makerom, rsfgen or ExInjector should take care of that. Also shouldn't be necessary to use both of those, try with just one or the other?

I removed that flag, compiled rom_tool from source for linux (because it works, even though the original thread says it doesn't), and didn't use ExInjector, and it worked!
But I want to use ExInjector, because I want to have the original headers, though I need an rsf file to generate the cxi. How would I go about using ExInjector?

By the way, Animal Crossing doesn't want to update online. I think this may have to do with the updatedata not being included. How would I go about including it?

Try this conversion package, works for me on os x and is supposed to support linux too:

http://gbatemp.net/index.php?posts/5293438

I'm not too fond of those kind of scripts, which do something you could do yourself in about 10 commands, and obscure the whole process, making it very hard to know what's going on. I've used them sometimes, but these scripts give me the exact same feeling as those "rootkits" or "root toolbox" you have for android. I mean, come on, it's just getting fastboot, adb and running a few commands to root most phones.
 

Vappy

Well-Known Member
Member
Joined
May 23, 2012
Messages
1,508
Trophies
2
XP
2,613
Country
Inputting... how?

The -t flag lets you specify an input type and file, and reads back what it can from the file. Easy way to check the file was fully decrypted.
But I want to use ExInjector, because I want to have the original headers, though I need an rsf file to generate the cxi. How would I go about using ExInjector?
Really, just removing the -desc flag should be enough for it to be working, you should be able to use ExInjector as normal (ie. after making the .cxi)
By the way, Animal Crossing doesn't want to update online. I think this may have to do with the updatedata not being included. How would I go about including it?

Not something I've ever attempted before myself, but https://gbatemp.net/threads/4-x-only-cia-cfw-complete-guide.373532/page-58#post-5150257 could work?
 

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,855
Trophies
2
XP
28,840
Country
United Kingdom
I'm not too fond of those kind of scripts, which do something you could do yourself in about 10 commands, and obscure the whole process, making it very hard to know what's going on. I've used them sometimes, but these scripts give me the exact same feeling as those "rootkits" or "root toolbox" you have for android. I mean, come on, it's just getting fastboot, adb and running a few commands to root most phones.

Fair enough, I don't think this one really does anything in a more obscure way than what you're doing tho, if anything it's just another example to check out.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    fluff663 @ fluff663: hello everyone