What's new

Zip-files

Doomulation

?????????????????????????
I was wondering about zip-files...
Having examined them closely, I came up with the following:

Zip-files have an ending-header, a central header and a local header.

The problem I got, is that I don't know where the actual file data is. I'd need this, but I don't have an offset. Anyone has an idea how to do or where the offset is?
 
OP
Doomulation

Doomulation

?????????????????????????
I think I understand how the zip-files works now. But still, I can't get the info I want. It complains that everytime I feed the decompress-function of the zlib that the dat is incorrect (return error -3).
I've tried to increase and decrease the position where to begin read from, but it still doesn't work.
The number of bytes I read is equal to which the local header says the compressed size is.

Any idea what's wrong here?
 
OP
Doomulation

Doomulation

?????????????????????????
The Khan Artist said:
What are you trying to do? Extract one file from a zip with multiple files?
Nah, I just want the rom-header of zipped roms.
 

Hacktarux

Emulator Developer
Moderator
Maybe if you use the unzip.c and unzip.h files used for example in pj64 and 1964 you can get the infos you need (i don't know exactly what these files do).
 
OP
Doomulation

Doomulation

?????????????????????????
Hacktarux said:
Maybe if you use the unzip.c and unzip.h files used for example in pj64 and 1964 you can get the infos you need (i don't know exactly what these files do).
I'll try, thx.
 
OP
Doomulation

Doomulation

?????????????????????????
Problem is, that to me, it makes no sense. I tried to compile a DLL, but I can't call 'em from VB... :(
Another dead end...
 
OP
Doomulation

Doomulation

?????????????????????????
I've been investigating further. To me it seems, that, apparently somehow, I don't get the whole data. Since I've used other source that compress (in its own format [own header, same compression]), and it decompresses fine. I even have a dummy-file that can be decompressed. But for me it doesn't work....

Really weird, true.
I've run some experiments, but I can't get the compressed size to match winzip's, so I haven't really been able to test it fully. Also note that I have not tried not to compress it at all, which I should try soon.

EDIT: New look at my situation. I tried to leave data uncompressed, and I extracted it without problems.
From what I see, when I compress files with winzip, it won't decompress, if I however, make my own zip-file, it decompress fine, but WinZip can't decompress it. This is really weird...
 
Last edited:

Top