mirror of
https://github.com/fail0verflow/hbc.git
synced 2024-11-04 17:15:13 +01:00
24 lines
445 B
Python
24 lines
445 B
Python
|
#!/usr/bin/env python
|
||
|
|
||
|
import sys, os, os.path
|
||
|
import pywii as wii
|
||
|
|
||
|
wii.loadkeys()
|
||
|
|
||
|
args = sys.argv[1:]
|
||
|
|
||
|
tmdfile = args.pop(0)
|
||
|
|
||
|
if len(args) == 2:
|
||
|
newvers = int(args.pop(0)) << 8 | int(args.pop(0))
|
||
|
else:
|
||
|
newvers = int(args.pop(0), 16)
|
||
|
|
||
|
print "setting version of TMD file %s to 0x%04x" % (tmdfile, newvers)
|
||
|
tmd = wii.WiiTmd(open(tmdfile, "rb").read())
|
||
|
tmd.title_version = newvers
|
||
|
tmd.update()
|
||
|
f = open(tmdfile,"wb")
|
||
|
f.write(tmd.data)
|
||
|
f.close()
|