Repairing Corrupted ZIP Files by Brute Force Scanning in C
blog.zx2c4.com
blog.zx2c4.com
Such as that compressed archives are hard if possible at all to repair. Or, say, that the optimal encoding is a very hard problem... something that David Huffman simply didn't know when he came up with his coding algorithm.
Ideally, I guess I wouldn't read directly into a struct, though, and instead use the right functions from endian.h to make the code portable, but ah! such is life when you're scrambling to save a zip and the post-graduation nostalgia is high and the post-coffee-crash caffeination is low.
Nice to see that the fun way is the right way in this case.
Though I recommend to read the nice post, here is the direct link to the code: http://git.zx2c4.com/BruteZip/tree/read.c
(I dig the TeX-lookalike WP theme, but it should really use other @font-face formats for compatibility, e.g., WOFF and EOT; that might make it look better in other browsers.)
And here I was thinking it was just me...
EDIT: It's that 'LM Roman' font. Remove it and it will be fixed.
I really like Latin Modern/Computer Modern, just when it all goes to plan.
What would be interesting is a utility that could fix archives uploaded via FTP with ASCII mode accidentally turned on. This page claims to have a method: http://bukys.com/services/recovery/examples/