So you want to decrypt switch content ? Well, the good news is that all the tools required to do that are written up! The great news is, since this is crypto we're talking about, you'll have to find the keys. Yourself. Like it's easter.
So here you can find a template of the $HOME/.switch/prod.keys file that hactool uses to decrypt content. It contains all the SHA256 and location of the keys and seeds, so you can find them yourselves.
Note that all the seeds (the keys that end with _source) are used along with the master_key_## to derive an actual key.
If you have somehow obtained the key without the seed, you can rename xxx_source to xxx_## (where ## is the master key number) and put your key there.
A lot changed in the couple last days. We now have the ability to do Fun Stuff. Here's what you need:
- A dump of your BOOT0 partition.
- Your console's SBK/TSEC key.
- A copy of your package1 and package2 files.
First, you'll want to find the keyblob_key_source, keyblob_mac_key_source and master_key_source. With those, hactool
will gain the ability to derive the package1_key and master_key (look into the keygen option), with which you can decrypt the encrypted parts of package1. RTFM on how to do that. Then, you'll want to find the package2_key_source. And finally, everything else.
Here's a quick reminder of the versions:
master_key_00: 1.0.0-2.3.0master_key_01: 3.0.0master_key_02: 3.0.1-3.0.2master_key_03: 4.0.0-4.1.0master_key_04: 5.0.0-current
Good luck with The Hunt. And remember: We believe in your habilities.
-
Q: The hashes are wrong !
A: You are computing it wrong. Hex is only a representation. Binary is truth. Because I'm such a nice guy, I'll tell you this :
SHA256(00FF00FF) = 7a7bf454c5f3cb1b9d9a20f81417f98d976fe3b3dd52c1b9968f02e89e7e8a2f -
Q: Is the order important?
A: Yes, if you don't want to use leaked keys, they are! And you don't want to use leaked keys, do you? Tsktsk.
Here's why the order is important:
keyblob_key_source,keyblob_mac_key_sourceandmaster_key_sourcegives package1_keypackage1_keyis used to decryptpackage1, which containsSecure_Monitor.bin, in which you'll find some key sources andpackage2_key_source.package2_key_sourceandmaster_keyare then used to decryptpackage2, which contains everything else.
-
Q: How do I get my console's SBK/TSEC ?
A: Take a look at fusee-launcher and biskeydump. Those two tools should give you what you want.
-
Q: How do I get my hands on the package1/package2 ?
A: Those two files are both located in the
0100000000000819.binarchive, which you can easily dump with pegaswitch. Look at the dumpArchive.js script.If pegaswitch isn't an option for you, you can also get them from a NAND backup.
package1is located at a fixed offset in BOOT0, andpackage2is at a fixed offset in BCPKG2-1-Normal-Main. Check the wiki out. You can write a script to extract those files. It's easy, I swear! -
Q: RTFM ?
A: Read The Fucking Manual.
./hactool --helpwill tell you everything else you need. -
Q: Can you just cut the chase and give me the keys ?
A: No. I enjoy watching you suffer.