2021-03-17 15:53:31 +01:00
|
|
|
#!/usr/bin/env python3
|
2016-11-23 06:35:12 +01:00
|
|
|
|
|
|
|
import sys, os, os.path
|
|
|
|
import pywii as wii
|
|
|
|
|
|
|
|
wii.loadkeys()
|
|
|
|
|
|
|
|
if len(sys.argv) != 4:
|
2021-03-17 15:53:31 +01:00
|
|
|
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")
|
2016-11-23 06:35:12 +01:00
|
|
|
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()
|
|
|
|
|
|
|
|
|