Hacking [Release] 3DSFAT16tool - dump/inject the fat16 partition from nand dumps

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,609
Trophies
1
XP
7,749
Country
Tuvalu
I wanted a better/faster way to extract the fat16 partition from the nand dump, so I made a python tool to do it. Opening up a hex editor and doing it like that is possible, but some hex editors are better than others and difficult to use for some people, but this tool I made is nice and easy to use.
It supports dumping and injecting it, and supports the 'normal' 3ds nand and new3ds nand.
I'm sure I could detect it automatically, but for new3ds you need to add '-n3ds' as an argument. (although this is not useful for n3ds right now because we don't have public nand access, but later it will be useful)

Naturally you need to xor the fat16 partition to make it readable, so xor is after dumping, and re-xor it before injecting.

For browsing/editing the fat16 file, instead of relying on something weird like 'WinImage' - just rename the fat16 file as '.iso', then I simply double click it and it mounts just like any other drive/volume on my computer - easy editing! I'm on mac so it is very easy for me to do. I'm not sure how easy it is to mount disks on windows...
 

Attachments

  • 3DSFAT16tool.py.zip
    943 bytes · Views: 1,714

Kakkoii

Old fart
Member
Joined
Sep 14, 2007
Messages
631
Trophies
0
XP
586
Country
Canada
For Windows users, WinCDEmu is a great tool that simply adds the functionality directly into Windows to mount ISOs and a few other formats by simply right clicking and mounting.
Or you can just open the ISO with 7Zip or Winrar, they both browse ISO files fine and can modify them.
 
  • Like
Reactions: cearp

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,609
Trophies
1
XP
7,749
Country
Tuvalu
For Windows users, WinCDEmu is a great tool that simply adds the functionality directly into Windows to mount ISOs and a few other formats by simply right clicking and mounting.
Or you can just open the ISO with 7Zip or Winrar, they both browse ISO files fine and can modify them.

i thought i read windows 7 had 'iso' support, or something like that? not sure if it does, or 8, etc. (even so it might not make it writeable etc, on mac at least it treats it just like a flash drive/etc)
i remember when i used to use daemon tools etc, but that many many years ago :)
 

Kakkoii

Old fart
Member
Joined
Sep 14, 2007
Messages
631
Trophies
0
XP
586
Country
Canada
i thought i read windows 7 had 'iso' support, or something like that? not sure if it does, or 8, etc. (even so it might not make it writeable etc, on mac at least it treats it just like a flash drive/etc)
i remember when i used to use daemon tools etc, but that many many years ago :)

Yeah that would be Windows 8 hehe. And I am glad to be rid of Daemon Tools... it funked with system files too much and took up active resources.
 
  • Like
Reactions: Margen67 and cearp

mvmiranda

Well-Known Member
Member
Joined
Oct 29, 2013
Messages
1,442
Trophies
0
Age
40
Location
Brazil, Sao Paulo
Website
www.gamemod.com.br
XP
1,445
Country
Brazil
using Python 2.7.9 for windows I get one error:

\3DSFAT16tool>python 3DSFAT16tool.py -d emuNAND_94_Based_on_4.5.bin emuNAND_94_Based_on_4.5_FAT16.bin
*******
3DSFAT16tool
*******

Dumping... please wait
Traceback (most recent call last):
File "3DSFAT16tool.py", line 57, in <module>
fat16 = nand[start:end]
MemoryError

\3DSFAT16tool>
 

mid-kid

GBAtemp spamBOT
Member
Joined
Aug 2, 2012
Messages
879
Trophies
0
Age
24
XP
1,152
Country
using Python 2.7.9 for windows I get one error:

\3DSFAT16tool>python 3DSFAT16tool.py -d emuNAND_94_Based_on_4.5.bin emuNAND_94_Based_on_4.5_FAT16.bin
*******
3DSFAT16tool
*******

Dumping... please wait
Traceback (most recent call last):
File "3DSFAT16tool.py", line 57, in <module>
fat16 = nand[start:end]
MemoryError

\3DSFAT16tool>

MemoryError usually means you lack RAM.
 

Dartz150

Yet another Onii-chan
Member
Joined
May 5, 2010
Messages
2,241
Trophies
1
Age
30
Location
Over your head
XP
3,981
Country
Mexico
So the step of the another tutorial where I need to copy and paste the content of test.bin to emuNAND.bin with the hex editor, is basically this? I[f so, it should be replaced in the tutorial as well, that copy/paste was a pain in the ass for me.
 

mvmiranda

Well-Known Member
Member
Joined
Oct 29, 2013
Messages
1,442
Trophies
0
Age
40
Location
Brazil, Sao Paulo
Website
www.gamemod.com.br
XP
1,445
Country
Brazil
It should be, for me it works with my 2gb (I'm on linux tho).
Try running it again, MemoryError is a weird error.
BTW: Are you running python 64bit?

Hmmm, nope...
It's 32bits... That's probably the issue here.

Changed to Python 2.7.9 64bits and it worked.
 

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,609
Trophies
1
XP
7,749
Country
Tuvalu
yeah, i was wondering about there being any issues, i was not sure if the whole file would be loaded into ram, and if i should do it in chunks, but, i think it is ok how it is.
there is probably a nicer way to do it, but as you can see from the python code, it is simple and basic :) -- and it works :)

So the step of the another tutorial where I need to copy and paste the content of test.bin to emuNAND.bin with the hex editor, is basically this? I[f so, it should be replaced in the tutorial as well, that copy/paste was a pain in the ass for me.
yes, i hated that part too :) this does it for you.
i could have added the xor process to this too, but, at least for now i will keep it separate.
 
  • Like
Reactions: Dartz150

Codename

GREEN BRO IS BEST BRO
Member
Joined
Feb 21, 2012
Messages
365
Trophies
0
XP
243
Country
Canada
This looks interesting... I suppose it could be used to modify the EmuNAND filesystem? Could we do that without having an actual 3DS flashcart? I'm using 4.2 SysNAND, which I downgraded to using Gateway's downgrading files, and 9.4 EmuNAND using the MT-Card Launcher. What exactly could I modify with this tool?
 

cearp

瓜老外
OP
Developer
Joined
May 26, 2008
Messages
8,609
Trophies
1
XP
7,749
Country
Tuvalu
This looks interesting... I suppose it could be used to modify the EmuNAND filesystem? Could we do that without having an actual 3DS flashcart? I'm using 4.2 SysNAND, which I downgraded to using Gateway's downgrading files, and 9.4 EmuNAND using the MT-Card Launcher. What exactly could I modify with this tool?

this tool just gets out the fat16 parition from the nand. if you can xor it to unencrypt it (and re-xor it to re-encrypt it when you want to write it back) - you can edit your nand.
yes you can do this without gw. sysnand or emunand, it doesn't matter.
 
  • Like
Reactions: Codename

Codename

GREEN BRO IS BEST BRO
Member
Joined
Feb 21, 2012
Messages
365
Trophies
0
XP
243
Country
Canada
Just wondering, my fat16 partition is 757 mb out of my 943 mb EmuNAND partition. What's the other ~200 mb of EmuNAND partition? Anything interesting?
 
General chit-chat
Help Users
    Panzer_Baboon @ Panzer_Baboon: Hey pals.