gpt4 book ai didi

c# - 如何比较两个可执行文件?

转载 作者:太空狗 更新时间:2023-10-29 20:21:15 25 4
gpt4 key购买 nike

我有一个不需要 UAC 警告的文件。我使用 C#.NET 将文件复制到另一个位置

 File.Copy("Original.exe", "Copy.exe");

现在我看到 Copy.exe 需要 UAC 警告才能在 windows 7/Vista 下运行。

我如何比较 Original.exe 和 Copy.exe 以准确查看文件发生了什么并手动更改它以便它不再需要 UAC。我可以使用哪个工具来实现这一目标?

enter image description here

两个可执行文件是同一个文件:如何知道这两个文件之间的区别?

最佳答案

Windows Installer Detection Technology 是这种行为的原因。有一组条件强制将可执行文件视为需要管理员权限:

  1. 32 bit executables
  2. Applications without a requestedExecutionLevel
  3. Interactive processes running as a Standard User with LUA enabled

Before a 32 bit process is created, the following attributes are checked to determine whether it is an installer:

  • Filename includes keywords like "install," "setup," "update," etc.
  • Keywords in the following Versioning Resource fields: Vendor, Company Name, Product Name, File Description, Original Filename, Internal Name, and Export Name.
  • Keywords in the side-by-side manifest embedded in the executable.
  • Keywords in specific StringTable entries linked in the executable.
  • Key attributes in the RC data linked in the executable.
  • Targeted sequences of bytes within the executable.

相关 MSDN 文章:http://technet.microsoft.com/en-us/library/cc709628%28WS.10%29.aspx

可能的解决方案:

  • 如果您是可执行文件的作者,请包含具有指定 requestedExecutionLevel 的 list
  • 如果您无权访问源代码 - 尝试使用适当的实用程序(例如 mt 或一些通用资源编辑器)添加或修改 list
  • 避免在可执行文件名中使用关键字updateinstallsetup

关于c# - 如何比较两个可执行文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11496175/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com