Decrypting save files with 3ds-save-tool

GC64

Active Member
OP
Newcomer
Joined
Aug 6, 2017
Messages
26
Trophies
0
Age
23
XP
99
Country
United States
So I have the SD card to my old homebrewed 2DS which I don't have anymore, but am trying to get the save file to one of my games I had on there. Obviously it needs to be decrypted from the Nintendo 3DS folder, which has turned out to be a nightmare. I downloaded 3ds-save-tool, and I was able to extract my moveable.sed and get the four secret codes needed for the secrets.py file. The problem is that I know nothing about using Python, so I can't even figure out how to run the tool. All I have been able to figure out from this point is to open cmd at the tool's location, install pycryptodome, and do "python disa-extract.py". And everytime I get traceback errors:

File "C:\Users\gc64\Desktop\3ds-save-tool-master\disa-extract.py", line 288, in <module>
main()
File "C:\Users\gc64\Desktop\3ds-save-tool-master\disa-extract.py", line 96, in main
disa = open(inputPath, 'rb')

Can someone help me with the correct way to run this tool or what I might be doing wrong? At this point anything helps.
 

Eveldee

Well-Known Member
Member
Joined
Aug 16, 2019
Messages
234
Trophies
0
Age
22
XP
1,427
Country
France
Could you provide all the content of the error message? The crucial part is missing here.

From what I can see it seems that you are not specifying the filepath of the save file you want to extract. Refer to the part "Extracting save data" on their Github
 

Kwyjor

Well-Known Member
Member
Joined
May 23, 2018
Messages
4,323
Trophies
1
XP
4,454
Country
Canada
Obviously it needs to be decrypted from the Nintendo 3DS folder, which has turned out to be a nightmare.
Do you not have the complete Nintendo 3DS folder? I would suggest using ninfs to do the decryption, and then use disa-extract.py on the decrypted file.

threeSD also seems to be a useful alternative these days,

Anyway, as suggested above, you should provide more detail as to exactly what you are typing on the command line, because if you're just typing "python disa-extract.py" and nothing else, then what exactly would you expect to happen?
 

GC64

Active Member
OP
Newcomer
Joined
Aug 6, 2017
Messages
26
Trophies
0
Age
23
XP
99
Country
United States
Do you not have the complete Nintendo 3DS folder? I would suggest using ninfs to do the decryption, and then use disa-extract.py on the decrypted file.

threeSD also seems to be a useful alternative these days,

Anyway, as suggested above, you should provide more detail as to exactly what you are typing on the command line, because if you're just typing "python disa-extract.py" and nothing else, then what exactly would you expect to happen?
Could you provide all the content of the error message? The crucial part is missing here.

From what I can see it seems that you are not specifying the filepath of the save file you want to extract. Refer to the part "Extracting save data" on their Github
Sorry let me clarify a bit. I have the complete Nintendo 3DS folder but I was under the impression I could only use that to obtain my moveable.sed, which I would need for the keys to decrypt my save file. Anyway I have the complete Nintendo 3DS folder. I am using linux to run 3ds-save-tool and this is the command I am trying to run:

python3 disa-extract.py "/home/gc64/Desktop/2DS SD Card/Nintendo 3DS/25e99b6896db8339000356e285a5d656/28b201134738b956534530340002544d/title/00040000/00172800/data/00000001.sav" "/home/gc64/Desktop/2DS SD Card/Nintendo 3DS/25e99b6896db8339000356e285a5d656/28b201134738b956534530340002544d/title/00040000/00172800/data" -sd -decrypt -id 0004000000172800


This is what I get as a result:

Traceback (most recent call last):
File "/home/gc64/Desktop/3ds-save-tool-master/disa-extract.py", line 288, in <module>
main()
File "/home/gc64/Desktop/3ds-save-tool-master/disa-extract.py", line 102, in main
disa = cryptoUnwrap(disa, saveType, saveId,
File "/home/gc64/Desktop/3ds-save-tool-master/disa-extract.py", line 45, in cryptoUnwrap
return sd_decrypt.DecryptSdFile(disa, path, key)
File "/home/gc64/Desktop/3ds-save-tool-master/sd_decrypt.py", line 20, in DecryptSdFile
ctr = Counter.new(128, initial_value=(ctra << 64) | ctrb)
NameError: name 'Counter' is not defined

As you can see I have my 3DS's SD card files stored on my desktop and my input and output folder are both the same. The last 3 arguments I just did the same as on the tool's github and used the game's id.
 

Kwyjor

Well-Known Member
Member
Joined
May 23, 2018
Messages
4,323
Trophies
1
XP
4,454
Country
Canada
I have the complete Nintendo 3DS folder but I was under the impression I could only use that to obtain my moveable.sed, which I would need for the keys to decrypt my save file.
I'm not sure what gave you that idea? If you have moveable.sed and boot9.bin (which you can dump from any 3DS or even download from the Internet if you look hard enough), then you can use ninfs to decrypt the data, like I said. It will probably be much more straightforward than grappling with this; there are a lot more things that can go wrong here.

But if you want to do things this way, maybe your Python3 is not up to date? A bit of Googling suggests this isn't an unknown error – but it's hard to say if some of those results are just from people using "counter" as a generic variable name.
https://www.google.com/search?q="NameError:+name+'Counter'+is+not+defined"

You can try adding "from collections import Counter" at the top of sd_decrypt.py . If that makes the program work again, then I would suggest opening an issue at the Github.

Or you could try the save-3ds package instead; it might be more up-to-date.
 
Last edited by Kwyjor,

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
38,471
Trophies
3
XP
29,138
Country
United States
It says to decrypt the content with godmode first. I think you're trying to extract an encrypted version of the save.
 

Kwyjor

Well-Known Member
Member
Joined
May 23, 2018
Messages
4,323
Trophies
1
XP
4,454
Country
Canada
It says to decrypt the content with godmode first.
Look again. It's supposed to work with both decrypted data and encrypted data. (But in the past, assembling secrets.py has been enough of an obstacle to prevent people from using it with encrypted data. It is rather mysterious.)
 

Eveldee

Well-Known Member
Member
Joined
Aug 16, 2019
Messages
234
Trophies
0
Age
22
XP
1,427
Country
France
This error most likely comes from not having a library installed or the wrong version of it, are you sure you're using python3 too and have installed all the required dependencies? On most linux distributions you need to explicitly call python3/pip3 and not just python/pip. It may also come from an error in their code but I doubt that they didn't test it.
 

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
38,471
Trophies
3
XP
29,138
Country
United States
you may have installed that python dependency to the wrong python version. pip and pip3 will usually be associated with python3 in linux, but pip could be python2 depending. the easiest way to assure python2 is pip2, set the default to python2 to make it organized, then use python3 when needed. a lot of projects still use python2 btw, so it's handy to have both. ps4 scripts, for example, will not work with python3 or work correctly at least. to know the pip and python version type both then -V to know which one is being used with that command.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: @OctoAori20, Thank you. Hope you're in good spirits today like I am. :)