Thanks, by the way, could this offset value support hex input as well(eg: 0x10C). Because most of the time when we looking at the hex data, we use hex offset!
Thanks once again!
The Forum is up for sale: XeNTaX Forum looking for new owner
zlib unpacker [Request]
-
Rheini
- Moderator
- Posts: 652
- Joined: Wed Oct 18, 2006 9:48 pm
- Location: Germany
- Has thanked: 19 times
- Been thanked: 46 times
- Contact:
Re: zlib unpacker [Request]
The idea isn't bad, but I won't implement that (maybe later) since every good hex editor provides both hex and decimal offsets, furthermore this version of the tool is meant to be also used in automatic processing.
Might take some time til it's finished since I'm completely rewriting the tool in another programming language (D)
I still have some file scanner code lying around here, another possible feature would be an automatic extraction of all zlibbed files contained in an archive. But this is just a thought atm
Might take some time til it's finished since I'm completely rewriting the tool in another programming language (D)
I still have some file scanner code lying around here, another possible feature would be an automatic extraction of all zlibbed files contained in an archive. But this is just a thought atm
- asmxtx
- veteran
- Posts: 127
- Joined: Sun Jun 08, 2008 10:32 pm
- Location: Developers Country
- Has thanked: 1 time
- Been thanked: 30 times
Re: zlib unpacker [Request]
Here is a command line unpacker for ZLIB compressed data files.
Syntax:
compr_file: Container file which consists of jointed ZLIB data streams. Must be given on the command line.
decompr_file: Name of the decompressed file. Optional.
offset: Offset within compr_file where the ZLIB stream starts. Optional.
Example:
Extracts the first ZLIB stream at offset 0 from DATA.DAT and names it DATA.DXX.
Extracts the ZLIB stream from offset 0x11 (11hex, 17dez) from DATA.DAT and names it DATA.DXX.
Extracts the first ZLIB stream at offset 0 from DATA.DAT and names it EXTR.ZLB.
Extracts the ZLIB stream from offset 0x111 (273dec) from DATA.DAT and names it EXTR.ZLB
Error codes: 0 - OK
1 - wrong parameters
2 - error opening input file
3 - error opening output file
4 - error ZLIB-initialization
5 - error during decompression
6 - error writing destination file
7 - given offset not in file range
(updated Sep 29, 2008)
Syntax:
Code: Select all
INFLATE <compr_file> [decompr_file | [0x]offset [decompr_file]]decompr_file: Name of the decompressed file. Optional.
offset: Offset within compr_file where the ZLIB stream starts. Optional.
Example:
Code: Select all
INFLATE data.datCode: Select all
INFLATE data.dat 17Code: Select all
INFLATE data.dat extr.zlbCode: Select all
INFLATE data.dat 0x111 extr.zlbError codes: 0 - OK
1 - wrong parameters
2 - error opening input file
3 - error opening output file
4 - error ZLIB-initialization
5 - error during decompression
6 - error writing destination file
7 - given offset not in file range
(updated Sep 29, 2008)
You do not have the required permissions to view the files attached to this post.
Last edited by asmxtx on Mon Sep 29, 2008 4:55 am, edited 1 time in total.
-
fatduck
- mega-veteran

- Posts: 315
- Joined: Wed Aug 02, 2006 10:07 pm
- Has thanked: 10 times
- Been thanked: 94 times
Re: zlib unpacker [Request]
Hi asmxtx, I found a little problem with your tool here!
If I set the offset to 0x08, your tool won't deflate the file. But when I cut out the first 8 bytes and deflate with your tool, it works, it works!(even thought it said data error)
And I yes, I can use other tools (like zlibc, offzip) to deflate it without error!
If I set the offset to 0x08, your tool won't deflate the file. But when I cut out the first 8 bytes and deflate with your tool, it works, it works!(even thought it said data error)
And I yes, I can use other tools (like zlibc, offzip) to deflate it without error!
You do not have the required permissions to view the files attached to this post.
No more Fatduck, no more FatImporter, Byebye everyone!
- asmxtx
- veteran
- Posts: 127
- Joined: Sun Jun 08, 2008 10:32 pm
- Location: Developers Country
- Has thanked: 1 time
- Been thanked: 30 times
Re: zlib unpacker [Request]
The problem should be solved now.
I didn't subtract the offset from the input size. This let ZLIB read random data beyond the input buffer if the compressed source was a not terminated stream like in your file. (Download link updated.)
I didn't subtract the offset from the input size. This let ZLIB read random data beyond the input buffer if the compressed source was a not terminated stream like in your file. (Download link updated.)
Re: zlib unpacker [Request]
Last edited by deve on Tue Jun 09, 2009 1:12 pm, edited 1 time in total.
-
Rheini
- Moderator
- Posts: 652
- Joined: Wed Oct 18, 2006 9:48 pm
- Location: Germany
- Has thanked: 19 times
- Been thanked: 46 times
- Contact:
Re: zlib unpacker [Request]
zlibc is not meant to be an archiver.
It is designed to de-/compress raw zlib streams.
It is designed to de-/compress raw zlib streams.
Re: zlib unpacker [Request]
@ Rheini : Thank you for your tool, it saved up my time.
Thanks to others who share their ideas here too.
Thanks to others who share their ideas here too.
