Skip to content

Instantly share code, notes, and snippets.

@NWPlayer123
Created August 12, 2017 10:00
Show Gist options
  • Save NWPlayer123/57efa2409671c83ce1ab771ec0a387ad to your computer and use it in GitHub Desktop.
Save NWPlayer123/57efa2409671c83ce1ab771ec0a387ad to your computer and use it in GitHub Desktop.
Puyo Puyo Tetris
#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