Homebrew Official [Download] Decrypt9 - Open Source Decryption Tools (WIP)

  • Thread starter Thread starter d0k3
  • Start date Start date
  • Views Views 935,180
  • Replies Replies 4,476
  • Likes Likes 71
I think that's looking great! But, how does that look inside the EmuNAND options "File Dump..." submenu? I'm pretty sure the text does overlap then.

Anyways, @everyone, I've got somewhat bad news about EmuNAND formatting: We can't do that inside Decrypt9 at the moment, because there is no complete implementation of FATFS available. All current FATFS implementations (that includes the one in Decrypt9) for 3DS miss the ioctl functions, which are required for (among other things) determining the correct size of the SD card and FAT32 formatting a partition. Normatts SDMMC.c (which provides low level SD/NAND access) provide a function for determining SD size, but that function does not work reliably (or not at all, don't know).

So, what does that mean? We can still try doing it on PC. It even makes sense, as writing the NAND image will be so much faster then. Problem here is, I didn't find the right tools or source code for the job yet. If we had the source code of EmuNAND tool by @n1ghty , that would be an almost perfect starting point. Also helpful: simple(!) source code for FAT32 formatting, FDISK partitioning and raw data writing to a drive on Windows or versatile tools to do so.
Maybe you could find some useful information on nasty's OS-X/Linux version?
https://github.com/nastys/emunand-tools
 
  • Like
Reactions: dark_samus3
My adblocker blocks it as well... Anyways, I figured i'd show this, @Shadowtrance this is all completely made with nothing but imagemagick, it isn't finished but I thought I'd just show some of the power behind IM
View attachment 31328
pretty cool eh? now if I could figure out a glow effect I could probably make it look even better :)

It's all made up of 3 commands though I'm looking at making it less than that
That's pretty amazing I'll admit. :) will have to share how you did it so I can mess with it when my PC is back in working order. :) (on my tablet ATM).
 
Maybe you could find some useful information on nasty's OS-X/Linux version?
https://github.com/nastys/emunand-tools
Already knew that, thanks! But the problem is in the low level functions, and these differ between Linux and Windows. I'll just write my own, clean SD formatter in Decrypt9. It's almost finished anyways, and it really is the best solution.

By the way, setting up an EmuNAND would also be possible without dataloss. Yup, that means you could keep all the stuff on your SD card. I won't enable this on 3DS, though, cause moving around all that data with the 3DS slow SD io routines would take the better part of a day with a regularily sized 32GB sd card. Also, it would be error-prone.
 
Already knew that, thanks! But the problem is in the low level functions, and these differ between Linux and Windows. I'll just write my own, clean SD formatter in Decrypt9. It's almost finished anyways, and it really is the best solution.

By the way, setting up an EmuNAND would also be possible without dataloss. Yup, that means you could keep all the stuff on your SD card. I won't enable this on 3DS, though, cause moving around all that data with the 3DS slow SD io routines would take the better part of a day with a regularily sized 32GB sd card. Also, it would be error-prone.

I would love it if you wrote a library like the dd tool (for the 3DS)... I use that tool ALL of the time and it would be great to have for an app

EDIT: also datalossless emuNAND creation?! YES PLEASE
 
Last edited by dark_samus3,
I can:
  • Format a SD as FAT32 using MiniAide Fat32 Formatter leaving a 1 GB space unallocated before the partition. (2GB if N3DS)
  • Use HxD to paste in the first 0x200 bytes of data from a Gateway SD Image file.
  • Copy an EmuNAND.bin and a Launcher.dat to it
  • Launch decrypt9 from my "Main" SD card (not the one I'm creating)
  • Swap cards
  • Run Restore EmuNAND
-done, works fine


On a side note:
When I re-inject an EmuNAND, it creates EmuNAND.bin and injects EmuNAND.bin

When I want to re-inject ticket.db into emuNAND, it creates ticket_emu.db, but injects ticket.db (I have to re-name the ticket_emu.db to ticket.db)

The issue with this is, it saves the sysNAND ticket.db as ticket.db, so if you don't rename the ticket_emu.db, it injects the sysNAND ticket.db into emuNAND.

I know, not a huge deal, but it would be nice if it could list a directory of ticket files so I could pick the one I want.

Like one that is "virgin", one that has all Demos in Unlimited Mode, one that matches my eShop downloads only....

Just a thought
 
Last edited by Datalogger,
  • Like
Reactions: d0k3
That's pretty amazing I'll admit. :) will have to share how you did it so I can mess with it when my PC is back in working order. :) (on my tablet ATM).
It took me more time to figure the striped background than anything else but here's the 3 commands I run (I'm getting much better with IM)
Code:
convert -size 320x240 xc:black -stroke '#560170' -strokewidth 2.50 -fill none -draw "roundrectangle 6,6 313,233 2,2" bg-0.png
convert -size 1x113 pattern:horizontal3 -fill '#412059' -opaque white -fill '#46245F' -opaque black -scale 306x226\! bg-1.png
convert bg-0.png -draw "image over 7,7 0,0 'bg-1.png'" +page -fill black -stroke none -gravity center -draw "circle 18,221 26,213" -draw "polygon 12,10 12,20 7,15" -draw "polygon 305,10 305,20 310,15" bg.png
 
I would love it if you wrote a library like the dd tool (for the 3DS)... I use that tool ALL of the time and it would be great to have for an app

EDIT: also datalossless emuNAND creation?! YES PLEASE
Porting all of dd functionality would go beyound our current possibilities - even for the new format feature I will have to rely on somewhat unconventional methods. Oh well. Lossless EmuNAND formatting, I might think about it if we do a PC version of this. It might also already be possible. Easeus has a commandline (and GUI) tool called Partition Master which can also resize partitions. That combined with either EmuNAND tool or Decrypt9 should do the job (not without user interaction, though). It should work with other partitioning tools, too, you just have to make sure the master boot record is correctly formatted right from the start (read on).

For setting up from scratch (assuming the SD card is not already correctly partitioned), has to be partitioned (1 partition only!) with fdisk (or parted, or GPT fdisk), then formatted with the tool of your choice. Nintendo recommends this. Maybe with the Nintendo recommended tool you don't even need fdisk or the like. You'd just need to check if there is a standard (classic, generic) MBR in sector 1 (the first 512 byte).
On a side note:
When I re-inject an EmuNAND, it creates EmuNAND.bin and injects EmuNAND.bin

When I want to re-inject ticket.db into emuNAND, it creates ticket_emu.db, but injects ticket.db (I have to re-name the ticket_emu.db to ticket.db)

The issue with this is, it saves the sysNAND ticket.db as ticket.db, so if you don't rename the ticket_emu.db, it injects the sysNAND ticket.db into emuNAND.

I know, not a huge deal, but it would be nice if it could list a directory of ticket files so I could pick the one I want.

Like one that is "virgin", one that has all Demos in Unlimited Mode, one that matches my eShop downloads only....

Just a thought
File selector, I might think about it. It wouldn't be that difficult to do. As for the naming (ticket.db and ticket_emu.db) - it is difficult to find a scheme that works for everyone in all cases. If I call it 'ticket.db' regardless of where it comes from, well you'd have no way of dumping both files in one step. As of now, when dumping (on EmuNAND), the file is called ticket_emu.db, and when injecting ticket.db is selected. Any idea how to handle that better? (apart from the file selector, cause I will still need some time for this).
 
Last edited by d0k3,
Porting all of dd functionality would go beyound our current possibilities - even for the new format feature I will have to rely on somewhat unconventional methods. Oh well. Lossless EmuNAND formatting, I might think about it if we do a PC version of this. It might also already be possible. Easeus has a commandline (and GUI) tool called Partition Master which can also resize partitions. That combined with either EmuNAND tool or Decrypt9 should do the job (not without user interaction, though). It should work with other partitioning tools, too, you just have to make sure the master boot record is correctly formatted right from the start (read on).

For setting up from scratch (assuming the SD card is not already correctly partitioned), has to be partitioned (1 partition only!) with fdisk (or parted, or GPT fdisk), then formatted with the tool of your choice. Nintendo recommends this. Maybe with the Nintendo recommended tool you don't even need fdisk or the like. You'd just need to check if there is a standard (classic, generic) MBR in sector 1 (the first 512 byte).

File selector, I might think about it. It wouldn't be that difficult to do. As for the naming (ticket.db and ticket_emu.db) - it is difficult to find a scheme that works for everyone in all cases. If I call it 'ticket.db' regardless of where it comes from, well you'd have no way of dumping both files in one step. As of now, when dumping (on EmuNAND), the file is called ticket_emu.db, and when injecting ticket.db is selected. Any idea how to handle that better? (apart from the file selector, cause I will still need some time for this).
Two sub-folders in the decrypt9 folder, one called emuNAND and the other sysNAND and store all the related data separate?
Then the filenames could be the same..
 
Two sub-folders in the decrypt9 folder, one called emuNAND and the other sysNAND and store all the related data separate?
Then the filenames could be the same..
I'm somewhat averse of the idea of adding more folders (and probably with that, more confusion) to how things are working now. A file selection option might be good, though, adding that to the list. I could also change it so that files are never overwritten (ticket.db would instead be called ticket_sys_00.db, ticket_sys_01.db, .... and ticket_emu_00.db, ticket_emu_01.db, ...). That would also make the file selection dialogue a snap.

And, before i forget about that... @dark_samus3 , Smyers75 already showed us how to set up the EmuNAND without GW tools. MiniAide seems to do the job just fine. Problems with his method: (1) space gets wasted and (2) this can't be done fully automated and is in no way noob friendly.
 
Last edited by d0k3,
OK, I'm fine with whatever you decide to do :)

I was just thinking that it would be nice if all of the files always had their original "saved-as" names so they wouldn't need to be renamed to work with other outside programs.

Like how FunkyCIA wants it to be ticket.db no matter if it's emu or sys NAND, or how 3DS-Multi-Decrypter always wants the files to be named ticket.db and/or decTitleKeys.bin & encTitleKeys.bin, no matter if they came from sysNAND or emuNAND.

Or how emuNANDTool_1.0.3 is looking for NAND.bin, not emuNAND.bin (although this one's an easy fix as it has a browser interface)

Just tossing out suggestions. Feel free to blow them off as being too specific - no offence will be taken!

As for having a Selection for different ticket.db files, another user here gave me his (her?) suggestion, to use CTRXplorer and store them with the same name in different folders named like "CLEAN READY FOR ESHOP" - "LOADED WITH ALL DEMOS WITH NO LIMIT RUNS" "GAMES I PURCHASED ON ESHOP PLUS UPDATES"

I can then just launch CTRXplorer, delete the current ticket.db then copy over the one I want then inject it with decrypt9.
I'll try this tomorrow and see how it works out...
 
Last edited by Datalogger,
Porting all of dd functionality would go beyound our current possibilities - even for the new format feature I will have to rely on somewhat unconventional methods.

Mostly I wanted a standalone library (trust me if I knew how to do it I would) also I wouldn't want/need full functionality... Basically I would want the ability to copy raw data from point A to point B with a few variables (namely seek, skip, count and bs (block size) though that may be all of the function anyways...) Because you have no clue how useful that could be... On a side note @xerpi's Linux port is getting more mature, at the very least I could probably make some emuNAND formating scripts with it... Since that could have fully fledged dd, parted and whatever other commands I could want to make a nice script :)
 
OK, I'm fine with whatever you decide to do :)

I was just thinking that it would be nice if all of the files always had their original "saved-as" names so they wouldn't need to be renamed to work with other outside programs.

Like how FunkyCIA wants it to be ticket.db no matter if it's emu or sys NAND, or how 3DS-Multi-Decrypter always wants the files to be named ticket.db and/or decTitleKeys.bin & encTitleKeys.bin, no matter if they came from sysNAND or emuNAND.

