ReFirmLabs / binwalk

Firmware Analysis Tool
MIT License
10.77k stars 1.54k forks source link

cupx files (ie 2 zip concatenated files) are not extracted correctly #587

Closed scls19fr closed 1 week ago

scls19fr commented 2 years ago

Hello,

not sure if that's a misunderstanding of how to use binwalk (I'm quite beginer in that kind of tools) but it doesn't extract cupx files correctly.

Steps to reproduce:

binwalk creates 4 files

$ tree _small_sample_file.cupx.extracted/
_small_sample_file.cupx.extracted/
├── 0
├── 1ABB2
├── 1ABC8
└── 1AD2D

It should in fact simply find 2 zip files (which have been simply concatenated into one).

Reference bug https://github.com/XCSoar/XCSoar/issues/795

Cupx file format description can be found at https://downloads.naviter.com/docs/SeeYou_CUPX_file_format.pdf

Foremost extracts file correctly https://github.com/XCSoar/XCSoar/issues/795#issuecomment-1008918231 but I'd prefer using binwalk as it can easily be used as Python module.

Kind regards

devttys0 commented 1 week ago

This is likely due to binwalk identifying each ZIP entry as a separate ZIP file. Binwalk v3 is much better at preventing this type of thing, and successfully reports and extracts only the two ZIP files in the cupx files you linked to:

image_2024-09-22_211857253