ROM Hack [Release] .Net 3DS Toolkit - Extract and Repack 3DS ROMs (and CIAs)

evandixon

PMD Researcher
OP
Developer
Joined
May 29, 2009
Messages
1,725
Trophies
0
Website
projectpokemon.org
XP
2,313
Country
United States
Ever notice how the majority of command-line applications require about a dozen commands for a single logical operation? This tool aims to fix that! ROMs can be extracted and repacked with a single command per operation, like so:

To extract:
Code:
ToolkitConsole.exe MyRom.3ds RawFiles

To repack as a CIA:
Code:
ToolkitConsole.exe RawFiles Repacked.cia

To repack as a 0-key encrypted CCI (for use with Gateway):
Code:
ToolkitConsole.exe RawFiles Repacked.3ds -key0
OR
ToolkitConsole.exe RawFiles Repacked.3dz
Note: 3dz files will be invalid until a private header is applied.

To repack as a decrypted CCI (for use with Citra or Decrypt9):
Code:
ToolkitConsole.exe RawFiles Repacked.3ds

To repack for HANS:
Code:
ToolkitConsole.exe RawFiles G:/ MyHack

A GUI is available for anyone who doesn't want to bother with console commands. A .Net 4.6 code library is available for .Net developers making their own programs. See GitHub for library usage. Latest package will be on Sky Editor's MyGet feed and may be added to NuGet at some point.

System requirements:
  • .Net Framework 4.6
  • Free space on the system drive. Cleanup happens as soon as possible, but especially for larger ROMs, you may need several GB free.

Supported formats for extraction:
  • Decrypted CCI (aka .3DS)
  • Decrypted CXI (what Braindump gives you)
  • Decrypted CIA
  • NDS ROM

Supported formats for building:
  • Decrypted CCI (aka .3DS)
    • For use with Citra
    • Can be used for Gateway and Sky 3DS (with CFW) if encrypted using Decrypt9
  • 0-Key Encrypted CCI
    • For use with Gateway
  • CIA
    • For use with CFW
  • HANS RomFS, Code.Bin, and Homebrew Launcher Shortcut
  • NDS ROM

Planned Features:
  • Copy private header to 0-key encrypted CCI files as they are built. Until this is done, any *.3dz files created are invalid until a private header is added.

Credits:
  • SciresM for 3DS Builder (modified to use command-line arguments)
  • profi200 for Project_CTR's makerom
  • dnasdw for 3dstool
  • Asia81 for HackingToolkit3DS, which provided the usage for 3dstool.

Release Page
GitHub
 
Last edited by evandixon,

evandixon

PMD Researcher
OP
Developer
Joined
May 29, 2009
Messages
1,725
Trophies
0
Website
projectpokemon.org
XP
2,313
Country
United States
Nice tool. Could you make a gui to make it easier?
Good idea.

Here's what the GUI will look like:
jd5eZk7.png

t597FhG.png

b09O759.png


I'll need a little time to make everything functional, but because the code library is almost as easy to use as the console, it shouldn't take too long.
 

evandixon

PMD Researcher
OP
Developer
Joined
May 29, 2009
Messages
1,725
Trophies
0
Website
projectpokemon.org
XP
2,313
Country
United States
@UniqueGeek Do you think, after your, you could also do for me a GUI version for mine?
I already tried something, but I don't have any C knowledge...
Probably not, since mine is a code library made for use with other programs. The console is simply a way to easily test it (and I later realized that it's useful in its own right), and the GUI is coming because it was requested and because it is trivial to make. Making a GUI for HackingToolkit3DS would either require a rewrite of the batch file, or a lot of interfacing with the console. The GUI I'm working on does not actually interact with the console, it will instead call the code library.
Do not do a gui in C. It's troublesome, especially when there easier options such as C#.

You can easily create a nice gui with C# in Visual Studio. :)
Or VB.Net, like mine. (Totally not biased or anything :P )
 

evandixon

PMD Researcher
OP
Developer
Joined
May 29, 2009
Messages
1,725
Trophies
0
Website
projectpokemon.org
XP
2,313
Country
United States
I added the GUI and even had time to get to CIA extraction. I dumped a cartridge to cia using Decrypt9, extracted it, and repacked it for my Gateway, and it worked.
https://github.com/evandixon/DotNet3dsToolkit/releases/tag/1.2.0

I didn't test it as much as I would like to have tested it (I'm out of time and have to temporarily rejoin the outside world), so it's marked as a pre-release, but it will probably™ work. I'm out of time, so I'll test it a little more in a few hours days. If anyone wants to give it a try in the mean time, please let me know what you think.
 
Last edited by evandixon,

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,008
Trophies
2
Age
36
XP
4,569
Country
United States
I added the GUI and even had time to get to CIA extraction. I dumped a cartridge to cia using Decrypt9, extracted it, and repacked it for my Gateway, and it worked.
https://github.com/evandixon/DotNet3dsToolkit/releases/tag/1.2.0

I didn't test it as much as I would like to have tested it (I'm out of time and have to temporarily rejoin the outside world), so it's marked as a pre-release, but it will probably™ work. I'm out of time, so I'll test it a little more in a few hours days. If anyone wants to give it a try in the mean time, please let me know what you think.
Worked great for me. I used a CIA downloaded with encrypted title key, deep decrypted it with Decrypt9, extracted it with your tool, modified the RomFS, re-packed it, re-encrypted it and installed it.

I also took a .3DS file and unpacked it, modded it, re-packed it and then couldn't test it since my Sky3DS would not let me write it even after updating the SHA1 in the template file :/ But it seems to have worked as intended. Last thing I need to test is dumping from SD -> CIA, then deep decrypting it and testing.
 
Last edited by DocKlokMan,

evandixon

PMD Researcher
OP
Developer
Joined
May 29, 2009
Messages
1,725
Trophies
0
Website
projectpokemon.org
XP
2,313
Country
United States
Updated to 1.3.0. This release adds NDS ROM support while not significantly altering the usage. Now tools can extract and NDS and 3DS ROMs without altering anything but the file extension.

NDS extraction uses my own code which runs much faster than ndstool. How much faster will likely depend on how beefy your computer is. On my laptop, it runs about 10x faster. Ndstool is still used for building, both because I haven't implemented building, but also ndstool runs pretty quickly for building, so I don't think it's worth writing it myself.
 

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,008
Trophies
2
Age
36
XP
4,569
Country
United States
Updated to 1.3.0. This release adds NDS ROM support while not significantly altering the usage. Now tools can extract and NDS and 3DS ROMs without altering anything but the file extension.

NDS extraction uses my own code which runs much faster than ndstool. How much faster will likely depend on how beefy your computer is. On my laptop, it runs about 10x faster. Ndstool is still used for building, both because I haven't implemented building, but also ndstool runs pretty quickly for building, so I don't think it's worth writing it myself.
This is great. The only issue I've had is when using the GUI to build a CIA it finishes without displaying any errors if the build fails due to lack of memory. Needed to try building it with the command line tool to see the error.
 

evandixon

PMD Researcher
OP
Developer
Joined
May 29, 2009
Messages
1,725
Trophies
0
Website
projectpokemon.org
XP
2,313
Country
United States
This is great. The only issue I've had is when using the GUI to build a CIA it finishes without displaying any errors if the build fails due to lack of memory. Needed to try building it with the command line tool to see the error.
If the GUI doesn't show an error, it was a problem with one of the background processes. There should be a file called "LatestLog.txt" which contains the output of all the background processes (but unfortunately doesn't mark which line goes with which program; the console does). Could you take a look to see if there's any errors listed there?
 

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,008
Trophies
2
Age
36
XP
4,569
Country
United States
If the GUI doesn't show an error, it was a problem with one of the background processes. There should be a file called "LatestLog.txt" which contains the output of all the background processes (but unfortunately doesn't mark which line goes with which program; the console does). Could you take a look to see if there's any errors listed there?
It seems to only have the logs of the latest thing I did and that was a while ago. I'm running it on a VM and just upped the allocated memory. The GUI would show the loading bar then it would display Ready but no output file was found. Did it three times thinking it may have been the file name, location, etc. Then ran the command line and it gave the error that there was low memory. Fixed it by increasing the memory in the VM.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: Yes Mien Hair