3ds Tinkering Seeded Crypto
3DS Tinkering, seeded crypto
Like I mentioned in my week summary for this week, I’ve been gotten into playing around with my 3DS again. I have good memories of tinkering with this device, back in the old days, installing Custom Firmware on it through Soundhax, which was the method that was available to me at the time, it was fascinating like the whole installing custom firmware on consoles mostly are for me, it feels like some black magic that you’re not allowed to do. I remember downloading a kit, with the firmware itself, and an especially crafted mp4 I think it was, and the process was rather simple, stuff files on the sd card, and then play the special media file, wait for a little bit, the screen glitches out, and a command line starts writing things on the screen, and it feels magical, after a little bit you have things installed.
As things moved on the methods got better, people started breaking more of the encryption and defends that nintendo built into the system, and I moved over to a more solid version based on boot9strap that ensures that it’s not as easily broken by starting a system update or something like it, basically the system has a deeper control of the hardware, and makes some more things possible.
Over to the now times
I hadn’t been playing with it for a couple of years, but I packed out my 3DS again, as I missed having a small system that I feel better about carrying around. And I missed the games especially made for a small system like this. Since the E-shop is not available anymore I found that the community has made an alternative, the h-store, and I downloaded some games that I wanted to play. Because of where I am, it’s a bit annoying to get close to the router, so I opted to go for downloading the files to my computer and transferring them to the 3ds over ftp, and I think this is the reason why the issues that I had afterwards occured. From what I understand if it’s done directly through the link, the store sends the seed along to fbi (the packet installer for the 3DS CFW) and you’re all set. But I can’t do things the easy way, and the whole story, and the lessons learned was worth it in the end I think.
So I install a couple of games, and everything works great, no issues at all. Until I try Shin Megami Tensei IV: Acopalypse. It goes through the painstakingly slow FTP transfer, the even longer install through FTP and the game appears on the homescreen, and yippie, I won.. Or not completely, launching the game just gives me a coredump, and the console has to be rebooted. Not happy me.
I do a bit of research, and figure out that as the 3DS was going, they were shifting a bit in their defences against people pirating the games, so it’s no longer enough to have the game, they also need a seed file with 16 bytes, that gets mixed with the title code to create a decryption key for the game. Without the correct key, no decryption, and you end up with the error that I got.
So a new adventure ensues, now I need to get the seed for my game, I have the title code already, a decently long hex string. I found that there is a file seeddb.bin that you can get, where all, or most of the seeds are, and some helpful dude had it in a github repository so I got that one. Now I’m not quite sure where this files normally go, and I kind of have the feeling that I can do something with godmode (the “bios launcher” thing for the 3ds) to install the whole thing into the system, and not have an issue with seeds again, but that’s a project for another time I think. This is a “huge” file with loads of seeds in it, but not installable directly through fbi, but another guy made an extractor that can extract single seeds from the database, and save them as files importable through fbi.
So weaponised with my new seed.dat files, back I went to FTP the 16 bytes over to my sd:/fbi/seed folder, then go into fbi, and choose SMTIV:A from the titles menu and import the seed. This went really fast (not surprisingly since it’s a tiny file) and FBI said success. I back out to the main menu and crossed my fingers, launched the game, and it worked, great success, now I have the game running, and understand a bit more about how the 3DS crypto works. Some times it really comes in handy knowing how to search and sort data on the net to find the stuff you need. And I learned some new stuff.
It’s things like this that makes tinkering fun, it’s not always a straight road, you end up with problems, often self caused, that needs to get fixed, and then you work out how to solve it, and on the way you learn some nifty stuff. This is the fun side of computing that I like, find a problem, find a solution, and learn stuff on the way.