""" Summoner .VPP files unpacker Written by Dmitry Jemerov in April 2001 and released to the public domain. Usage: unvpp filename """ import sys,struct def read_long (f): buf = f.read (4) (result,) = struct.unpack ("l", buf) return result def main(): if len (sys.argv) < 2: print 'Usage: unvpp filename' return vpp = open (sys.argv [1], "rb") vpp.seek (8) fileCount = read_long (vpp) vpp.seek (0x800) files = [] for fileIndex in xrange (fileCount): fileName = vpp.read (60) i = 0 while i < 60 and fileName [i] != chr (0): i += 1 fileName = fileName [0:i] fileSize = read_long (vpp) files.append ((fileName, fileSize)) pos = vpp.tell() / 0x800 vpp.seek ((pos + 1) * 0x800) for fileName, fileSize in files: print fileName data = vpp.read (fileSize) out = open (fileName, "wb") out.write (data) out.close() pos = vpp.tell() / 0x800 vpp.seek ((pos + 1) * 0x800) vpp.close() main()