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,897
Trophies
2
XP
29,525
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
  • Psionic Roshambo @ Psionic Roshambo:
    My 1500ish games is all hand picked and scraped it's taken me months but zero trash well except MAME.... Tried deleting clones and broke the originals uugghh
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I legit have been complaining about MAME for over 20 years... Hate the way they handle roms
  • BigOnYa @ BigOnYa:
    Yea is a pain sometimes
  • Psionic Roshambo @ Psionic Roshambo:
    Now that they decided to add Tiger handheld and fruit machines.... Newer sets are worthless
  • Psionic Roshambo @ Psionic Roshambo:
    Because who doesn't want to emulate Halo LCD by Tiger when the machine needed to emulate it... Could just play Halo....
  • K3Nv2 @ K3Nv2:
    Batocera has some tiger games
  • Psionic Roshambo @ Psionic Roshambo:
    I don't have them on mine Ken lol
  • K3Nv2 @ K3Nv2:
    Waste of the 128kb they take
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Tiger handhelds are good for one thing.... Occupying space in a landfill
  • K3Nv2 @ K3Nv2:
    They make good burning plastic
  • BigOnYa @ BigOnYa:
    Makes me wonder if the Pi5 can play PS2? If there's even a core for it yet.
  • K3Nv2 @ K3Nv2:
    Pi5 should be able to do ps2
  • Psionic Roshambo @ Psionic Roshambo:
    Try Dragon Quest VIII it ran perfectly on a core 2 Duo I had
  • Psionic Roshambo @ Psionic Roshambo:
    Easiest game to run I found
  • K3Nv2 @ K3Nv2:
    Ps2 emulation is cake compared to 3 years ago
  • Psionic Roshambo @ Psionic Roshambo:
    Hardest is probably Gran Turismo 4
  • Psionic Roshambo @ Psionic Roshambo:
    It's much better now yes but Gran Turismo 4 is still the hardest one to emulate that I have in my collection
  • Psionic Roshambo @ Psionic Roshambo:
    Runs perfectly fine but it's as if I can feel it always on the boarder line of dropping a frame lol
  • BigOnYa @ BigOnYa:
    I ordered a spin ball couple days ago to add to my arcade cabinet, will be nice for games like golden tee, or bowling
  • Psionic Roshambo @ Psionic Roshambo:
    I always wanted a controller for like Ikari Warriors, Time Soldiers, Heavy Barrel, Forgotten Worlds games like those
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Not even sure what to call that controller
  • Xdqwerty @ Xdqwerty:
    an online friend I've known since 2021 left me :( bc my attitude is "cutty"
  • Psionic Roshambo @ Psionic Roshambo:
    Sylvester Stallone should have played Kyle Reese lol Arnold still as the Terminator
  • BakerMan @ BakerMan:
    TF DOES "CUTTY" EVEN MEAN?
  • Xdqwerty @ Xdqwerty:
    @BakerMan, he is peruvian so it's probably an idiom
    Xdqwerty @ Xdqwerty: @BakerMan, he is peruvian so it's probably an idiom