Skip to content

Instantly share code, notes, and snippets.

@foone
Created June 26, 2022 18:42
Show Gist options
  • Save foone/c1bb3d77e8f1ba622ad8718288b6fd7a to your computer and use it in GitHub Desktop.
Save foone/c1bb3d77e8f1ba622ad8718288b6fd7a to your computer and use it in GitHub Desktop.
Display indexes of archive files for Lucky's Casino Adventure
import struct,glob
def readFilename(f):
data=''
while '.' not in data:
data=data+f.read(1)
data=data+f.read(3)
return data
for path in glob.glob('GL00_*.*'):
print path
with open(path,'rb') as f:
num_files=struct.unpack('<H',f.read(2))[0]
for i in range(num_files):
data=f.read(20)
filename,size,offset=struct.unpack('<12sLL',data)
filename=filename.split('\0')[0]
print '{:<12} ({} bytes at offset {})'.format(filename,size,offset)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment