0

Let's say there is a ZIP or RAR archive on a file sharing network, an old archive which has been out there for a long time, containing hundreds of small files (JPG pictures typically), and some parts are missing, like 20MB out of 500MB, there is no longer a single complete source and it's unlikely there will ever be, so anyone attempting to download it will get stuck with a large unusable file.

But I may have all the individual files contained in those missing parts, found in other similar archives, or acquired from another source. The goal would be to sort of “revive” such a broken archive, in a case like this where only a small part is missing, so that it can be shared again.

If an archive is stored without compression, such a process must be tedious enough, but it gets really tricky if compression is involved, as it is not possible to simply copy and paste the contents of the missing files with an hexadecimal editor, they have to first be compressed with the exact same parameters as the incomplete archive, so that the actual binary content can match.

For instance I have an incomplete ZIP file with a size of 372MB, missing 18MB. I identified a picture set contained within the missing part in another, larger archive: fortunately the timestamps seem to be exactly the same, but unfortunately the compression parameters aren't the same, the compressed sizes are different and the binary contents won't match. So I uncompressed that set, and attempted to re-compress it as ZIP using WinRAR 5.40, testing with all the available parameters, and checked if the output matched (each file should have the exact same compressed size and the same binary content when examined with the hex editor), but I couldn't get that result. So the incomplete archive was probably created with a different software and/or version, using a different compression algorithm.

Now, is it possible to know exactly, by examining the file's header, what specific application was used to create it, and with which exact parameters ? Does the hardware have any bearing on the outcome of ZIP / RAR compression, for instance if using a mono-core or multi-core CPU, or a CPU featuring or not featuring a specific set of instructions ? (In which case it would be a nigh impossible task.)

The header of the ZIP file mentioned above is as follows :

50 4B 03 04 14 00 02 00 08 00 B2 7A B3 2C 4C
5D 98 15 F1 4F 01 00 65 50 01 00 1F 00 00 00

I tried to search information about the ZIP format header structure, but so far came up with nothing conclusive with regards to what I'm looking for.

The problem seems even more complicated with RAR files, as they don't seem to have a complete index of their contents in the header or footer, if I'm not mistaken, each file is referenced only by its own header, and without the complete list of missing files it's almost certainly a fool's errand.

Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.