Offset | Size | Description |
---|---|---|
0x0 | 0x7 | Tinfoil Index Magic "TINFOIL" |
0x7 | 0x1 | Index Type Information (1) |
0x8 | 0x100 | Session Key (PKCS#1 OAEP encrypted randomly generated AES Key used to encrypt index) (2) |
0x108 | 0x8 | Unencrypted Index Size |
0x110 | X | Index Data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set /p ID=Ingresa el ID (SAME control.xml!!)(Example: 0100444444440000) : | |
Tools\hacpack.exe -k "%userprofile%\.switch\prod.keys" -o "%temp%\NCA" --titleid %ID% --type nca --ncatype program --exefsdir "E:\Switch\NSO\SNESNSO\USA-EUR\exefs" --romfsdir "E:\Switch\NSO\SNESNSO\USA-EUR\romfs" --logodir "Files\logo" | |
Tools\hacpack.exe -k "%userprofile%\.switch\prod.keys" -o "%temp%\NCA" --titleid %ID% --type nca --ncatype control --romfsdir "Files\control" | |
forfiles /P "%temp%\NCA" /M * /C "cmd /c if @fsize GEQ 20000000 echo @path > "%temp%\largefiles.txt" | |
set /p largefiles=<"%temp%\largefiles.txt" | |
forfiles /P "%temp%\NCA" /M * /C "cmd /c if @fsize LEQ 500000 echo @path > "%temp%\smalledfiles.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN RSA PRIVATE KEY----- | |
MIIEowIBAAKCAQEAnjCTLhNi8UHdEUlXMMI//LO/TsulwLwfidD3Jey3EWIfHVfm | |
s9qE1IBCLl1X0Mb8TNJxFM26sREKnn13+W2MI8L11T8S1jse2c50Zqp5fg7/qwgM | |
1N/tM6jTU9tmX5SKM0zbLzBhFkTjXvFy67NDurNZLm8i/XBFKbLTNLu5wUSI6AIG | |
0vhBzFDILhCSHucPKk+JrFNbik+qeNd9wzTTzIhs2xcBlUzkyBQf64wgmsouZ+1q | |
HBlHDJDoMnM/LVUSELlq/TPK3QPUspCadgTxqbdqhXycSfshi/1VSxDWkD6Y4FUf | |
HbRsmn1fLKa/lw0nDZQR0I2nwnrxMUSAEEaGRQIDAQABAoIBAAxSyWx5+yfDU0cA | |
+SdlwplboWgwijmhDi3s1wwfzEUw6S6ehez19Yoecclt4ST1E3uim0edHVGk+7hM | |
GvgV9ihlDESwFLYWxfj+0eebmTpeTcGTr3g396EiIlByk5+XkUqczqh28uFKvZHM | |
aoD9JqYZSbXJ16Z5xBGTCkwd4cMyBagHuZ9v3yCgigTIIM/vsggAVYTyZmxvmbFy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: The following line is neccessary if you need an ability to restart the streams with this batch file | |
:: Kill all existing streams (the command actually suspends ALL the vlc processes): | |
taskkill /f /im "vlc.exe" | |
:: Run two instances of VLC. These would transcode MP4 rtsp-stream to Motion JPEG http-stream: | |
start vlc -vvv -Idummy rtsp://login:password@192.168.0.2/streaming/channels/2/preview --sout #transcode{vcodec=MJPG,venc=ffmpeg{strict=1},fps=10,width=640,height=360}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:9911/} | |
start vlc -vvv -Idummy rtsp://login:password@192.168.0.3/streaming/channels/2/preview --sout #transcode{vcodec=MJPG,venc=ffmpeg{strict=1},fps=10,width=640,height=360}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:9912/} | |
:: In order to execute VLC with `vlc` as in exapmle above, you have to add corresponding value to the PATH variable. | |
:: Otherwise you have t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Crypto.Cipher import AES | |
from Crypto.Util import Counter | |
import struct | |
""" | |
typedef struct boot_dat_hdr | |
{ | |
unsigned char ident[0x10]; | |
unsigned char sha2_s2[0x20]; | |
unsigned int s2_dst; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Patched Kernel] | |
kernel=kernel.bin | |
[Patched SecureMonitor] | |
secmon=secmon.bin | |
[Injected KIP1] | |
kip1=sysmodule.kip1 | |
# You can mix options in the individual sections, possible are 'warmboot', 'secmon', 'kernel', 'kip1'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Leaked Keys: | |
============ | |
sha256(master_key_00) = 0EE359BE3C864BB0782E1D70A718A0342C551EED28C369754F9C4F691BECF7CA | |
sha256(master_key_01) = 4FE707B7E4ABDAF727C894AAF13B1351BFE2AC90D875F73B2E20FA94B9CC661E | |
sha256(master_key_02) = 79277C0237A2252EC3DFAC1F7C359C2B3D121E9DB15BB9AB4C2B4408D2F3AE09 | |
sha256(master_key_03) = 4F36C565D13325F65EE134073C6A578FFCB0008E02D69400836844EAB7432754 | |
sha256(package1_key_00) = 4543CD1B7CAD7EE0466A3DE2086A0EF923805DCEA6C741541CDDB14F54F97B40 | |
sha256(package1_key_01) = 4A11DA019D26470C9B805F1721364830DC0096DD66EAC453B0D14455E5AF5CF8 | |
sha256(package1_key_02) = CCA867360B3318246FBF0B8A86473176ED486DFE229772B941A02E84D50A3155 |
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import binascii, sys, random, asn1 | |
from fractions import gcd | |
def extended_gcd(aa, bb): | |
lastremainder, remainder = abs(aa), abs(bb) | |
x, lastx, y, lasty = 0, 1, 1, 0 | |
while remainder: | |
lastremainder, (quotient, remainder) = remainder, divmod(lastremainder, remainder) | |
x, lastx = lastx - quotient*x, x | |
y, lasty = lasty - quotient*y, y |