hbc/pywii/pywii-tools/partsetios.py
2016-11-30 18:57:03 +09:00

29 lines
634 B
Python
Executable File

#!/usr/bin/env python2
import sys, os, os.path
import pywii as wii
wii.loadkeys()
if len(sys.argv) != 4:
print "Usage:"
print " python %s <encrypted ISO> <partition number> <IOS version>"%sys.argv[0]
print " IOS version should be just the minor number (16, 33, etc) in decimal"
sys.exit(1)
iso_name, partno, ios = sys.argv[1:4]
partno = int(partno)
iosno = int(ios)
disc = wii.WiiDisc(iso_name)
disc.showinfo()
part = wii.WiiCachedPartition(disc, partno, cachesize=32, debug=False)
part.tmd.sys_version = 0x100000000 + iosno
part.tmd.update()
part.tmd.null_signature()
part.tmd.brute_sha()
part.updatetmd()
part.showinfo()