import argparse import ctypes import json import sys import struct def read_string(infile, length, encoding='shift-jis'): return infile.read(length).decode(encoding).strip('\0') def write_string(outfile, input, length, fill='\0', encoding='shift-jis'): string_data = input[:length].encode(encoding) outfile.write(string_data) if len(input) < length: outfile.write("".join([fill] * (length - len(string_data))).encode(encoding)) # Cannonballers reader/writer def reader_19(infile, song_count): song_entries = [] for i in range(song_count): title = read_string(infile, 0x40) title_ascii = read_string(infile, 0x40) genre = read_string(infile, 0x40) artist = read_string(infile, 0x40) texture_title, texture_artist, texture_genre, texture_load, texture_list = struct.unpack("= CUR_STYLE_ENTRIES: outfile.write(struct.pack("