Skip to content

Instantly share code, notes, and snippets.

@eXhumer
eXhumer / Tinfoil-New-Index-Info.md
Last active April 5, 2024 18:59
New Tinfoil Index Information

New Tinfoil Index Information

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
@arthurzhukovski
arthurzhukovski / cctv-startup.bat
Created July 17, 2018 14:49
RTSP to HTTP with VLC (Windows)
:: 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
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;
[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'.
@nicoboss
nicoboss / Nintendo_Switch_full_keyset_1.0.0-4.1.0_sha256
Last active February 9, 2023 14:54
Nintendo Switch full keyset from firmware 1.0.0-4.1.0 binary hashed using sha256 by using digestpp::sha256().absorb(hex2ascii("")).hexdigest()
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
@roblabla
roblabla / HABILITIES.md
Last active March 14, 2024 03:24
We believe in your habilities.

Muh Switch Keys

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.

How the heck do I obtain dem keys ?

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