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
Restore Health (Down + B) [NWPlayer123] | |
04004BF0 7C7F1B78 | |
04004BF4 7C9E2378 | |
04004BF8 3C60804D | |
04004BFC 3863AFD0 | |
04004C00 A0630000 | |
04004C04 28030204 | |
04004C08 40820008 | |
04004C0C 3BC00064 | |
04004C10 7FE3FB78 |
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
''' | |
GameCube .map goes like this | |
.init section layout, symbol section header w/e | |
list all symbols | |
\r\n\r\n | |
x12 w/e | |
then memory map, then linker symbols | |
so we need to extract all symbols and their section, and then print it out as specified |
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
#Python doesn't support do while, so I do "while True" -> inverse check (if var1 == 1: break) | |
from struct import unpack, pack | |
import sys | |
bits_left = 0 #0x816107EC | |
decrypt_byte = 0 | |
bytes_read = 0 | |
DAT_816107F8 = 0 | |
write_addr = 0 | |
read_addr = 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 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? |
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
''' | |
word 0 = chunk_size (read 0x10000 bytes, compress, store) | |
word 1 = num_chunks | |
word 2 = dec_size | |
table, compressed chunk size + 4 (there's a size word at the start of the section) | |
align to 0x80 | |
(write enc_chunk_size, enc_chunk, align to 0x80) * num_chunks | |
''' | |
from struct import unpack, pack |
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
#thanks Simon for being a smartie | |
#unfinished, need to parse all the tables | |
#string_offset starts at +0x20 (header) | |
from struct import unpack | |
import sys | |
sys.argv.append("files/TalkSubtitleMessage_USen.bin") | |
def read16(f): | |
return unpack("<H", f.read(2))[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
#too lazy to finish this, throwing it here | |
from struct import unpack | |
def full(f): | |
return unpack("<I", f.read(4))[0] | |
def getstr(f): | |
ret = b"";char = f.read(1) | |
while char != b"\x00": | |
ret += char |
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
#"pkzl", 0x10000, full_size, ??? | |
#4 vars in each entry, count, decsize, offset, encsize? | |
#!! pip install zstd !! | |
from struct import unpack | |
from zstd import decompress | |
from os.path import exists, splitext | |
from os import makedirs | |
import sys |
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 zlib import decompress | |
from struct import unpack | |
from os.path import exists | |
from os import makedirs | |
import sys | |
with open(sys.argv[1], "rb") as f: | |
inputname = ".".join(sys.argv[1].split(".")[:-1]) | |
assert f.read(4) == b"PSAR" | |
assert unpack("<I", f.read(4))[0] == 2 #version? |
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
import sys | |
def sanitize(line): | |
line = line.strip() | |
line = line.replace("\t", " ") | |
for i in range(5): | |
line = line.replace(" ", " ") | |
return line.split(" ") | |
name = ".".join(sys.argv[1].split(".")[:-1]) |