2021年7月2日星期五

Extract shsq

 

As we know the normal Magic number is 0x73717368("hsqs").

But some vendors modified the squashfs format to support LZMA, and changed the magic to 0x71736873("shsq").

But now, squashfs has already supported LZMA. Thus we can modify our binary image and let unsquashfs do its work.

  1. Open image with a hex edtor or create your own tool.
  2. Change the magic "shsq" to "hsqs" at the beginning of the image.
  3. Change compression_id(image_header[20]) from "1-GZIP" to "2-LZMA"
  4. run unsquashfs as usual.
ref:https://dr-emann.github.io/squashfs/