Skip to content

Instantly share code, notes, and snippets.

@parasyte parasyte/README.md Secret
Last active Aug 14, 2017

Embed
What would you like to do?
Python tools for working with N64 GameShark Pro firmware files.

Usage

$ python unzip.py <filename.in>
$ python zip.py <filename.in.hi> <filename.in.lo> <filename.out>
import sys
buf = bytearray(open(sys.argv[1], "rb").read())
open(sys.argv[1] + ".hi", "wb").write(buf[0::2])
open(sys.argv[1] + ".lo", "wb").write(buf[1::2])
import itertools
import sys
bufa = bytearray(open(sys.argv[1], "rb").read())
bufb = bytearray(open(sys.argv[2], "rb").read())
open(sys.argv[3], "wb").write(bytearray(itertools.chain(*zip(bufa, bufb))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.