Skip to content

Instantly share code, notes, and snippets.

@spiiin
Created November 4, 2013 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spiiin/7304994 to your computer and use it in GitHub Desktop.
Save spiiin/7304994 to your computer and use it in GitHub Desktop.
def makeCorruption(inp):
f = open(inp+".nes", "rb")
d = f.read()
f.close()
r = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?'
it = 0
for x in xrange(0x10, 0x20010, 64):
cd = d[:x] + r + d[x+64:]
foname= inp+"%04d"%it+".nes"
print foname
fo = open(foname, "wb")
fo.write(cd)
fo.close()
it+=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment