I feel like I should upload my conversion directory, minus the stuff I can't. If nothing else, we'd all be on the same page then.
You know what, here. It's full of bat files, some written by me, some stolen from others. Enjoy.
http://www.mediafire.com/download/c82sc7gdw2e42zv/3DS_to_CIA_Package.rar
---------------------------------------------------------
Instructions
---------------------------------------------------------
Step 1)
Open the "padgen_v3" folder and drop your .3ds file on "ctrKeyGen.py". It will generate an "ncchinfo.bin".
Put this onto your bigSD card, and use your copy of PadGen v3 to create your xorpads.
Step 2)
Open 3DSExplorer, and right-click -> save to each of the main sectors of your backup ROM.3DS.
Save them as the following:
romfs.bin
exheader.bin
exefs.bin
Copy/move these files to "workdir".
Step 3)
Copy your newly generated xorpads from your bigSD card and place them in "workdir".
Rename them to the following:
romfs.xorpad
exheader.xorpad
exefs.xorpad
Step 4)
Run batch files 1, 3, and 4.
Now, in 3DSExplorer, with your ROM.3ds opened, select "PlainRegion" and look to the right ride window.
You'll see something like this:
Where it says [SDK+NINTENDO:Firmware-XX_XX], the "XX_XX" is your clue to the required SDK permissions.
As this one says "02_27", that's Firmware 2, so we can safely assume it uses firmware 2 and lower functions.
The SDK is also shown as SDK 1.2.0.200, so it may even run at Firmware 1, but we'll use 2 to be safe.
This will be needed for editing batch file 5.
Also, while still in 3DSExplorer, look at "NCCH (CTR-P-XXXX) 0". The value shown at "CTR-P-XXXX" is your game's product code. Add that to the cia.rsf in the Product code section.
Step 5)
Open the .rsf file.
It will look like this:
Code:
BasicInfo:
Title : "Cave Story - USA"
CompanyCode : "01"
ProductCode : "CTR-P-ACVE"
ContentType : Application # Application / SystemUpdate / Manual / Child / Trial
Logo : Nintendo # Nintendo / Licensed / Distributed / iQue / iQueForSystem
TitleInfo:
UniqueId : 0x04a1
Category : Application
Option:
UseOnSD : true # true if App is to be #installed to SD
EnableCompress : true # Compresses exefs code
FreeProductCode : true # Removes limitations on ProductCode
EnableCrypt : false # Enables encryption for NCCH and CIA
MediaFootPadding : true # If true CCI files are created with padding
AccessControlInfo:
ExtSaveDataId: 0xb04a1 # same as UniqueId
SystemSaveDataId1: 0x0004a100 # plaintext exheader
SystemSaveDataId2: 0x0004a100 # plaintext exheader
OtherUserSaveDataId1: 0x4a100 # plaintext exheader
OtherUserSaveDataId2: 0x4a100 # plaintext exheader
OtherUserSaveDataId3: 0x4a100 # plaintext exheader
UseOtherVariationSaveData : false
SystemControlInfo:
SaveDataSize: 1M # plaintext exheader
RemasterVersion: 0 # plaintext exheader
StackSize: 0x00040000 # plaintext exheader
JumpId: 0x000400000004a100L # plaintext exheader (<full UniqueID>L)
Now, look inside "workdir" for your exheader.txt.
Open it, and search for the line "Program id: XXXXXXXXXXXXXXXX"
The unique ID is from the 5th last position to the 3rd last position.
If yours says, for example, "Program id: 000400000004a100", which is Cave Story USA, your unique ID would be "4a1".
Simply replace all the entries in the above "cia.rsf" that say "4a1" with your game's unique ID.
Also replace the title and product code information with the ones from your game.
Save and close your cia.rsf file, you're done with it for now.
Step 6)
right-click -> edit the "5-build-cia.bat" file, and look for the part that says "-desc app:2". Edit the "2" to the SDK version hinted at by the earlier check we made. For example, if it's SDK 4, make that say "-desc app:4", which would be used by, for example, LoZ-ALBW.
Save the edited batch file, and then run it. You should be presented with an "Install.cia" file. You can rename that to the name of your game now, and copy it to the root of your SD card.
Step 7)
Install the new "Install.cia" you generated with either DevMenu or over your network.
Done.
--------------------------------------------------------------
To Add a Manual to your CIA File
--------------------------------------------------------------
It's simple really, just open 3DSExplorer, and right-click where it shows in this picture:
Right here:
Save it as "manual.cxi" in your "workdir" folder.
Rename to:
And then save it.
Next, rename it from "manual.cxi" to "manual.cfa":
to:
Next, you'll have to edit your build batch file (5-build-cia.bat).
Right-click -> edit
Replace the entire contents with the code found at the following link:
http://pastebin.com/e8nnr2HD
You'll want to copy the contents of the "RAW Paste Data" Section, as otherwise you'll be presented with a lot of whitespace (spaces) in the editor, which just looks bad.
Then, assuming everything's in the right spot, just save and run your build script (5-build-cia.bat) and you will now have a manual in your compiled CIA.
--------------------------------------------------------------
To Make your CIA Game Region Free
--------------------------------------------------------------
You'll need a Hex editor for this.
I'd suggest a free one, like HxD, found here:
http://mh-nexus.de/en/downloads.php?product=HxD
Download the version for your language and install it.
Once it's installed, you'll need to open up your "icon.bin" file with it. You can either drag-and-drop your "icon.bin" file into HxD's main window, or open it through the [File -> Open] drop-down menu.
Once it's open, you should see something like this:
Now, you're going to want to hold the [Ctrl] button on your keyboard and press "G", so [Ctrl+G].
This window will open:
Now, You're going to want to type "2018" into the textbox underneath "Offset", so it looks like this:
Then, just click on the "OK" button. You'll find yourself in this location:
Now, simply type "7FFFFFFF" into your keyboard. You'll end up with something that looks like this:
Now, just hold [Ctrl] again, and press "S", so [Ctrl+S]. You'll know it worked if the red text turned black, like this:
Finally, you can close HxD and run your "5-build-cia.bat" file. Your CIA is now Region Free and will show up on any console's home menu!
For a complete list of all of the possible region codes, refer to this:
Code:
0x01 = Japan
0x02 = North America
0x04 = Europe
0x08 = Australia
0x10 = China
0x20 = Korea
0x40 = Taiwan
0x7FFFFFFF = Region Free