Sign in to follow this  
Followers 0
torels

Zip Header... A few questions

6 posts in this topic

Hi there

I have a few questions on how to read, modify ect a zip file's header (after the PK and 18 nul chars)

Here is some reference:

http://www.pkware.com/documents/casestudies/APPNOTE.TXT

http://www.ta7.de/txt/computer/computer016.htm

what I basicly need is to learn/understand how to manage the data in the header

i want to be able to delete files (by deleting the actual code in the file) and then modify the size part and the crc23 part of the header so the zip won't result broken

thanks in advance


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites



Hi there

I have a few questions on how to read, modify ect a zip file's header (after the PK and 18 nul chars)

Here is some reference:

http://www.pkware.com/documents/casestudies/APPNOTE.TXT

http://www.ta7.de/txt/computer/computer016.htm

what I basicly need is to learn/understand how to manage the data in the header

i want to be able to delete files (by deleting the actual code in the file) and then modify the size part and the crc23 part of the header so the zip won't result broken

thanks in advance

You are re-inventing the wheel. There are APIs to work with .zip files without trying to create your own. For example, eltorro's: Zip plugin, A plugin to add zip function to AutoIt V3

There is also a .dll interface to 7-zip, etc., etc., ...

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

weaponx had a nice code to read zip files. Link to that.

...regardless of PsaltyDS's (is this ok?) remark, I think you should go for it.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

weaponx had a nice code to read zip files. Link to that.

...regardless of PsaltyDS's (is this ok?) remark, I think you should go for it.

The code linked above does not modify the file, which is the tricky part. I believe there would be indexes and checksums elsewhere in the file that would have to updated too, or the file would just be flagged as corrupt by the usual APIs.

7-zip is open source. If this is an educational exercise (you want to learn how the other programs do it) then you should look inside that source code for an example of how it was done. In this case, examining other wheels, then re-inventing the wheel is a good thing because you learn so much about wheels in the process.

If this is a practical matter (you want to achieve this operation efficiently in an AutoIt script), then re-inventing the wheel is an absurd waste of time, because there are serviceable wheels laying around all over the place.

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Yes of course.

Wheels to learn from.

Btw, weaponx covered all available data. There is no more.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

I know of those APIs, but I wanted to do it in au3

thanks alot trancexx :D


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0