aboutcode-org / extractcode

A mostly universal file extraction library and CLI tool to extract almost any archive in a reasonably safe way on Linux, macOS and Windows.
https://www.aboutcode.org/
31 stars 17 forks source link

Add support for smarter MSFT cab extraction #10

Open pombredanne opened 8 years ago

pombredanne commented 8 years ago

At the moment the extractcode lib extracts CAB files al-right, but does not understand the underlying structure of the files. You end up with a pile of files names after some hash or UUID and not real file names as they would be installed.

The format is more or less documented here: https://msdn.microsoft.com/en-us/library/bb417343.aspx https://github.com/n3k/PyCAB seems to implement some code to handle this in pure Python Wine has an implementation of cabarc which runs likely only under wine. cabextract is a portable, standalone extractor: http://cabextract.org.uk/

pombredanne commented 8 years ago

And there is an older lcab https://sources.archlinux.org/other/packages/lcab/

pombredanne commented 8 years ago

After some digging there is nothing that can be done. the cab format is properly extracted. Short of of actually running an installer, you cannot recreate correct paths for the extracted files.

pombredanne commented 6 years ago

Reopening to consider this https://github.com/hughsie/python-cabarchive by @hughsie to solve the problems above....

hughsie commented 3 years ago

On that, python-cabarchive is being used "in production" so to speak, so if anyone does want to add missing functionality or fix my unidiomatic python please do :)