Created
September 25, 2019 00:52
-
-
Save NWPlayer123/6f18feb0a4ec22b888067a99741eb167 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from struct import unpack | |
from extract_nut import * | |
def full(f): | |
return unpack(">I", f.read(4))[0] | |
with open("Banner.US.bin", "rb") as f: | |
assert f.read(4) == b"WIBN" | |
f.seek(0, 2) | |
if f.tell() == 0xF0A0: #0xF0C0? | |
num_icons = 8 | |
else: | |
num_icons = 1 | |
f.seek(0x20) | |
print(f.read(0x40).decode("UTF-16-BE").rstrip("\x00")) | |
print(f.read(0x40).decode("UTF-16-BE").rstrip("\x00")) | |
color = ColorConversion() | |
tex = RGB5A3_Texture(64, 192, color) | |
tex.DecodeImage(f) | |
tex.image.save("banner.png") | |
for i in range(num_icons): | |
tex = RGB5A3_Texture(48, 48, color) | |
tex.DecodeImage(f) | |
tex.image.save("icon%d.png" % i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment