Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 13:29

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: [REQUEST] Zlib block replace tool
PostPosted: 12 Jan 2010 14:39 

Joined: 31 Jan 2009 04:46
Posts: 18
I need a tool to replace the zlib block in a file.
I noticed you have made a tool PackZip 0.1.1,
but i think it just can injects the zlib block in a file.
If the new zlib block'size is small than the old one, i think no problem,
if the new zlib block'size is big than the old one,i think the application will crash.

I need a really zlib block replacer ,can you make a tool like this?
It can replace a new zlib block ,and the new file can be extract by offzip.
The file is like this:
zlib block1
zlib block2
zlib block3
...
no other thing

Thanks.


Top
 Profile  
 
 
 Post subject: Re: [REQUEST] Zlib block replace tool
PostPosted: 12 Jan 2010 14:44 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
that's the exact job of packzip
the thing about you refer of the injected zip data bigger than the original one unfortunately it's normal in the zlib library.
one of these days I should replace the usage of zlib in packzip with a better library able to compress the data better


Top
 Profile  
 
 Post subject: Re: [REQUEST] Zlib block replace tool
PostPosted: 12 Jan 2010 15:08 

Joined: 31 Jan 2009 04:46
Posts: 18
I think maybe you don't really understand what i said.
I know in some case the zip data bigger than original one.

I means is ,for example:

zlibblock1 size 500K
zlibblock2 size 100K
zlibblock3 size 500K

and i need to replace the zlibblock2 with zlibblock2a.
I think either the zlibblock2a's size is 99K or 200k,the final file size is 1100K(after use packzip).
What i need is
zlibblock1 size 500K
zlibblock2a size 200K
zlibblock3 size 500K
And i wish the final file size is 1200K.

Can you understand?sorry for my poor english.
If packzip can do it ,just tell me pls.
-----------------------------------------------
Another idea.I think maybe you can add some option to offzip like this

offzip -A -1 -OLD filename_old_zlib_block -NEW filename_new_zlib_block

if the filename_old_zlib_block be uncompressed,the tool will write the new filename_new_zlib_block into the target file.


Top
 Profile  
 
 Post subject: Re: [REQUEST] Zlib block replace tool
PostPosted: 12 Jan 2010 15:57 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
ah, now I understand what you mean.
the problem is that doing a similar thing modifies the format of the archive and so it can't be read.
anyway no, packzip doesn't allow that. it only injects the data without modifying the whole file size


Top
 Profile  
 
 Post subject: Re: [REQUEST] Zlib block replace tool
PostPosted: 12 Jan 2010 16:27 

Joined: 31 Jan 2009 04:46
Posts: 18
aluigi wrote:
ah, now I understand what you mean.
the problem is that doing a similar thing modifies the format of the archive and so it can't be read.
anyway no, packzip doesn't allow that. it only injects the data without modifying the whole file size


I konw packip doesn't allow that.
But i hope offzip can add this feature:
offzip -A -1 -OLD filename_old_zlib_block -NEW filename_new_zlib_block

I think this is not too difficult if you will do it.
Some archive be saved just zlib block by zlib block,so if i have a tools like it,
i can easily repack it.

Any way ,thanks again for your reply.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron