hbc/pywii/pywii-tools/tmdfix.py

19 lines
313 B
Python
Raw Normal View History

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()
tmdfile = sys.argv[1]
2021-03-17 15:53:31 +01:00
print("TMD file %s:"%tmdfile)
2016-11-23 06:35:12 +01:00
tmd = wii.WiiTmd(open(tmdfile, "rb").read())
tmd.null_signature()
tmd.brute_sha()
tmd.update()
tmd.parse()
tmd.showinfo(" ")
f = open(tmdfile,"wb")
f.write(tmd.data)
f.close()