使用Python或其他常见脚本语言/工具以编程方式抓取DLL清单信息

发布于 2024-08-24 19:26:51 字数 920 浏览 9 评论 0原文

我遇到这样的问题:

http://svn.haxx .se/tsvnusers/archive-2008-07/1051.shtml

除了该应用程序是我们自己的(抱歉,不会向您提供机密详细信息)。尽管如此,SideBySide 有如此多的缺陷并不是我们的错。

无论如何,X 版本有效,而 Y 版本一开始就失败了。我面临的任务是遍历一堆目录和多达 100 个 dll 文件,以找出可能存在的差异。

看起来两个 dll 文件之间存在冲突,这两个 dll 文件加载了另一个 dll 文件的两个不同版本。

我将感谢您帮助使用 Python/其他代码片段从给定文件中提取清单。谢谢!

编辑:顺便说一句,我确实找到了一种方法:我可以运行以下命令(mt.exe 是 Visual Studio 2008 工具的一部分): exe -inputresource:MyFile.dll;#2 -out:MyFile.dll.extracted_manifest.txt。

这是一个好的开始,但它有两个问题:

  1. 可以嵌入多个清单(根据我的理解):#1、#2、#3,... - 我不知道前面有哪些以及有多少个时间。最大是多少?
  2. 如果我猜测并使用该参数运行 mt.exe,则会失败。处理这些错误会使脚本变得更长。

有人可以解释一下吗?

另一个编辑:啊,没关系! 1 代表 .exe,2 代表 dll,仅此而已。我想我现在知道该怎么做了。但是,如果您有一个击败我的解决方案,或者您从 Python/其他脚本自动调用 mt.exe,那么请随意分享它。

I am having a problem like this one:

http://svn.haxx.se/tsvnusers/archive-2008-07/1051.shtml

Except that the app is our own (sorry, won't give you confidential details). Although, it is not our fault that SideBySide is so flawed.

Anyhow, version X works and version Y bombs right at the start. I am facing the task of walking through a bunch of directories and up to 100 dll files to figure out what the difference may be.

It looks like there is a conflict between two dll files which load two different versions of another dll file.

I would appreciate your help with a Python / other snippet for extracting a manifest from a given file. Thanks!

EDIT: By the way, I did find a way: I can run the following command (mt.exe is part of Visual Studio 2008 Tools): mt.exe -inputresource:MyFile.dll;#2 -out:MyFile.dll.extracted_manifest.txt.

This is a good start, but there are two problems with it:

  1. There can be multiple manifests embedded (In my understanding): #1, #2, #3, ... - I do not know which ones and how many ahead of time. What is the maximum?
  2. If I take a guess and run mt.exe with that parameter, I get a failure. Dealing with these errors would make the script longer.

Could someone shed some light on this please?

ANOTHER EDIT: Ah, never mind! 1 is for .exe, 2 is fo dll and that is it. I guess I know what to do now. However, if you have a solution which beats mine, or if you have automated calls to mt.exe from a Python / other script, then feel free to share it.

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

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

发布评论

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

评论(1

南烟 2024-08-31 19:26:51

手动暴力(点击)方法效果更快。只花了几个小时。

A manual brute-force (clicking) approach worked faster. Took only a few hours.

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