0

I have a ZIP archive with some photos in it. Problem is, I am not able to unzip all files from this archive.

Unzip command:

unzip archive.zip
Archive:  archive.zip
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed
mapname:  conversion of  failed

List of file inside ZIP archive (each file is without is name ...):

unzip -l archive.zip 
Archive:  archive.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
    61684  03-07-2019 10:01   
    55901  03-07-2019 10:01   
    71678  03-07-2019 10:01   
    69684  03-07-2019 10:01   
    57131  03-07-2019 10:01   
    95984  03-07-2019 10:01   
    69633  03-07-2019 10:01   
    73401  03-07-2019 10:01   
    79661  03-07-2019 10:01   
    53126  03-07-2019 10:01   
    68691  03-07-2019 10:01   
    66707  03-07-2019 10:01   
---------                     -------
   823281                     12 files

Unzip testing command:

unzip -t archive.zip 
Archive:  archive.zip
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK
    testing:                          OK

If I try pipe command of unzip, then I have one JPEG file which contains all photos of archive.

unzip -p archive.zip | cat > $(date +%s%3N).jpeg

Please, is any chance for unzip archive like this?


UPDATED

When show ZIP archive in the HEX editor, then I see archived files has not set the names. On the image is end of ZIP file, it contain informations about each files of archive. Selected Bytes on the image represent information container of one archived file.Information Bytes of one of archived file

elceka
  • 66
  • 5

1 Answers1

0

First your locale in the shell should not be ASCII, I think as simple Linux user.

locale

It could the archive's encoding. UTF-16/UTF-32 big endian springs to mind, as for ASCII letters a preceding nul byte would account for an empty string.

unzip -O UTF-16BE -l archive.zip
unzip -O UTF-16BE archive.zip

Some programming required otherwise, either patching the names or iterating through the entries and picking your own name to store every file. Java ZipInputStream would do.

I think this is the case, someone programmed to zip a directory but forgot to set the entry's file name.

Joop Eggen
  • 107,315
  • 7
  • 83
  • 138
  • Thank you. I use OSX with UTF-8. I try WinRAR inside virtual machine under Windows 7, but it is same trouble, I am not able unzip files from archive. – elceka Mar 07 '19 at 12:18
  • A normal zip file starts with two bytes "PK", the magic cookie. I see that twice (zip in zip?) You need to program. – Joop Eggen Mar 07 '19 at 12:29
  • On the image is end of the ZIP file. On the end of ZIP file is magic footer, it contain information about each files inside archive. – elceka Mar 07 '19 at 12:33
  • I would have expected a GUI tool like 7zip, WinZip, ... would be able to select an entry and save it under an other real name. – Joop Eggen Mar 07 '19 at 12:37
  • I try WinRAR, it have an option for rename file inside archive, or it can preview of file, or selective unpacking of file, but without any luck. – elceka Mar 07 '19 at 12:41