#!/usr/bin/env nix-shell #!nix-shell -i python3 -p python3 import struct import sys import pathlib # i don't care about efficiency data = open(sys.argv[1], "rb").read() outdir = pathlib.Path(sys.argv[2]) if data[:4] != b"KTSR": raise Exception("what are you doing") # there's some more stuff but i don't care, go straight to the entry off = 0x40 idx = 0 while off < len(data): if data[off + 0x40 : off + 0x44] != b"KTSS": raise Exception("oh no offset broken") (entry_size,) = struct.unpack("