Created
August 12, 2017 10:00
-
-
Save NWPlayer123/57efa2409671c83ce1ab771ec0a387ad to your computer and use it in GitHub Desktop.
Puyo Puyo Tetris
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
#very rough writeup, looks like: | |
# "RBIN" magic | |
# two tables, which link to strings, absolute | |
# table 1 data points to the location of table 2 data which points to strings | |
# the two counts *should* be the same | |
from struct import pack, unpack | |
import sys | |
def getstr(f): | |
ret = "";char = f.read(1) | |
while char != "\x00": | |
ret += char | |
char = f.read(1) | |
return ret | |
with open("puyo2P.narc-info", "rb") as f: | |
assert f.read(4) == b"RBIN" | |
end_section = unpack("<I", f.read(4))[0] | |
end_offset = unpack("<I", f.read(4))[0] | |
table1count = unpack("<I", f.read(4))[0] | |
table1 = [unpack("<I", f.read(4))[0] for i in range(table1count)] | |
table2count = unpack("<I", f.read(4))[0] | |
for data in table1: | |
f.seek(data) | |
offset = unpack("<I", f.read(4))[0] | |
f.seek(offset) | |
print(getstr(f)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment