dll 文件与 gzip 文件的比较
好吧,标题不是很清楚。
给定一个字节数组(从数据库 blob 读取),它表示 .dll 中包含的字节序列或表示该 dll 的 gzip 版本的字节序列,是否有一个(相对)简单的签名可供我查看为了区分两者?
我试图自己解决这个问题,但我发现寻求帮助可以节省很多时间。提前致谢。
Okay, the title isn't very clear.
Given a byte array (read from a database blob) that represents EITHER the sequence of bytes contained in a .dll or the sequence of bytes representing the gzip'd version of that dll, is there a (relatively) simple signature that I can look for to differentiate between the two?
I'm trying to puzzle this out on my own, but I've discovered I can save a lot of time by asking for help. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查它的前两个字节是否是
gzip
幻数0x1f8b
(请参阅 RFC 1952)。或者尝试gunzip
它,如果DLL没有gzip
'的话操作将会失败。Check if it's first two bytes are the
gzip
magic number0x1f8b
(see RFC 1952). Or just try togunzip
it, the operation will fail if the DLL is notgzip
'd.gzip
文件应该相当容易确定,因为它应该由页眉、页脚和中间的一些其他可区分元素组成。来自 维基百科:
您还可以尝试确定 gzip 是否包含任何记录/条目,因为每个记录/条目也都有自己的标头。
您可以找到有关此文件格式的具体信息(特别是链接的成员标头)这里。
A
gzip
file should be fairly straight forward to determine as it ought to consist of a header, footer and some other distinguishable elements in between.From Wikipedia:
You might also try determining if the
gzip
contains any records/entries as each will also have their own header.You can find specific information on this file format (specifically the member header which is linked) here.