[delphizip] Re: Some improvement suggestions and a SFX freeze bug

  • From: R Peters <rpeters@xxxxxxxxxxxxx>
  • To: delphizip@xxxxxxxxxxxxx
  • Date: Wed, 22 Sep 2010 18:15:00 +1000

I am out of time today but I will look in the morning - no point attempting
it with a tired mind.
Russell Peters
On Wed, Sep 22, 2010 at 9:28 AM, Daniel Marschall
<uni@xxxxxxxxxxxxxxxxxxx>wrote:

> Hello everyone,
>
> I want to report a bug inclusive solution and some improvement suggestions.
> Please excuse that my English has some flaws and that I have not much
> experience with mailing lists.
>
> I am using Turbo Delphi (2006) and Zip-Master zmstr1900102.
>
>
>
> #1 FOREIGN SFX - FREEZING BUG
>
> I found a great bug in unit ZMUtils19.pas at function CheckSFXType() which
> causes an infinite loop when an foreign SFX EXE is opened with ZipMaster.
>
> The loop does following:
>
> 1. while Result >= 0 do
> 2. Result := -7;
> 3. "if FileSeek(fileHandle, size, soFromBeginning) <> size then break;" --
> No Break since condition is false.
> 4. "if FileRead(fileHandle, hed, sizeof(T_header)) <> sizeof(T_header) then
> break;" -- No Break since condition is false.
> 5. hed.Sig is neither SFX_HEADER_SIG nor SFX_HEADER_SIG17, so "else" part
> will be executed.
> 6. Result := cstExe; // cstExe = 1
>
> ==> Since Result is now again ">= 0", the loop is infinite and the program
> will freeze if a foreign SFX is processed.
>
> Solution is to add a "Break" after "Result := cstExe;" (Line 1473).
>
> Please fix this bug and tell me if my bugfix is correct.
>
> ----------------------------------------------
>
> #2 ERRORS IN HELP FILE
>
> There are some typos and wrong formatings in the Help.
>
> One of them is at page "OnPasswordError event". The prefix of the buttons
> should be "mb" and not "pwb". (Maybe this is a leftover from an old version)
>
> Alas, I didn't found the other typos I have noticed again to write them
> down.
>
> ----------------------------------------------
>
> #3: IMPROVEMENT SUGGESTION
>
> At ZMEOC19.pas line 437 there is written:
>
> Result := EOCBadComment;  // has 'garbage'
>
> As comment for this there is written above:
>
> // Check if we really are at the end of the file, if not correct the
> File_Size
> // and give a warning. (It should be an error but we are nice.)
>
> Alas, I cannot agree with you there. Can you please provide me official
> information where the ZIP specification says that 'garbage' at the end of a
> ZIP file is illegal and should produce an error and/or a warning?
>
> This line in your code causes that ZIP-Master will output a warning message
> on SFX-Archives which are e.g. signed with Microsoft Authenticode (the
> ZIP-EOF is then not the SFX-EOF). I developed a SFX-Maker for special
> purposes (which is also compatible with Authenticode signatures) and I got
> these warning messages when I ran my SFX. Of course, I could have changed
> your source code there, but I wanted to have your "official" code compiled.
> Also I am unsure since I have no official specification which says that
> garbage after a ZIP is illegal.
>
> In my SFX, I changed the archive-comment-size and added the number of bytes
> which get added with the Authenticode signature. So, the "Archive-Comment"
> now includes the Authenticode certificate and so your program notices it as
> "clean". But well, I am against this technique. An Authenticode certificate
> should not be part of the archive comment.
>
> It would be really great if you could delete this warning, since I think
> it's absolutely useless. No ZIP program I have tested (IZArc, WinRAR,
> WinZIP, InfoZip and 7-Zip) did output a warning when I added garbage at the
> end of the central directory of a ZIP... For SFX-Developers it would be
> great if you strip this warning.
>
>
>
>
>
> I hope my suggestions are useful for you. I hope that this message arrives
> in the group and that I can reply to your answers via mail. (I had many
> troubles with mailing lists before).
>
> Regards
> Daniel Marschall
>
>
> -----------
> To unsubscribe from this list, send an empty e-mail
> message to:
>  delphizip-request@xxxxxxxxxxxxx
> and put the word unsubscribe in the subject.
>


-----------
To unsubscribe from this list, send an empty e-mail 
message to:
  delphizip-request@xxxxxxxxxxxxx 
and put the word unsubscribe in the subject.

Other related posts: