Skip to content

Instantly share code, notes, and snippets.

View deejay87's full-sized avatar
🙂

deejay87 deejay87

🙂
View GitHub Profile

Half-Life 2 on the Switch

This is a guide for running Half-Life 2 on your Switch. Please be aware that this isn't a great way of playing Half-Life 2 - do not expect this mod to work perfectly.

Thank you to Bringus Studios for fixing save files not showing up!

NOTE: I am assuming that you have basic knowledge about how modding games on the Switch works. I will not provide support for questions like "how do I install Atmosphère / CFW", "how do I make an emuMMC", "how do I extract games", etc. For help with modding your console, see the NH Switch Guide.

WARNING: While this mod should be fairly safe to use, I do not take any responsibility if your Portal save data is deleted, you get banned from Nintendo Switch Online, or if your Switch explodes.

$hactool = "$PSScriptRoot\hactool.exe"
$prodkeys = "$PSScriptRoot\prod.keys"
$firmware = "$PSScriptRoot\Firmware 10.1.0\"
$files = Get-ChildItem $firmware -Filter *.nca
$numfiles = 0
foreach ($file in $files) {
$hacout = & $hactool -k $prodkeys -i $firmware$file | Out-String
if($hacout -like '*Content Type: Meta*') {
Get-Item $firmware$file | Rename-Item -Path $firmware$file -NewName { $_.Name -replace '.nca','.cnmt.nca' }
$numfiles++
@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
@igoticecream
igoticecream / amiibo.py
Last active May 24, 2020 11:02
Retrieve all Amiibos from AmiiboApi into Emuiibo compatible files
#!/usr/bin/env python3
from pathlib import Path
import struct
import json
import random
import datetime
import re
import requests
@65c22
65c22 / tuto_resize_user_emummc.md
Last active January 26, 2020 13:26
[Tuto] Redimensionner partition USER pour emuMMC Atmosphère

Tutoriel - Redimensionner la partition USER d'un dump de NAND (pour emuMMC Atmosphère)

Introduction

Introduction:

Ce tutoriel va intéresser les amateurs de l'emuMMC intégré dernièrement au CFW Atmosphère. En effet, vous avez maintenant la possibilité sur AMS de lancer une NAND "alternatif" stockée sur votre carte SD (au lieu d'utiliser celle sur la puce mémoire de votre switch appellé sysNAND). Le redimensionnement de la partition USER (qui contient vos données utilisateur) est utile dans le cas d'un emuMMC/emuNAND pour récupérer une partie du stockage perdu (en moyenne 20Go), en effet il est inutile d'avoir un emuMMC de 32Go puisque vous installez tous vos jeux dans la SD et le dossier Nintendo.

Pour se faire nous allons avoir besoin d'un dump de NAND que vous pouvez réaliser de différentes manières (les tutoriels ne manquent pas sur le forum), j'ai personnellement utiliser la méthode Hekate. Mais à la fin vous obtenez tous les fichiers RAWNAND.bin BOOT0 et BOOT1, pour la méthode que je vais vous

#!/usr/bin/env bash
HACTOOL=./hactool.exe
UPDATES=`find . ! -name . -type d`
for updates in $UPDATES; do
updates=`basename $updates`
NCA=`find $updates -name '*.cnmt.nca'`
for nca in $NCA; do
TITLEID=`$HACTOOL -k keys.txt -t nca --listromfs $nca | grep "Title ID:" | grep 0100000000000809 | tr -s ' ' | cut -d' ' -f3`
###############################################
# TX SX Pro Custom Payload Packer - by CTCaer #
# Forked by AveSatanas to add argparse #
###############################################
import struct
import hashlib
import argparse
parser = argparse.ArgumentParser()
# The following is adapted from https://github.com/reswitched/loaders/blob/master/nxo64.py
#
# ===========================================================================================
#
# Copyright 2017 Reswitched Team
#
# Permission to use, copy, modify, and/or distribute this software for any purpose with or
# without fee is hereby granted, provided that the above copyright notice and this permission
# notice appear in all copies.
#
###############################################
# TX SX Pro Custom Payload Packer - by CTCaer #
###############################################
import struct
import hashlib
from os import unlink
"""
typedef struct boot_dat_hdr
###############################################
# TX SX OS unpacker - by hexkyz and naehrwert #
###############################################
from Crypto.Cipher import AES
from Crypto.Util import Counter
import os
import struct
"""