Skip to content

Instantly share code, notes, and snippets.

@Genwald
Genwald / NFDB_crc_fixer.py
Created January 17, 2021 22:53
Quickly written script to regenerate and replace the checksums in the mii database format
from crccheck.crc import Crc16Xmodem
DBFilePath = input("path to NFDB file: ")
DBFileHandle = open(DBFilePath, mode='r+b')
deviceID = bytearray.fromhex(input("deviceID (optional): "))
crcOffset = 0x40
entry_size = 0x44
countAddr = 0x1a95
@Genwald
Genwald / MiitopiaPort.py
Last active June 23, 2021 19:34
Quick python script for importing/exporting Miis from Miitopia's save, parsing the format as little as possible
import sys, argparse
entry_count_offset = 0x2FBC
entry_count_size = 4
entry_list_offset = entry_count_offset + entry_count_size + 8
entry_size = 0x800
max_entries = 500
def read_offset(file, offset, size):
file.seek(offset)
@Genwald
Genwald / nus3volume.py
Last active September 13, 2021 14:50
python module/script for editing the volume of entries in a nus3bank file
import struct
def round_up_to_multiple(value, multiple):
mod = value%multiple
if mod == 0:
return value
return value + multiple - mod
def read_offset(file, offset, size):
file.seek(offset)