确定链接的 dll 版本

发布于 2024-10-11 16:35:10 字数 490 浏览 1 评论 0原文

根据 这篇文章< /a>,引用的dll的版本嵌入到exe文件中。

使用 ProcExp,我可以看到运行时加载的 dll 确实是我的机器上可用的最新 dll,但我有兴趣知道链接的版本。

附带说明一下,我使用 VS9 msbuild 构建了该项目,并对 VC 运行时 (msvcr90.dll) 版本感兴趣。在VC9 redist文件夹中它是9.0.30729.1,运行时加载.4926。

我的问题是:

  • 是否有任何工具可以用来提取链接到的 dll 版本(从 dll/exe)?
  • VS默认链接到哪个版本?在 redist 文件夹中找到的那个?

谢谢。

According to this article, the version of a referenced dll is embedded in the exe file.

Using ProcExp, I can see that the runtime loaded dll is indeed the latest dll available on my machine, but I'm interested to know the linked version.

As a side note, I built the project using the VS9 msbuild, and interested in the VC runtime (msvcr90.dll) version. In the VC9 redist folder it is 9.0.30729.1, runtime the .4926 is loaded.

My questions are:

  • Is there any tool with which I can extract the dll version linked to (from the dll/exe)?
  • Which version does VS link to by default? The one found in its redist folder?

Thank you.

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

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

发布评论

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

评论(2

韵柒 2024-10-18 16:35:10

Dependency Walker 可能会做到这一点。

Dependency Walker might do it.

蒗幽 2024-10-18 16:35:10

实际上,Dependency Walker 似乎没有读取(或至少显示)文件中链接的版本。

但我发现我可以使用 Windows SDK 中的 mt.exe 或 ResEdit 来读取嵌入的清单。

另外,总结我的发现(使用 msbuild 和 Windows SDK for Win7 来定位 amd64,它似乎使用 VS9(SP1?)libs):

  • 无需特别努力,VS9(非 SP1)版本 9.0。 CRT 的 21022.8 写入嵌入式清单中。也许这是 VS9 平台的基线。
  • 运行时根据 SxS 策略加载最新的 dll(好读可以在这里找到< /a>,以及问题中引用的文章)。
  • 当未安装适当的策略(例如通过 redist 包)时,人们似乎会遇到问题,请参阅 此处和[此处]和4[此处]5
  • 后一个 SO 告诉我们,如果定义了 _BIND_TO_CURRENT_VCLIBS_VERSION=1,那么链接器将链接到 VS9 SP1 CRT(版本 9.0.30729.1),正如之前注意到的,它确实位于 redist 文件夹中。

对于未来的帐户,如果: 会有

  • 一个表,其中包含 OS/SP/etc ZW 中引入的 CRT 版本 XY
  • 如果人们能够知道什么是目标安全版本,这可能是默认情况下在大多数用户计算机上可用。

Actually, Dependency Walker seems to not read (or at least display) the version linked in the file.

But I found that I can use mt.exe from the Windows SDK or ResEdit to read the embedded manifests.

Also, to summarize my findings (targeting amd64 using msbuild with the Windows SDK for Win7, which seems to use VS9 (SP1?) libs):

  • Without special effort, VS9 (non-SP1) version 9.0.21022.8 of the CRT is written in the embedded manifest. Maybe this is a VS9 platform baseline.
  • Runtime the newest dll gets loaded, according to the SxS policy (good read can be found here, along with the article referenced in the question).
  • People seem to had problems when the appropriate policies are not installed (via the redist package for example), see here and [here] and 4[here]5.
  • The latter SO tells that if _BIND_TO_CURRENT_VCLIBS_VERSION=1 is defined, then the linker would link against the VS9 SP1 CRT (version 9.0.30729.1), which as noticed before, is indeed in the redist folder.

For future account, it would be nice if:

  • There would be a table with CRT version X.Y. introduced in OS/SP/etc Z.W.
  • If one could know that what is a safe version to target, which is possibly available on most users machines by default.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文