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 PIL import Image | |
| import sys | |
| class ColorConversion: | |
| def __init__(self): | |
| self.Bits3To8 = self.MakeDepthConversionTable(3, 8) | |
| self.Bits8To3 = self.MakeDepthConversionTable(8, 3) | |
| self.Bits4To8 = self.MakeDepthConversionTable(4, 8) |
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 binascii import hexlify, unhexlify | |
| from io import BytesIO | |
| from Crypto.Cipher import AES | |
| import sys | |
| common_key = unhexlify("EBE42A225E8593E448D9C5457381AAF7") | |
| def decrypt_title_key(cetk): | |
| cetk.seek(0x1DC) |
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 | |
| import sys | |
| with open(sys.argv[1], "rb") as f: | |
| f.seek(0, 2) | |
| fsize = f.tell() | |
| f.seek(0, 0) | |
| data = unpack(">4I", f.read(16)) | |
| assert data[0] == 0x10 #header size | |
| with open(sys.argv[1][:-4] + ".00.app", "wb") as o: |
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
| switch = 0 | |
| if switch == 0: | |
| with open("rlwinm.txt", "wb") as o: | |
| #extlwi | |
| for n in range(1, 32): #cannot extract 0 bits | |
| for b in range(1, 32): | |
| if n != b and (n+b < 32): | |
| o.write("rlwinm %d,%d,%d\textlwi %d,%d\n" % (b, 0, n - 1, n, b)) | |
| #extrwi | |
| for n in range(1, 32): #cannot extract 0 bits |
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 PIL import Image | |
| from struct import unpack | |
| from math import ceil | |
| import sys | |
| class RGB5A3_Texture: | |
| def __init__(self, height, width, color): | |
| self.image = Image.new("RGBA", (width, height)) | |
| self.img = self.image.load() | |
| self.width = width |
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 PIL import Image | |
| from struct import unpack | |
| from math import ceil | |
| import sys | |
| class I4_Texture: | |
| def __init__(self, height, width, color): | |
| self.image = Image.new("RGB", (width, height)) | |
| self.img = self.image.load() | |
| self.width = width |
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
| # Press W, creates string there, creates align/word, renames to a non-conflicting name | |
| import idaapi, idc, inspect | |
| from io import BytesIO | |
| def get_selected_bytes(): | |
| #BOOL multiple, start, end | |
| selected = idaapi.read_selection() | |
| curr_ea = idc.get_screen_ea() | |
| return [selected, curr_ea] |
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 PIL import Image | |
| from struct import unpack | |
| from math import ceil | |
| import sys | |
| class I4_Texture: | |
| def __init__(self, height, width, color): | |
| self.image = Image.new("RGB", (width, height)) | |
| self.img = self.image.load() | |
| self.width = width |
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 os import mkdir | |
| from os.path import exists | |
| import sys | |
| def half(f): | |
| return unpack(">H", f.read(2))[0] | |
| def full(f): | |
| return unpack(">I", f.read(4))[0] |
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 os.path import exists | |
| from os import makedirs | |
| import sys | |
| def half(f): | |
| return unpack(">H", f.read(2))[0] | |
| def full(f): | |
| return unpack(">I", f.read(4))[0] |