Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
import sys
import os
if len(sys.argv) != 2:
sys.exit("padfirm.py firm.bin")
filenamesplit = os.path.splitext(sys.argv[1])
filename = os.path.basename(filenamesplit[0])
#!/usr/bin/env python2
# THIS CREATES BAD CIAS - DON'T BOTHER
import binascii
import itertools
import hashlib
import math
import os
import struct
@ihaveamac
ihaveamac / cdndownload.py
Last active September 6, 2021 23:52
crappy cdn downloader
#!/usr/bin/env python3
# usage: cdndownload.py <titleid> [titlekey]
# if a system title is given for titleid, titlekey is not used
# system titles should be "legit CIAs" i.e. a stock system will install it
# unlike other cdn downloaders, this doesn't use make_cdn_cia or anything
# it downloads and saves directly to the cia, so it's faster
import base64
@ihaveamac
ihaveamac / b2bin.c
Last active July 3, 2016 00:32 — forked from SonoSooS/b2bin.c
Converts SmileBASIC .DAT files to real little-endian binary files
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
typedef unsigned long long u64;
typedef unsigned int u32;
typedef unsigned short u16;
typedef unsigned char u8;
int main(int argc, char** argv)
#!/usr/bin/env python2
# Convert 3DS errors to readable format
# plutooo // yuriks
# i added more things to it with mrrraou's help -ihaveamac
import sys
summaries = {
#!/usr/bin/env python3
import os
import shutil
import sys
helptext = """usage: firmswap.py [options]
swap FIRM partition(s) from 11.0 to 10.4 FIRM
default behavior:
- create backup of NAND.bin named NAND.bin.bak
versions = [
["0004001000020000", 0xA],
["0004001000021000", 9],
["0004001000022000", 9],
["0004001000026000", 3],
["0004001000027000", 6],
["0004001000028000", 3],
["0004003000008202", 0x1B],
["0004003000008802", 9],
["0004003000008A02", 7],
#!/usr/bin/env python2
import sys
if len(sys.argv) != 3:
print("xor.py <file> <xorpad>")
sys.exit()
encfile = open(sys.argv[1], "rb")
xorpad = open(sys.argv[2], "rb")
outfile = open("%s.out" % sys.argv[1], "wb")
@ihaveamac
ihaveamac / conv3ds.py
Last active March 16, 2018 15:20
convert .3ds to .cia with only an exheader xorpad ~ see https://github.com/ihaveamac/3dsconv
#!/usr/bin/env python2
import sys, os, binascii, math, subprocess, errno
def testcommand(cmd):
try:
proc = subprocess.Popen([cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()
return True
except OSError as e:
if e.errno != 2:
raise