Skip to content

Instantly share code, notes, and snippets.

View jaames's full-sized avatar
🐳
~

James Daniel jaames

🐳
~
View GitHub Profile
@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 / colors-beta-guide.md
Last active May 25, 2022 22:58
Colors Live Windows beta guide

Troubleshooting

Missing MSVCP140.dll or VCRUNTIME140.dll errors

If you get a message warning you about missing DLLs MSVCP140.dll or VCRUNTIME140.dll when starting the app, you will need to install vc_redist.x64.exe from this page: https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

Missing dcomp.dll

This will show up if you try running Colors Live on an older version of Windows. Windows 10 is the only version currently supported, however support for older versions may be added eventually.

@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 / 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 / lbp-endpoints.md
Last active June 10, 2020 20:26
Useful Little Big Planet web endpoints

Level info

Returns the level title, icon, number of plays/hearts/lists and game (...kinda) for a given level ID

GET https://lbp.me/widgets/link_magician/level/{ Level ID }

Param Values
theme default (required)
@jaames
jaames / bfttf.py
Last active March 18, 2020 21:52
Animal Crossing New Horizons font decryptor for .bfttf or .bfotf files
# Animal Crossing New Horizons font decryptor for .bfttf or .bfotf files
# Usage: python3 bfttf.py input.bfttf output.ttf
from sys import argv
# might be other keys, who knows
key = [0x49, 0x62, 0x18, 0x06]
def xor(data, key):
offset = 0
@jaames
jaames / fancy-css-links.md
Last active June 26, 2025 11:49
Fancy CSS link underlines with inline SVGs (plus embedded animations!)
@jaames
jaames / kwztile.py
Last active April 18, 2020 09:03
kwz optimisation idea
# original code:
for tile_offset_y in range(0, 240, 128):
for tile_offset_x in range(0, 320, 128):
# each large tile is made of 8 * 8 small tiles
for sub_tile_offset_y in range(0, 128, 8):
y = tile_offset_y + sub_tile_offset_y
# if the tile falls off the bottom of the frame, jump to the next large tile
if y >= 240: break
for sub_tile_offset_x in range(0, 128, 8):
<?php
class KwzParser {
protected $data = null;
protected $offset = 0;
protected $size = 0;
public $sections = [];
public $meta = null;
public $frameMeta = null;