Created
June 26, 2022 18:42
-
-
Save foone/c1bb3d77e8f1ba622ad8718288b6fd7a to your computer and use it in GitHub Desktop.
Display indexes of archive files for Lucky's Casino Adventure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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