redballoonsecurity / ofrak

OFRAK: unpack, modify, and repack binaries.
https://ofrak.com
Other
1.82k stars 128 forks source link

Fall back on `gzip` if `pigz` fails #476

Open rbs-jacob opened 3 weeks ago

rbs-jacob commented 3 weeks ago

Recent PR #472 uses Python's built-in gzip module for decompressing GZIP data if possible, and falls back on the system version of pigz if the Python version fails.

Inside of OFRAK Docker images, we can be confident that pigz is present. But when a user installs OFRAK via pip install, they may not have pigz on their system. They are, however, likely to have gzip on their system. As such, we should fall back from Python gzip to pigz to gzip to increase the likelihood that something will work for GZIP decompression.

Implementing this may involve modifying ComponentExternalTool (see this comment on #472). This may have implications for other OFRAK functionality using ComponentExternalTool.