.NET 程序集会改变吗?

发布于 2024-08-18 11:23:13 字数 271 浏览 3 评论 0原文

我需要提供所有程序集的 32 位 CRC(循环冗余检查),将其存储(用于发布控制目的),然后可以与稍后系统上存在的程序集进行比较(以便检查该版本是否未以某种方式损坏)。

我计算程序集本身的 CRC 没有问题,我的问题是:

.NET 程序集是否会更改?即,程序集安装到目标系统后,其实际二进制内容是否会发生变化(出于任何原因)?如果确实如此,那么 CRC 也会发生变化。

请注意,我仅指与我的软件一起打包的程序集,而不是标准系统程序集,这些程序集未经过检查。

干杯

I have a need to provide a 32-bit CRC (Cyclic Redundancy Check) of all assemblies, which is stored (for release control purposes), and may then be compared against the assemblies present on a system at a later date (in order to check that the release hasn't been corrupted in some way).

I have no problem calculating the CRC of the assemblies themselves, my question is this:

Do .NET assemblies ever change? I.e. Does the actual binary content of the assembly ever change (for any reason) after it is installed on the target system? If it does, then the CRC would change also.

Note, I am referring only to assemblies that are packaged with my software, not the standard System assemblies, those are not checked.

Cheers

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

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

发布评论

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

评论(4

旧伤慢歌 2024-08-25 11:23:13

你正在重新发明一个轮子,强命名已经做到了这一点。篡改程序集以使其具有正确的 CRC32 非常简单。破坏强名称不是,它是加密安全的。

You are re-inventing a wheel, strong naming already does this. Tampering an assembly so that it has the right CRC32 is pretty simple. Breaking a strong name is not, it is cryptographically secure.

许久 2024-08-25 11:23:13

如果您不更新程序集(覆盖它们),它们将永远不会改变。

If you don't update the assemblies (overwrite them), they will never change.

单身狗的梦 2024-08-25 11:23:13

它们应该只在安装或更新时更改,除非程序员在他的程序中包含了一些令人讨厌的黑客攻击。但如果您有疑问,为什么不直接撤销用户写入或修改相应文件的权限呢?

They should only change while installation or update, unless a programmer has included some nasty hack into his program. But if you are in doubt, why don't you just revoke the user rights for writing or modifying the according files?

心欲静而疯不止 2024-08-25 11:23:13

我记得在某处读过,.net 优化器会搜索并遍历任何程序集来“优化”它们?听说它在安装后做了这个 - 但我自己从来没有研究过 - 我想它们可能不会改变,但我不确定它是否真的可以保证你

尝试一下看看!祝你好运

i recall reading somewhere that the .net optimiser searches for and goes through any assemblies to 'optimise' them? heard it did this after an install - never looked into it myself though - id imagine they probably dont change but im not sure if its something you can really guarantee

try it and see! good luck

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