Hacking Moving EmuNAND Partition to SysNAND (Linux)

Deleted member 313057

Well-Known Member
OP
Newcomer
Joined
Aug 23, 2012
Messages
74
Trophies
0
Website
commentblock.com
XP
193
Country
United States
Hey guys,

I downgraded my 9.2 3DS to 4.2 with the Gateway Launcher.dat so I could use the profile exploit. Before the downgrade, however, I backed up my 9.2 SysNAND. I wrote that backup to an SD Card that can successfully boot up 9.2 in EmuNAND. I did lose my original NAND.bin because I broke my flashdrive, but I still have the SD Card with the partition on it. This leaves me with no other choice but to extract EmuNAND from my SD card and write it to my SysNAND in order to get back to my original 9.2 NAND.

So far, I've already extracted the 9.2 EmuNAND partition from my SD Card using these commands below.

PHP:
sudo dd if=/dev/sde of=dummy.bin count=1
sudo dd if=/dev/sde of=nand.bin count=1 skip=1931264
sudo dd if=/dev/sde of=nand.bin count=1931263 skip=1 seek=1

This should have backed up my Toshiba NAND, as the original NAND size was 943MiB (988 MB). Now, I have a nand.bin that should be close to the original 9.2 NAND that I lost on my flash drive. Again, it boots up successfully in EmuNAND, so there's no reason why this shouldn't work.

Now, my question is if I use Gateway's NAND write menu (by holding the up arrow whilst opening the downgrade menu), should the NAND.bin that I extracted work? Is there anyway that I could test the NAND.bin that I extracted using the Linux commands above so that I don't essentially brick my Nintendo 3DS? I don't have a hard-mod, and I don't want to have to pull out my soldering gun :P.

Thank you in advance,
Chris
 
  • Like
Reactions: WhoAmI?

nastys

ナースティス
Member
Joined
Aug 5, 2014
Messages
1,730
Trophies
0
Age
24
Location
Earth
XP
1,773
Country
Italy
It should work, but if you're unsure, use an Hex editor (I use wxHexEditor) and check if the sectors are correct. Check if NCSD is at offset 256 and compare the size (in bytes) with a new NAND backup: it should be the same.
The only way to test it is in emunand... which is quite pointless.


Also, dd is a GNU command or more generally, a Unix command.
 

nosklo

Well-Known Member
Newcomer
Joined
Oct 16, 2010
Messages
49
Trophies
0
XP
175
Country
Brazil
What do you want to accomplish? You want to return to 9.2? Why, if I may ask? There is not much point...
 

Deleted member 313057

Well-Known Member
OP
Newcomer
Joined
Aug 23, 2012
Messages
74
Trophies
0
Website
commentblock.com
XP
193
Country
United States
What do you want to accomplish? You want to return to 9.2? Why, if I may ask? There is not much point...

I wanted to play around a bit with Yifan's 3DS Spider Tools on the latest firmware. Also, I sort of want to jump into the whole 3DS hacking scene, as I found the buffer exploit in the 3DS browser to be quite cool, so I might play around with that.

It should work, but if you're unsure, use an Hex editor (I use wxHexEditor) and check if the sectors are correct. Check if NCSD is at offset 256 and compare the size (in bytes) with a new NAND backup: it should be the same.
The only way to test it is in emunand... which is quite pointless.


Also, dd is a GNU command or more generally, a Unix command.

Thank you for your post! I'll compare the bytes at that offset, and cross my fingers.

Edit: NCSD is at that offset. I think it should be fine. It also looks like the first 500 or so bytes are the same as my 4.2 backup. I think it's safe to assume that it's safe to use.
 

VerseHell

Well-Known Member
Member
Joined
Jun 29, 2014
Messages
3,070
Trophies
0
Age
28
XP
1,563
Country
France
Be careful, it worked for the op because he injected his own nand into the emunand, but it can brick your console if you do that with an emunand updated in gw mode.
 

Deleted member 313057

Well-Known Member
OP
Newcomer
Joined
Aug 23, 2012
Messages
74
Trophies
0
Website
commentblock.com
XP
193
Country
United States
yep, that would be great!
F yes! That would be fantastic :)


Not sure if this is thread-worthy, so I'll post it here. Feel free to make it into a thread if you choose.

