Skip to content

Instantly share code, notes, and snippets.

from struct import unpack as up
import sys, os, hashlib
dirs, files = None, None
def read_at(fp, off, len):
fp.seek(off)
return fp.read(len)
def read_u8(fp, off):
@SciresM
SciresM / switch_romfs.py
Created July 19, 2017 01:10
Switch RomFS (IStorage) -> Files
from struct import unpack as up
import sys, os
dirs, files = None, None
def read_at(fp, off, len):
fp.seek(off)
return fp.read(len)
def read_u8(fp, off):

State of Roblox graphics API across all platforms, with percentage deltas since EOY 2017. Updated December 17 2018

Windows

API Share
Direct3D 11+ 80% (+3%)
Direct3D 10.1 10% (-1%)
Direct3D 10.0 8% (-1%)
Direct3D 9 2% (-1%)

Using the fs-net libtransistor fork

This guide assumes you are already familliar with setting up RetroArch with libtransistor.

Clone the fs-net branch from https://github.com/davidbuchanan314/libtransistor:

git clone https://github.com/davidbuchanan314/libtransistor --recursive -b fs-net

Build libtransistor as usual.

Nintendo Switch RSA-PKCS#1 Public Key Recovery

This is a short writeup of a fun (but ultimately pretty useless) attack I implemented on the Nintendo Switch a few months ago resulting in the recovery of some otherwise unobtainable RSA public keys. Since public keys aren't private keys, this is pretty useless, apart from letting us validate some signatures on PC. Even so, the attack is a pretty cool one, so I thought I'd write it up.

Every Switch gamecart has a unique certificate (called its "CERT"), storing an RSA signature followed by some kind of unknown but unique encrypted data. I was trying to reverse how these certificates work, and the obvious first step was to try to see how they were validated. However, when I tried looking through the FileSystem (FS) module, which should be responsible for validating these certificates, I found no references to the format at all. The "CERT" magic number was nowhere to be seen, and I couldn't find an RSA modulus that validated the signatures I had. This was in

@ChristophHaag
ChristophHaag / PKGBUILD
Last active April 27, 2018 16:57
PKGBUILD mesa git for tegra
pkgname=mesa-full-tegra
pkgver=r100838.c9b153fea7
_realver=18.0
pkgrel=1
pkgdesc="Full Mesa 3D graphics library with all its components, built from the git master branch. Compiles tegra"
arch=(armv7h)
url="http://mesa3d.org/"
license=('LGPL')
depends=('libdrm' 'dri2proto' 'glproto' 'libxxf86vm' 'libxdamage' 'expat>=2.0.1' 'libxmu' 'talloc' 'llvm' 'wayland' 'libxvmc' 'python2-mako' 'libxcb')
makedepends=('pkgconfig' 'imake' 'xorg-server-devel' 'meson')
@Reisyukaku
Reisyukaku / DumpSave.js
Last active May 11, 2023 16:38
Game save dumper
var tid = '0000000000000000'; //Set appropriate game TID; Need to find a way to get TID automatically...
utils.log("stage1, hijack fsppr and set perms");
sc.getFSPPR();
sc.ipcMsg(1).sendPid().data(0).sendTo('fsp-srv').assertOk();
var pid = sc.read4(sc.ipcBufAddr, 0xC >> 2);
utils.log('Got process PID: '+pid.toString(16));
var buf1_sz = 0x1C;
@Reisyukaku
Reisyukaku / WriteSave.js
Last active May 11, 2023 16:38
Write Save
/*
* 1. Boot game
* 2. Wait a second or so (for the game tid to register but before the code mounts the savedata)
* 3. Home button
* 4. Run this script
* 5. ???
* 6. PROFIT
*/
var tid = '0000000000000000'; //Change Title ID here
@nwert
nwert / libusb.patch
Last active June 20, 2018 04:34
nxboot
diff --git a/libusb/os/linux_usbfs.h b/libusb/os/linux_usbfs.h
index 2449632..5ef03ba 100644
--- a/libusb/os/linux_usbfs.h
+++ b/libusb/os/linux_usbfs.h
@@ -82,7 +82,7 @@ struct usbfs_iso_packet_desc {
};
#define MAX_BULK_BUFFER_LENGTH 16384
-#define MAX_CTRL_BUFFER_LENGTH 4096
+#define MAX_CTRL_BUFFER_LENGTH 0xFFFF
@SciresM
SciresM / tz_5x.idc
Created April 24, 2018 01:12
IDC for the Nintendo Switch's Secure Monitor, version 5.0.0.
#define UNLOADED_FILE 1
#include <idc.idc>
static main(void)
{
// set 'loading idc file' mode
set_inf_attr(INF_GENFLAGS, INFFL_LOADIDC|get_inf_attr(INF_GENFLAGS));
GenInfo(); // various settings
Segments(); // segmentation
Enums(); // enumerations