Or how emuNANDTool_1.0.3 is looking for NAND.bin, not emuNAND.bin (although this one's an easy fix as it has a browser interface)

Just tossing out suggestions. Feel free to blow them off as being too specific - no offence will be taken!

As for having a Selection for different ticket.db files, another user here gave me his (her?) suggestion, to use CTRXplorer and store them with the same name in different folders named like "CLEAN READY FOR ESHOP" - "LOADED WITH ALL DEMOS WITH NO LIMIT RUNS" "GAMES I PURCHASED ON ESHOP PLUS UPDATES"

I can then just launch CTRXplorer, delete the current ticket.db then copy over the one I want then inject it with decrypt9.
I'll try this tomorrow and see how it works out...
I'll think that over, but about the filenames... FunkyCIA takes a parameter for the ticket.db name, I think. 3DS Multi Decryptor - there should be no more reason to use that (or is there?). EmuNAND, yup, you are correct, but I think it's somewhat of a fault that the tool won't allow you to selectthe NAND image. For teh formatting feature, I expect to have this finished today, but because I did the format feature myself, this will require extensive testing with various SD card sizes (low ones are of special interest).

Mostly I wanted a standalone library (trust me if I knew how to do it I would) also I wouldn't want/need full functionality... Basically I would want the ability to copy raw data from point A to point B with a few variables (namely seek, skip, count and bs (block size) though that may be all of the function anyways...) Because you have no clue how useful that could be... On a side note @xerpi's Linux port is getting more mature, at the very least I could probably make some emuNAND formating scripts with it... Since that could have fully fledged dd, parted and whatever other commands I could want to make a nice script :)
Normatts SDMMC library (included in Decrypt9, too) already does that (or provides the base functions. The minimum block size is 512 byte. Check out the NAND reading/writing functions in nand.c to better understand it.
 
I'll think that over, but about the filenames... FunkyCIA takes a parameter for the ticket.db name, I think. 3DS Multi Decryptor - there should be no more reason to use that (or is there?). EmuNAND, yup, you are correct, but I think it's somewhat of a fault that the tool won't allow you to select the NAND image....

(My username was changed to Datalogger today)


Multi3DS Decryptor is still very useful for making both .CIA and .3DS from eShop Games/Videos/Demos/Updates (Updates in .CIA only)
FunkyCIA2 only makes .CIA.

Both are useful;
Funky, if you want to set DLC to turn on all options or to set Demos to Unlimited use.
Multi, if you want to preserve the content as close to original for preservation projects or to make one-shot .3DS files from purchased eShop games.

As far as the input files, yes they can be changed but all of the instructions and a lot of end-user scripts are based off using the original names of the .db files from the .3DS
(This is more of a nuisance than a true problem.)

-dl
 
Last edited by Datalogger,
  • Like
Reactions: Uiharu
Is this supported by ninjhax 2.5? Somehow I can never get it to load with 2.5 but it loads and decrypts fine on 1.1. 2.5 version coming soon? It's tiresome to keep renaming my boot.3dsx to create xorpads since I have auto boot setup for normal use.

More specifically, on 2.5 it doesn't crash my system but it tries to load (goes through colored screens) and then back to homebrew launcher, no error messages at all.
 
Last edited by ayanekochan,
Is this supported by ninjhax 2.5? Somehow I can never get it to load with 2.5 but it loads and decrypts fine on 1.1. 2.5 version coming soon? It's tiresome to keep renaming my boot.3dsx to create xorpads since I have auto boot setup for normal use.

More specifically, on 2.5 it doesn't crash my system but it tries to load (goes through colored screens) and then back to homebrew launcher, no error messages at all.
Have you tried from ctrbootmanager? Not sure if you can load that directly from CN, but you can use CN to install menuhax. And you are loading from 9.2 or below sysnand, correct? It will never work on emunand if your CFW is using Firmlaunch and/or above 9.2.
 
Is this supported by ninjhax 2.5? Somehow I can never get it to load with 2.5 but it loads and decrypts fine on 1.1. 2.5 version coming soon? It's tiresome to keep renaming my boot.3dsx to create xorpads since I have auto boot setup for normal use.

More specifically, on 2.5 it doesn't crash my system but it tries to load (goes through colored screens) and then back to homebrew launcher, no error messages at all.
I launch Decrypt9(WIP) on my N3DS 9.0 and my O3DS 9.2. using 2.5 Menuhax/CtrBootManager and it's been a 98% success rate.
 
Last edited by Datalogger,
Is this supported by ninjhax 2.5? Somehow I can never get it to load with 2.5 but it loads and decrypts fine on 1.1. 2.5 version coming soon? It's tiresome to keep renaming my boot.3dsx to create xorpads since I have auto boot setup for normal use.

More specifically, on 2.5 it doesn't crash my system but it tries to load (goes through colored screens) and then back to homebrew launcher, no error messages at all.
Make sure you download my version (see the opening post for the link).

(My username was changed to Datalogger today)

Multi3DS Decryptor is still very useful for making both .CIA and .3DS from eShop Games/Videos/Demos/Updates (Updates in .CIA only)
FunkyCIA2 only makes .CIA.

Both are useful;
Funky, if you want to set DLC to turn on all options or to set Demos to Unlimited use.
Multi, if you want to preserve the content as close to original for preservation projects or to make one-shot .3DS files from purchased eShop games.

As far as the input files, yes they can be changed but all of the instructions and a lot of end-user scripts are based off using the original names of the .db files from the .3DS
(This is more of a nuisance than a true problem.)

-dl
Changed username, quite confusing :). Anyways, what can 3DS Multi Decryptor do that Decrypt9 can't at this point? If there still is something, I'd be interested in adding that feature to Decrypt9.
 
Alright, I've just readded the experimental SD formatter feature. You need to compile yourself, and the SD formatter itself won't clone the SysNAND to the EmuNAND. Everything looks fine when using this on a 3DS, however, Windows complains about errors in the formatted SD card (although it should be totally fine). No idea about that yet... Maybe you'll find something.
 
  • Like
Reactions: dark_samus3

Site & Scene News

Popular threads in this forum