python2 script to unpack ZZZ files- just change path in line 5 to either main.zzz or other.zzz
import sys
import os
import struct
fd = open('main.zzz', 'rb')
def ReadEntry():
filenameLen = struct.unpack('<I', fd.read(4))[0]
filename = fd.read(filenameLen)
absPos = struct.unpack('<I', fd.read(4))[0]
flag = struct.unpack('<I', fd.read(4))[0]
fileSize = struct.unpack('<I', fd.read(4))[0]
return [filenameLen, filename, absPos, flag, fileSize]
filesCount = struct.unpack('<I', fd.read(4))[0]
entries = [ReadEntry()]
for i in range(1,filesCount):
entries += [ReadEntry()]
#print(entries[i])
for i in range(0,len(entries)):
finPath = os.path.join(os.getcwd(), 'EXPORT', entries[i][1].replace('\\', '/'))
dirPath = os.path.dirname(finPath).replace('\\', '/')
if not os.path.exists(dirPath):
os.makedirs(dirPath)
outfd = open(finPath, 'wb')
fd.seek(entries[i][2])
buffer = fd.read(entries[i][4])
outfd.write(buffer)
outfd.close()
print(finPath + " saved.")