Skip to content

Instantly share code, notes, and snippets.

View jaames's full-sized avatar
🐳
~

James jaames

🐳
~
  • UK, '97
  • 01:42 (UTC +01:00)
View GitHub Profile
@jaames
jaames / dnslog.js
Last active June 25, 2020 11:46
Crappy NodeJS DNS logger for debugging (plus response overrides!)
const dnsServer = require('dnsd');
const { Resolver } = require('dns').promises;
const overrides = [
{ name: 'game-prod.indreams.me', type: 'A', addresses: [`52.213.80.7`, `54.194.121.14`, `34.251.37.65`] }
];
const resolver = new Resolver();
resolver.setServers(['1.1.1.1']);
@jaames
jaames / saz.py
Created June 25, 2020 18:38
Redownload content from a given .saz Fiddler dump
import zipfile
import re
import urllib.request
from pathlib import Path
from sys import argv
if len(argv) < 3:
print('usage:')
print('python3 sazrip.py < input.saz > < output dir >')
exit()
@jaames
jaames / ppm_filename_checksum.py
Last active July 21, 2020 15:26
Implementation of PPM filename checksum used when Flipnotes are saved into storage
checksum_dict = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
def calc_check_digit(filename):
sumc = int(filename[0:2], 16)
for i in range(1, 16):
char = ord(filename[i])
sumc = (sumc + char) % 256
return checksum_dict[sumc % len(checksum_dict)]
def set_check_digit(filename):
@jaames
jaames / ffmpeg.js_makefile
Last active September 8, 2020 08:25
custom ffmpeg.js makefile
# Compile FFmpeg and all its dependencies to JavaScript.
# You need emsdk environment installed and activated, see:
# <https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html>.
# Modified by Jaames:
# - disable WASM output in the latest version of emscripten (1.38.31)
# - add the pad videofilter
# - add wav and pcm_s16le decoder
PRE_JS = build/pre.js
<?php
// Project Kaeru KWPCF builder
// Written by James Daniel
// github.com/jaames / rakujira.jp
// ---- USAGE ----
// create a new kaeruPrecache instance:
//
@jaames
jaames / ppm.php
Last active January 14, 2021 22:17
new php PPM metadata parser
<?php
namespace App\Formats;
class PPMParser {
protected $data = null;
protected $offset = 0;
public $header = [];
public $meta = null;
public $animationHeader = null;
@jaames
jaames / rkgParser.php
Created September 23, 2016 14:10
PHP parser for Mario Kart Wii rkg files (ghost trial data)
<?php
// ====== Mario Kart RKG (ghost trial data) Parser ======
//
// Based on the documentation found here:
// http://wiki.tockdom.com/wiki/RKG
//
// Written by James Daniel
// github.com/jaames | rakujira.jp
@jaames
jaames / gamenote.py
Last active January 25, 2021 03:02
basic decoding for 3ds game note files
import numpy as np
from PIL import Image
from sys import argv
# format structure:
# header
# 4 bytes seem to be a checksum of some kind? they're definitely not a timestamp
# 8 bytes are some kind of magic/ident? (10RC1000 for me)
# 4 bytes padding ?
@jaames
jaames / miiParser.php
Created December 12, 2016 15:48
PHP class for parsing Mii data from the Nintendo Wii
<?php
// ====== Mii Data Parser ======
//
// Based on the documentation found here:
// http://wiibrew.org/wiki/Mii_Data#Mii_format
//
// Written by James Daniel
// github.com/jaames | rakujira.jp
// ====== Usage ======
//
@jaames
jaames / commentImage.py
Created February 17, 2018 17:07
flipnote studio comment ppm (assumes one frame, single layer, black pen) -> image
#!/usr/bin/python
# Comment PPM -> NPF or Image script for Sudomemo
# github.com/Sudomemo | www.sudomemo.net
#
# Written by James Daniel
# github.com/jaames | rakujira.jp
#
# Command Line Args: