#1 2014-08-20 07:50:08

DigDiver
Member
Registered: 2013-04-29
Posts: 137

TZipRead and 64 bit

Hello to all,

I try to move my application to 64 bit architecture (Delphi XE3).

I found the problem with reading ZIP file.

constructor TZipRead.Create(BufZip: pByteArray; Size: cardinal);
...

  for i := 1 to lhr^.totalFiles do begin // totalFiles = 10
    if H^.signature+1<>$02014b51 then begin
      UnMap;
      raise ESynZipException.Create('ZIP format');
    end;
    lfhr := @BufZip[H^.localHeadOff];
    with lfhr^.fileInfo do
    if flags and (1 shl 3)<>0 then begin // crc+sizes in "data descriptor"
      if (zcrc32<>0) or (zzipSize<>0) or (zfullSize<>0) then
        raise ESynZipException.Create('ZIP extended format');
      // UnZip() will call RetrieveFileInfo()
    end else
      if (zzipSize=0) or (zfullSize=0) then
        raise ESynZipException.Create('ZIP format size=0') else // - Exception here

The zip file can be downloaded from:

https://www.dropbox.com/s/9uohm3w68urdf … _lover.zip

Offline

#2 2014-08-20 08:31:33

DigDiver
Member
Registered: 2013-04-29
Posts: 137

Re: TZipRead and 64 bit

Ups. In win32 does not works too.

Offline

#3 2014-08-20 08:33:04

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: TZipRead and 64 bit

How was this .zip created?

The local file header seems void.
Sounds incorrect, as reported by 4.4.8 and 4.4.9 of http://www.pkware.com/documents/casestudies/APPNOTE.TXT
We would provide a workaround.

Edit: sounds like if it is just a directory stored within the zip.

Offline

#4 2014-08-20 08:55:15

DigDiver
Member
Registered: 2013-04-29
Posts: 137

Re: TZipRead and 64 bit

The file was created by standalone 32 bit WinZip. In the previous version of SynZip this file unzipped successfully.

Offline

#5 2014-08-20 09:26:46

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: TZipRead and 64 bit

Yes, there was a regression when a .zip contained folders.

Should be fixed by http://synopse.info/fossil/info/b55f4a2dd6

Thanks for the feedback.

Offline

#6 2014-08-20 09:40:12

DigDiver
Member
Registered: 2013-04-29
Posts: 137

Re: TZipRead and 64 bit

Thank you so much for the patch.

Offline

Board footer

Powered by FluxBB