Skip to content

Instantly share code, notes, and snippets.

<?php
// tfl-decrypt.php requires PHP 8.5+
// Single-file upload + decrypt + return JSON
$privateKeyPath = '/var/www/private.pem'; // Configure this to the PEM format Tinfoil private key location (outside webroot).
// Simple HTML form when no POST
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
echo '<!doctype html><html><head><meta charset="utf-8"><title>TFL -> JSON</title><style>body {image-rendering: pixelated; background: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyBvcGFjaXR5PSIwLjIiIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDgwMCA4MDAiIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PGZpbHRlciBpZD0nbm9pc2VGaWx0ZXInPjxmZVR1cmJ1bGVuY2UgdHlwZT0nZnJhY3RhbE5vaXNlJyBiYXNlRnJlcXVlbmN5PScwLjY1JyBudW1PY3RhdmVzPSczJyBzdGl0Y2hUaWxlcz0nc3RpdGNoJyAvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPScxMDAlJyBoZWlnaHQ9JzEwMCUnIGZpbHRlcj0ndXJsKCNub2lzZUZpbHRlciknIC8+PC9zdmc+"),linear-gradient(112.1deg, rgb(16, 19, 28) 11.4%, rgb(32, 38, 60) 70.2%); color: white; font-family: "Noto Sans", sans-serif; display: flex; just
@TheExpertNoob
TheExpertNoob / CFWUpdate.md
Last active September 29, 2025 12:20
Steps to Update Nintendo Switch Custom Firmware

How to Update Switch to Latest CFW.

  1. Create a folder on your Desktop called SDCARD.
  2. Download and extract the latest Atmosphere to the folder SDCARD.
  3. Download and extract the latest Hekate to the folder SDCARD.
  4. Download and extract the latest Sys-Patch to the folder SDCARD.
  5. Search Google for THZoria firmware files. Download the one matching the supported firmare and extract to a folder called Firmware inside SDCARD.
  6. Block Ninteno Servers.
    1. Navigate to your SDCARD folder on the Desktop.
    2. Inside the atmosphere folder, create a hosts folder if it does not exist.
    3. Navigate inside this hosts folder and copy the two text files: emummc.txt and sysmmc.txt from below.
@TheExpertNoob
TheExpertNoob / indexer.php
Created June 4, 2025 03:00
Scans current directory and outputs encrypted tinfoil.tfl when called. Requires phpseclib3 and composer. Adjust to your needs.
<?php
require_once 'vendor/autoload.php';
use phpseclib3\Crypt\RSA;
use phpseclib3\Crypt\AES;
use phpseclib3\Crypt\PublicKeyLoader;
// Load Tinfoil public key
$publicPem = <<<EOD
@TheExpertNoob
TheExpertNoob / .htaccess
Created April 22, 2025 01:41
DBI 783 file hosting in a test directory.
XSendFile On
XSendFileAllowAbove On
RewriteEngine On
RewriteBase /test/
# If it's not a real file or folder, route to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]
@TheExpertNoob
TheExpertNoob / index.php
Last active October 22, 2024 00:28
Retro Rom scanner for Tinfoil.
<?php
// Configuration values
$expectedHauth = '0123456789ABCDEF0123456789ABCDEF';
$altHauth = 'FEDCBA9876543210FEDCBA9876543210';
$defaultHtml = "../index.html";
// Get HAUTH header
$hauth = $_SERVER['HTTP_HAUTH'] ?? null;
// Check if HAUTH matches expectedHauth or altHauth
Sign Key Data:
Modulus:
D8F118EF32724CA7474CB9EAB304A8A4AC99080804BF6857B843942BC7B9664985E58A9BC1009A6A8DD0EFCEFF86C85C5DE9537B192AA8C022D1F3220A50F22B65051B9EEC61B563A36F3BBA633A53F4492FCF03CCD750821B294F08DE1B6D474FA8B66A26A0833F1AAF838F0E173FFE441C56942E49838303E9B6ADD5DEE32DA1D966205D1F5E965D5B550DD4B4776EAE1B69F3A6610E51623928637576BFB0D222EF98250205C0D76A062CA5D85A9D7AA421559FF93EBF16F607C2B96E879EB51CBE97FA827EED30D4663FDED81B4B15D9FB2F50F09D1D524C1C4D8DAE851EEA7F86F30B7B8781982380634F2FB062CC6ED24613652BD6443359B58FB94AA9
Exponent:
010001
P:
FB5AA488479A690AD82994AA2D4F5F78174C8537CC7984B57ADCC6256AC3CEA72B62CDFCEBA1973DEF96C376FE3F314D3C9B55E2DC0AF343BAB6210DDD78986A25B82A6D2109981A7510ECFCC1D799675D6F93EE91614AF1C996416869AF837A65B8469BEC74D720FBB912E64B63BFCAC5C31BF873AF77EFF6B064ECA8C9AA41
Q:
DCF39F646DF38C9038E7A0361521ABAF6E2A1D0E4D569A411F9B0FE16792124DECC5653138C4A7AD45A742EAE5BC007D6643BBF83E47B6584DDC537E454D15E490495C3B650C5E2D596522AB2191CAD5BAC218D753D77D8308A31D426B72C68DBD8B05B171AAE08
@TheExpertNoob
TheExpertNoob / split.py
Last active July 19, 2024 20:25
Simple python split for fat32
import os
import sys
def split_file(input_file, chunk_size, output_folder):
# Create a folder for the split files
base_name = os.path.splitext(os.path.basename(input_file))[0]
ext_name = os.path.splitext(os.path.basename(input_file))[1]
output_folder_name = os.path.join(output_folder, f'{base_name}_split{ext_name}')
os.makedirs(output_folder_name, exist_ok=True)
@TheExpertNoob
TheExpertNoob / processMissing.py
Created April 24, 2024 04:06
My rendition of finding missing files.
import os
import re
import requests
import zstandard
import subprocess
import shutil
import time
# Directory path to search
search_directory = "/path/to/stash"
@TheExpertNoob
TheExpertNoob / PeppaPigShop.md
Created February 25, 2024 07:17
Peppa Pig Shop Generator

python3 fakeshop.py

@TheExpertNoob
TheExpertNoob / Interactive Duplication Processor by TitleID.md
Last active February 23, 2024 02:32
Interactive Duplication Processor by TitleID

Usage

pip -m install send2trash colorama python processDupesInt.py "C:/Path/to/directory"