#Escape_From_Paradise_City.bms endian big get offset long #offset to data or header size get flag byte #flags: 0x0 - regular, 0x02 - files selective encrypted, 0x05 - encrypted header log MEMORY_FILE 5 offset #log header
if flag == 0x05 #do decryption of header endif
get files short MEMORY_FILE for i = 1 to files get name string MEMORY_FILE get size long MEMORY_FILE
log MEMORY_FILE2 offset size if flag == 0x02 get type byte MEMORY_FILE # 0x01 - encrypted if type == 1 #do decryption of file endif endif
log name 0 size MEMORY_FILE2 math offset + size next i
It works for most part of .lfm. Only two - text.lfm & lua.lfm have encrypted header, and one - locale.lfm, have encrypted english.lcl file. Use script on that last archive and some dds's with encrypted lcl file will unpacked. I can't figure out what encryption type is used. Also in game folder have a localized english.lcl file without encryption. But for notice, it might have some differences from encrypted.
I have made a script but: - the key for Text seems wrong - Lua decrypts correctly but the last file has a wrong size, not a fault of the script - the last file of locale.lfm is encrypted but we have no key - there is a very very low chance of brute forcing the keys in some specific situation (for example when the header is encrypted)