用于三向二进制(十六进制)文件比较的工具?
我有一组二进制配置文件,每个文件都有三个版本——每个文件的一个原始版本和两个经过不同修改的版本。我需要能够同时看到两个版本和原始版本之间的差异。
我需要的是一个用于二进制文件的三向比较工具。通过相当费力的 Google 搜索,我最终偶然发现了一个应用程序的屏幕截图,它完全符合我的需要 - 不幸的是,包含该图像的论坛帖子没有提及他们正在使用的应用程序:
http://www.xboxhacker.org/index.php?topic=15032.0
有人能给我指出一个(Windows)应用程序的方向,该应用程序提供三个二进制文件的二进制安全(十六进制)比较吗?
I have a set of binary configuration files with three versions each -- an original, and two differently-modified versions of each file. I need to be able to see the differences between the two versions as well as the original, all at the same time.
What I need is a three-way diff tool for binary files. Through a rather exhausting Google search, I eventually happened upon a screenshot of an application that does exactly what I need -- unfortunately, the forum post containing the image does not mention what application it is they're using:
http://www.xboxhacker.org/index.php?topic=15032.0
Can someone point me in the direction of a (Windows) application that provides a binary-safe (hex) comparison of three binary files??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
Vim 有一个内置的 diff 工具,可以比较任意数量的文件。它也可以在 Windows 上运行。您可以在 http://vim.org 找到它。
Windows 版 vim 的标准安装包括
xxd
,它允许您将二进制文件视为文本:因此,例如,如果您尝试:
您将得到:
等等...
所以您可以使用
xxd
将二进制文件转储到文本文件中:然后以 diff 模式运行 vim:
这将为您提供如下内容:
(此屏幕截图取自 这里 只不过是 VIM 中 3 向 diff 的示例)
所有这些工具都可以在 Windows 中使用,因此它们应该可以解决您的问题。
编辑:
合并
xxd
的结果后,您可以使用xxd -r
将十六进制转储转换为二进制文件:您可以看到更多
xxd
的联机帮助页中的详细信息和选项Vim has a built-in diff tool that can compare an arbitrary number of files. It also runs on Windows. You can find it at http://vim.org.
The standard installation of vim for windows includes
xxd
, which allows you to see binary files as text:So for example if you try:
you'll get:
etc...
So you can use
xxd
to dump your binary files into text files:And then run vim in diff mode:
And this will give you something like this:
(This screenshot was taken from here and is no more than an illustration of what a 3-way diff will look like in VIM)
All of these tools are available in windows, so they should solve your problem.
Edit:
After you merge the results of
xxd
, you can convert the hex dump into a binary file usingxxd -r
:You can see more details and options in
xxd
's manpage屏幕截图来自 Araxis Merge。他们的专业版(270 美元)支持 3 向比较。
The screenshot is from Araxis Merge. Their pro edition ($270) supports 3-way compares.
你可以看看 ECMerge (我使用的一个工具),它有 2 路和 3 路差异二进制文件(十六进制 + ASCII)。没有合并功能。您可以轻松地从更改区域移动到更改区域并压缩长区域(长插入、更改或未更改)。
You could have a look to ECMerge (a tool I work on), it has a 2 and 3-way diff of binary files (HEX + ASCII). There is no merge feature. You can move from changed area to change area easily and compact long zones (long insertions, changes or unchanged).
最新版本的Beyond Compare似乎支持 3 路比较和合并< /a>.此外,其功能列表表示它支持比较二进制文件。
请注意,这不是免费软件:-)
The latest version of Beyond Compare seems to support 3-way diff and merge. Moreover, its feature list says it supports comparison of binary files.
Note that this is not free software :-)
最近有人向我介绍了 p4merge,它似乎也支持二进制文件。
它需要 3 个文件作为输入:原始文件和两个衍生文件。它并排显示它们,第四个窗口显示合并的文件,具有编辑功能和冲突解决功能。
我只是用它来合并一个大型代码库的两个分支,这非常方便。
现在,我还没有使用它来合并二进制文件,但它确实支持比较图片,所以我如果不支持二进制文件,请感到惊讶。
I was recently introduced to p4merge, which appears to also support binary files.
It takes 3 files as input: The original and two derivatives. It shows them side-by-side, with a fourth window that shows the merged file, with editing capabilities and conflict resolution.
I just used this to merge two branches of a large codebase, and it was extremely convenient.
Now, I haven't used it to merge binary files, but it does support diffing pictures, so I'd be surprised if binaries weren't supported.