self extracting zipefile (windows) and (standard module) zipefile

Grant Edwards grante at visi.com
Wed Aug 29 10:22:42 EDT 2007


On 2007-08-29, Hyuga <hyugaricdeau at gmail.com> wrote:

>> I try to read (and extract) some "self extracting" zipefiles
>> on a Windows system. The standard module zipefile seems not to
>> be able to handle this. [...]
>
> First of all, there's really no such thing as a "self
> extracting zipefile".

Perhaps there isn't "really such a thing," but that's the
commonly used name for the type of file the OP is dealing with.

> [...] You'll have to execute it--there's no way you can
> operate on it like a normal zip file.

Executing the file is a huge, huge security risk.

Other zip tools (e.g. the "unzip" utility for Linux) seem know
how to work with self-extracting zipfiles.  Unfortunately there
are multiple slightly different zip formats along with mutlple
"self-extracting zip file" formats. Nonetheless, I've never run
across one I couldn't unzip without executing it.  On Linux,
I'd probably just try exec'ing the "unzip" program.  

Another option is to search through the file from the beginning
looking for whatever signature matches the beginning of a
"normal" zip file.  The self-extracting zipfiles that I've
dissected are just an executable image concatenated with a
"normal" zipfile.  If you just start searching from the
beginning of the file, it's simple to find the actual zip data
and copy it into a separate file which then can be unzipped
like any other plain zipfile.  I haven't done that for many
years since the normal zip tools that I use can operate on
self-extracting files.

-- 
Grant Edwards                   grante             Yow! NEWARK has been
                                  at               REZONED!!  DES MOINES has
                               visi.com            been REZONED!!



More information about the Python-list mailing list