PDA

View Full Version : [Fixed] bad zip check


zkinner
09-27-2005, 02:51 AM
Hello. Sorry, if i'm repeating someone, i didn't find my problem here.

The problem is simple: zipscript in my ioBanana2 badly checks some zip-released (like 0day).

[L] 226-Zip: File is Bad!

But i know that file is good, i'm fxp'ing release from FTP where it's with [100%] tag. And i can't do anything. Every day i see 3-5 releases with that problem.

I tried ioZS check - it checks perfect, but then my sitebot will work buggy. Maybe i can update my ioBanana zipscript?

FTPServerTools
09-27-2005, 02:53 AM
The reason is simple I think, iob uses the zlib library which supports almost the complete zip standard. But deflate64 isnt supported and thus it isnt recognised and marked as bad. Check the zipfile with unzip or pkunzip and you'll see it.

zkinner
09-27-2005, 02:56 AM
But it checks some files of this release as OK. And finally i have release with 60% or 80%, but last files will be checked as BAD every time.

FTPServerTools
09-27-2005, 05:14 PM
As I said it is the deflate64. Check it with unzip or pkzip. It may be that the zip is really bad, there are soem bad zips out there as well therefor I added some zip repair routines in my FTPLogger.

Harm
09-27-2005, 05:51 PM
Actually, ioB2 is itcl based and uses unzip.exe to check the zip files' integrity.

It would be interesting to know what kind of repair mechanisms you've added to FTPLogger.. or at least what kind of bad zip files you've already encountered.

It would also be interesting to have details from zkinner. If unzip.exe says a file is corrupted, you'll need a little bit more than your word to convince me that the file is good. You could post the output of "unzip -t <zipfile>".

EwarWoo
09-27-2005, 10:40 PM
Are they all coming from the same FTP? When a disk is on its way out servers tend to start throwing out corrupt files which appear to be fine on site.
Try a different source.

zkinner
09-28-2005, 01:25 AM
I'm sure the problem is in zipscript. Before ioBanana i used ioZS and have it in /scripts/ folder. To check i just modify ioftpd.ini file and check ioZS as checker - and everything good, it comes t 100% when i refill files (coz banana deletes bad, even with delete=0 checked).

I dunno where to find unzip exe, but i'm perfectly unpacked "BAD" file with WinRAR, Total Commander and Windows internal zip-packer. Everything was OK. But this file ioBanana don't want to save and checks as bad. Only this one file of all release (one of 6).

As i see, every day about 10 releases like that. :(

FTPServerTools
09-28-2005, 03:38 AM
Hmm if it uses unzip.exe then it must go good.

Harm the bad zip files I found are the ones that have extra's added to the end of a proper zip. There is some gl code I bet that screws up zip files when it adds comments. Every now and then I see a zip file where there a complete zip file, then a new zip header then an nfo header followed by a packed nfo file. This is basically bad coding according to the zip standards, it isnt allowed. The extra zip header isnt allowed to be glued to the end of a zip.
In short:
if (((*ZipHeader & 0x0000FFFF)==0x00004B50) && (*ZipHeader!=0x04034B50)) Start+=4; //PK00
//NITROUS is using a bad zipper whcih gets recognized tho. It preadds PK00 so the header looks like PK00PK... so lets check for PK??PK..
for (DWORD i=Start;i<_msize(mem);){
zl=(struct ZipLocalFileHeader *)&mem[i];
if (zl->Signature!=0x04034B50) break; // No localfileheader
nrBytesToWrite=zl->FilenameLength+zl->ExtraFieldLength+zl->CompressedSize;
if (zl->Flags & 0x08) nrBytesToWrite+=12; //General purpose flag bit3 set -> Data descriptor follows
i+=sizeof(*zl)+nrBytesToWrite;
}
So in short that is what I do to check this.

Whether these files still come by I havent checked anymore, they get auto repaired with my FTPLogger.

And zkinner, since unzip is being used be sure to use the latest unzip and check your paths for duplicates of unzip.exe. There are older versions which do not support various of the newer zip packing types (mainly deflate64 and multi disk zipping).

zkinner
09-28-2005, 03:40 AM
Where can i find and update it? I didn't find any 'unzip.exe' on my PC.

oslike
09-28-2005, 08:14 AM
Hi all, i dont know if this post will add value to this conversation, but i remember encounting the same problem very often with ioBanana.20 too....

os

Harm
09-28-2005, 03:08 PM
Thank you for these precisions RAMRAM. I'll take some time to really understand all the possible issues with zip files.

I'm starting to think zkinner is still using ioBanana v20. This one doesn't support corrupted zip files at all. Since there's a newer version available that doesn't have this problem, v20 is pretty much unsupported now. Upgrade before going any further.

PS: Also make sure your board account is linked to your customer portal account. ioBanana v20 was only available to registered users and you don't appear as one atm.

zykes
09-28-2005, 04:52 PM
i got the same prob. uploaded 5 different rels. everyone of them got faults.

and it doesn't create any tags either :(

zkinner
09-29-2005, 04:50 AM
Ok, thanks, i already solved my problem. DZSbot + ioZS works excellent.

zykes
09-29-2005, 07:57 AM
and i am using iob2

Harm
09-29-2005, 01:40 PM
zykes: Could you define "faults" ?
Could you also paste the output of "unzip -t filename" for those files ? It would also be good to be able to see the output of SITE SHOWBANANA for these dirs and the content of the related file_id.diz files.

Edit: this problem was due to incorrect paths to the .exe files in his configuration file.