This is a short tutorial on how to write your EmuNAND partition to your SysNAND safely without the hardmod. You would want to do this if you want to revert back to your original NAND you used when you backed up your SysNAND partition. This could also be used in many other instances, but I do not want to give you other ideas as this could potentially brick your console.

Please, do not use a CFW. I haven't tested it yet, but I would assume that it won't work in writing to the SysNAND. Even then, you wouldn't be able to launch any CIA software because it isn't signed by Nintendo. The CFW does not write the block to the signature checks inside the EmuNAND partition.


Prerequisite
Before doing anything, backup your SysNAND. In case of a failure, you need to have your current NAND updated so that we can revert to it using the hardmod in case of
a failure. If you brick your 3DS, I am not responsible for it, although the chances are slim that it will happen. Even if you do brick it, you will have a backup
handy and can install a hardmod to which you can use to revert your NAND.

The first thing you need to do is put Gateway's Launcher.dat on your SD Card. If you've gone this far, then I am sure you know how to do that by now. If you are on a firmware
greater than 4.5, launch the web exploit by going to http://go.gateway-3ds.com. If not, go to your Settings and launch the profile exploit. Then, backup your System NAND by going to the menu option stating "Backup System NAND".
Linux
To do this in linux, the first thing you need to do is insert your SD Card that contains your EmuNAND partition. I am currently on the Ubuntu distrubtion, so the process may be a
bit different on your distro, but the commands will be the same. If you're on a debian-based operating system, like Ubuntu, do these commands to install
WxHexEditor. On a different machine, install it some other way.

sudo apt-get update
sudo apt-get install wxhexeditor

After installing, we need to do some things in the terminal which will read the EmuNAND partition from your SD Card. To begin this process, we need to mount the SD card. We first need to locate the SD card and mount it in terminal to a folder.

sudo lsblk

Jot down the partition name and the mounted folder name.

You now need to know the exact size of your NAND in bytes. Do not mess this number up, else your NAND could be bricked. Earlier, I asked to backup your NAND. You need this backup to get the size of your actual NAND partition.

wc -c /media/sdcard/

Compare this number with these.
If it is 988807168, your NAND is a Toshiba NAND. Write down 1931264. This is your amount of sectors.
If it is 1000341504, your NAND is a Samsung NAND. Write down 1953792. This is your amount of sectors.

We now need to use this number to read the NAND partition. Create a new directory in your home folder, or anywhere else on your computer that you feel is safe.

mkdir NAND

Now, let's read in the NAND.

sudo dd if=/dev/sdX of=dummy.bin count=1
sudo dd if=/dev/sdX of=NAND.bin count=1 seek=SECTORSIZE
sudo dd if=/dev/sdX of=NAND.bin count=SECTORSIZE skip=1 seek=1

We now have a NAND.bin extracted from EmuNAND. Now, we need to actually check to see if it's valid.

To do this, open up WxHexEditor from earlier. Drag and drop your NAND.bin into the editor, and check to see if it is valid. You can do this by looking at offset 256 in the editor and checking to see if it equals NCSD. Even if you don't know how to use a hex editor, if you see NCSD on the ASCII panel, you're good to go. Just make sure that it's at the offset.


Now, move the NAND.bin from your SD card to somewhere safe, and place your new NAND.bin on the root of your SD Card. Make sure the size of the NAND.bin on your SD Card matches the size of your backup!

Now, move on to the final step.
Windows
First, download EmuNAND tool. You can find it here: https://gbatemp.net/threads/emunand-tool-release-and-support-thread.359239/

Press Extract EmuNAND and save the NAND.bin to your desktop or some place safe. Make sure that the size is valid. It should either be 943 MB or 954 MB.

Now, simply save your NAND.bin to the root of your SD Card.

Now move on to the final step.
Final Step
Turn on your 3DS. Launch the profile exploit or the web exploit as stated earlier. Scroll to the far right, and press 'A' on downgrade while holding the up arrow key. Then, start the NAND write process. Your console may be bricked if you turn off your 3DS while it's writing, or if you eject the SD card. I take no responsibility for you breaking your 3DS, and nor does Nintendo! This is all up to you.
Thank you for reading this tutorial.
 
General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: Beautiful day cool air and feeling great!