gendx / lzma-rs

An LZMA decoder written in pure Rust
MIT License
129 stars 27 forks source link

Fail to decompress these data streams ("brcm-lzma" method?) #25

Open XVilka opened 4 years ago

XVilka commented 4 years ago

Unpacking the data, and noted that some streams can't be unpacked with lzma-rs, see the attached files of the compressed and uncompressed chunks.

lzma_alt_samples.zip

The chunks were successfully unpacked with this library instead: https://github.com/firmadyne/sasquatch/tree/master/LZMA/lzmalt

The algorithm itself seems came out of the Broadcom LZMA modification.

gendx commented 4 years ago

Could you document how standard this "Broadcom modification" is?

I won't have much time to investigate this in the following weeks, but feel free to send a pull-request to support this variant of the algorithm (preferably using a decoding option if there's something non-standard involved).

XVilka commented 4 years ago

I don't think it's a standard one, but quite common among compressed firmware images.

voltagex commented 2 years ago

@XVilka are you able to share how you decompressed these?

XVilka commented 2 years ago

@voltagex you can see the https://github.com/firmadyne/sasquatch/tree/master/LZMA/lzmalt

voltagex commented 2 years ago

@XVilka yes, this creates a library, not a program - did you write something to use this library to decompress the data?