Skip to content

Instantly share code, notes, and snippets.

@foone
Created June 21, 2018 06:37
Show Gist options
  • Save foone/7453b8ac7cebd8b9dd1f7c33c226be72 to your computer and use it in GitHub Desktop.
Save foone/7453b8ac7cebd8b9dd1f7c33c226be72 to your computer and use it in GitHub Desktop.
An extractor for PCK datafiles as used by ring^-27 by TEMPERANCE LANCE
import sys
from struct import unpack
with open(sys.argv[1],'rb') as f:
if f.read(4)!='.pck':
print 'invalid header!'
sys.exit()
while True:
chunk_header=f.read(8)
if not chunk_header:
break
unk1,length = unpack('<LL',chunk_header)
print unk1,length
letters=[]
part = f.read(2)
while part != '.\0':
letters.append(part)
part=f.read(2)
letters.append('.\0')
letters.append(f.read(6))
path=''.join(letters).decode('utf-16')
print path
data=f.read(length)
with open(path,'wb') as of:
of.write(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment