Skip to content

Add fallback extractor support for SquashFS extraction#936

Open
pwnpope wants to merge 1 commit intoReFirmLabs:masterfrom
pwnpope:fix/squashfs-unsquashfs-fallback
Open

Add fallback extractor support for SquashFS extraction#936
pwnpope wants to merge 1 commit intoReFirmLabs:masterfrom
pwnpope:fix/squashfs-unsquashfs-fallback

Conversation

@pwnpope
Copy link
Copy Markdown

@pwnpope pwnpope commented Feb 21, 2026

Summary

  • SquashFS extraction silently fails on systems that have unsquashfs but not sasquatch, which is the common case on most Linux distros. The extraction error is swallowed and the output directory cleaned up, so the user gets no extracted rootfs with no indication of why.
  • Adds a general-purpose fallback field to the Extractor struct, allowing any external extractor to chain alternative tools.
  • Uses this to fall back from sasquatch to unsquashfs for SquashFS extraction.
  • Fixes a pre-existing bug where carved files were not cleaned up when an external extractor command failed to launch.

Test plan

  • cargo test — all 29 tests pass
  • Tested against InHand InRouter315 firmware (SquashFS v4.0, xz, little endian) on a system without sasquatch — rootfs now extracts successfully via unsquashfs fallback
  • Should also be tested on a system with sasquatch to confirm no regression

SquashFS extraction silently fails on systems without sasquatch
installed, even when the standard unsquashfs tool is available.
This adds a general-purpose fallback mechanism to the Extractor
struct and uses it to fall back to unsquashfs when sasquatch is
not found.

Also fixes a pre-existing bug where carved files were not cleaned
up when an external extractor command failed to launch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant