One line lzma decompressor

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

One line lzma decompressor

Post by aluigi »

Just a quick example of a feature of quickbms and, at the same time, some info about some Android games.

The following command can be used to decompress the SC and S3E files of some Android games.

Code: Select all

quickbms -s "comtype lzma_dynamic ; get SIZE asize ; get NAME basename ; clog NAME 0 SIZE SIZE" "" FILE


S3E is a sort of configuration file of the Marmalade framework, it's used in games like Shadow Fight 2 and Gunship Battle.

The SC files instead are used in the Supercell games: Clash of Clans, Hayday and Boom Beach.
It's not clear how are stored the offset and size fields for extracting the data from these archives.
NIE
Posts: 11
Joined: Mon Jan 25, 2021 3:50 pm

Re: One line lzma decompressor

Post by NIE »

But how to repack then the file extracted ? I tried by repack GuickBms but it didn't work and game didn't accept file. 7-zip showed compression method lzma:16 but I don't know what it means.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: One line lzma decompressor

Post by aluigi »

You can use a script like the following for packing the input file:

Code: Select all

comtype lzma_compress
get SIZE asize
clog "new.dat" 0 SIZE SIZE


Since lzma_dynamic automatically finds the correct lzma format, you have to specify the exact one when creating the compressed files.
This is the list of available lzma compressors:

lzma_compress
lzma_86head_compress
lzma_86dec_compress
lzma_86dechead_compress
lzma_efs_compress
lzma_0_compress
NIE
Posts: 11
Joined: Mon Jan 25, 2021 3:50 pm

Re: One line lzma decompressor

Post by NIE »

How to use this script ?
In reimport mode or just open quickbms.exe ?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: One line lzma decompressor

Post by aluigi »

Normal mode.