md5sum一个包含sum本身的文件? [英] md5sum a file that contain the sum itself?

查看:346
本文介绍了md5sum一个包含sum本身的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在C ++中编写了一个由单个EXE文件组成的小应用程序。

I have written a small app in C++ consisting of a single EXE file.

我想在可执行文件的md5sum中加入关于对话框。

I want to put in its "about" dialog the md5sum of the executable itself. It should be embedded statically into the executable (so that can be seen from hex editor), rather than computed on the fly.

推荐答案

由于@Shi& @matthewdaniel已经说过,这不能直接完成。

然而,有几种解决方法是可能的:

As both @Shi & @matthewdaniel have already said, this can't be done directly.
However a couple of workarounds are possible:


  • 计算您的应用程序的MD5,并将您的可执行文件打包到容器应用程序中,只需提取它并检查其MD5

  • 编译代码并只对代码段或其他段数据),然后添加MD5校验码。这将工作,因为MD5字符串将存储在数据段,保持任何其他内存段的预先计算的哈希的有效性有效。

这篇关于md5sum一个包含sum本身的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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