zlib / gzip解释器 [英] zlib/gzip interpreter

查看:207
本文介绍了zlib / gzip解释器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候,我试图分析与输入相比的zlib(gzip)算法的输出。确定像字典大小,子串运行长度对和在原始明文中它们对应的东西。我使用zlib交换许多非常小的数据块(每个1K以下),并且想要从字典中确定开销,一个百分比的子串匹配与字典编码的明文在结果中,这种事情。 p>

在快速搜索没有产生结果之后,我在这里询问,然后开始使用调试消息播种zlib源代码,以获得类似的结果。

$

解决方案

查看在 http://zlib.net/infgen.c.gz



从代码中的注释:

  *读取zlib,gzip或raw deflate流,并将一个代表该输入的defgen 
*兼容流写入stdout(尽管任何特定的
* zlib或gzip头信息将丢失)。这是基于puff.c
*代码来解压缩流。请注意,对于未压缩的数据(实际上未生成未压缩的
*数据),不检查zlib和gzip
* trailer - 所有检查的是拖车是
* 当下。


Greetings, I'm trying to analyze the output of the zlib(gzip) algorithm compared to the input. Determine stuff like dictionary size, the substring run-length pairs and where they correspond in the original plaintext. I'm using zlib to exchange many very small chunks of data (under 1K each), and want to determine overhead from the dictionary, a percentage of substring matches vs. dictionary-encoded plaintext in the results, that sort of thing.

After a quick googling didn't yield results, I'm asking here before I start seeding the zlib source code with debug messages to get a similar result.

Does something off-the-shelf already exist for this?

解决方案

Take a look at http://zlib.net/infgen.c.gz.

From the comments in the code:

 * Read a zlib, gzip, or raw deflate stream from stdin and write a defgen
 * compatible stream representing that input to stdout (though any specific
 * zlib or gzip header information will be lost).  This is based on the puff.c
 * code to decompress deflate streams.  Note that neither the zlib nor the gzip
 * trailer is checked against the uncompressed data (in fact the uncompressed
 * data is never generated) -- all that is checked is that the trailer is
 * present.

这篇关于zlib / gzip解释器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