有用的二进制差异工具(除了 msdn[apatch 和 mpatch]、xdelta、bsdiff、vbindiff 和 winmerge)

发布于 2024-09-19 08:43:56 字数 1536 浏览 7 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

留蓝 2024-09-26 08:43:56

StackOverflow:“最佳 Diff 工具?” 提到了一堆二进制补丁实用程序。

StackOverflow:“二进制差异和补丁实用程序” 提到了更多二进制补丁实用程序。

StackOverflow:“二进制差异工具?” 提到了更多二进制补丁实用程序。

但我认为所有这些都会遇到同样的问题:

对于大多数压缩工具,两个压缩文件的“第一部分”将是相同的,直到发生第一个更改为止。
两个压缩文件的“最后部分”将完全不同。
任何 diff 工具(不会通过将文件识别为压缩文件并解压缩来作弊)都会创建一个补丁文件,该文件或多或少是新文件“最后部分”的批量副本。
在您的例子中,新文件的“最后部分”显然大约有 7 MB 长。

“按推测,该补丁文件大小应为1MB。”你怎么可能知道呢?

给定两个压缩文件,diff 实用程序将生成一个比这些文件小不了多少的补丁文件。

正如利亚姆所说,您需要在压缩之前区分这些文件的原始版本。
或者等效地,您需要将 .dat 文件解压缩为临时文件,并对这些临时文件进行比较。

(您也可以选择使用任意数据压缩实用程序来压缩补丁文件)。

我无法告诉您如何解压缩 .dat 文件,因为我不知道您拥有多种 .dat 文件中的哪一种。

StackOverflow: "Best Diff Tool?" mentions a bunch of binary patch utilities.

StackOverflow: "Binary diff and patch utility" mentions a few more binary patch utilities.

StackOverflow: "Binary diff tool?" mentions yet more binary patch utilities.

But I think you will have the same problem with all of them:

With most compression tools, the "first part" of the two compressed files will be identical, up to the point where the first change occurred.
The "last part" of the two compressed files will be completely different.
Any diff tool (that doesn't cheat by recognizing the files as a compressed file and decompress them) will create a patch file that is more-or-less a bulk copy of the "last part" of the new file.
In your case, the "last part" of the new file is apparently about 7 MB long.

"supposedly, the said patch file should be of size 1MB." How could you possibly know that?

Given two compressed files, a diff utility will generate a patch file that is not much smaller than those files.

As Liam said, you need to diff the original versions of these files before compressing.
Or equivalently, you need to decompress your .dat files into temporary files, and diff those temporary files.

(Optionally, you could use any arbitrary data compression utility to compress your patch files).

I can't tell you how to decompress your .dat files, because I don't know which one of the many kinds of .dat files you have.

白鸥掠海 2024-09-26 08:43:56

比较压缩格式时,必须先解压缩它们。

Xdelta 对某些格式自动执行此操作,例如 gzip,但可能不会对 .dat 执行此操作

When diffing compressed formats, you have to decompress them first.

Xdelta does this automatically for a few formats, such as gzip, but probably not for .dat

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文