问题标签 [ildasm]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
631 浏览

c++ - ILDASM: How does it work?

While there are many examples of how to use ILDASM, I have yet to find any information as to how ILDASM populates its data. Can anyone please help shed some light on this for me?

Edit: I should mention that I am interested in doing this from C++.

0 投票
1 回答
650 浏览

c# - 如何将 .il 文件组装成 .dll

我已经使用 ILDASM 反汇编了一个 WPF (Prism).dll 文件 (Microsoft.Practices.Prism.UnityExxtensions.dll),我得到了 3 个扩展名为 .IL、.res 和 .g.resources 的文件。我在 .IL 文件的元数据中更改了引用文件的版本号。现在我需要再次将其组装成 .dll。

0 投票
2 回答
267 浏览

.net - strongly-naming .net assemblies in a strongly-named assembly manifest

I have 6 old VB6 DLLs that need to work with my application. To have them work in .NET land, they were converted to Interop DLLs.

One of the Interop DLLs (call it Master.DLL) references the other 5 DLLs.

I wanted to strongly-name Master.DLL so I used ildasm/ilasm with a .SNK file

When I open the newly strong-named Master.DLL with ildasm and look at the manifest, its five references aren't strongly named, causing FileLoadExceptions.

My question: is it possible to strongly-name an Interop DLL AND all its assembly references in the manifest with the same .SNK file using ildasm/ilasm??

0 投票
1 回答
156 浏览

c# - Visual Studio 编译器如何将安全属性编译为 CIL?

我的类中的方法具有以下属性SecurityPermission(SecurityAction.Assert)。我编译它(调试构建)并通过查看原始堆并查看包含 PermissionSet blob 的 blob 堆来查看 ildasm.exe 中的输出。我期望(根据 ECMA-335)是:

但我看到的是这样的:

特别是,请注意01 00我期望的末尾的00 00. 规范说,在计算字符串之后应该是命名参数的数量。由于我没有传递任何命名参数,因此我希望该数字是 16 位 0。

这是使用 Visual Studio 2013 针对 .NET 2.0 编译的。

更复杂的是,如果我添加一个命名参数,我会得到:

再一次,查看属性的计数字符串的末尾,您可以看到12 01后面是命名参数列表(一个项目的列表)。我希望这是01 00一个 16 位的小端 1,用于命名参数的数量。

基于此,我假设计数字符串之后的第二个字节是命名参数计数,但我仍然不明白第一个字节是什么(第一个示例中的 0x01,下一个示例中的 0x12)。

如果我添加第二个命名属性,第一个字节将更改为 26,如果我添加第三个命名属性,它将更改为 33。除了它们在增加的事实之外,我没有看到数字的明显模式。

我问这个问题是因为我正在尝试手动构建 PermissionSet blob(我正在编写 CLR 分析器)并且我需要知道在该字节中放入什么。

0 投票
4 回答
6874 浏览

c# - How to find all assemblies that reference a specific dll?

I've a directory with a large number of dlls. I need to find all those that reference a specific dll.

I'm thinking about the following solution :

  1. Loop the assemblies and invoke each one with ildasm
  2. Dump the manifest into a text file
  3. Search the text files for the required assembly name.

Yet this solution feels immensely wrong to me. Is there a better way to achieve it?

0 投票
1 回答
373 浏览

c#-4.0 - ILDASM.EXE 的 API

我知道 ildasm.exe 可用于分析程序集的代码。我想在我的代码中使用 ILDASM.exe。是否有微软提供的相关 API,我可以使用它来将此功能合并到我的代码中。我不想调用 ildasm.exe 并转储文件并进行解析。我想获取对象并根据我的使用来操作它们。

0 投票
1 回答
53 浏览

.net - 对自动属性 ​​IL 访问两个参数而不是一个参数感到困惑

给定以下自动属性:

public string Name { get; set; }

我使用 ILDASM 分析了它的 IL,并对结果感到好奇:

我可以看到该方法接受了一个名为的参数value,它对应于调用ldarg.0ldarg.1但是,由于我在方法签名中看不到第二个参数,所以对我的调用抓住了我。

希望有人能解释一下这里发生了什么吗?

0 投票
1 回答
741 浏览

.net - ILDasm、mscorlib 和 System.Runtime 反编译差异取决于目录

我一直在玩 ILDasm 并注意到:

  • 反编译C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Runtime.dll (36KB)只返回一个清单文件。反编译C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.dll (114KB)返回清单和程序集中的所有类型。

  • 反编译C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\mscorlib.dll (38KB)只返回一个清单文件,反编译C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll (5171KB)返回一个清单和程序集中的所有类型。

我找不到任何关于为什么以这种方式构建程序集的信息。

两个程序集目录有什么区别,为什么文件系统上有两个副本?为什么两个程序集中的类型都重复?System.Runtime 和 mscorlib 都包含大多数相同的类型。

0 投票
1 回答
360 浏览

c# - 拆卸时.net图标丢失

我使用命令“ildasm MyApp.exe /output:MyApp.il”对应用程序进行了分解,然后它生成了一些资源文件和 MyApp.il。之后,我将所有生成的文件和 .il 文件复制到 ilasm.exe 的文件夹中。使用命令“ilasm MyApp.il”构建它后,它生成了 MyApp.exe 文件,但没有图标。请帮我恢复图标,谢谢。

0 投票
1 回答
431 浏览

wif - 为什么我无法反编译 System.IdentityModel.Services.dll?

我正在尝试反编译System.IdentityModel.Services.dll,但没有一个反编译工具显示方法详细信息

我什至无法在 ILDASM 中获得这些方法的 IL。ILSpy 也是如此。

例如: System.IdentityModel.Services.SessionAuthenticationModule

伊尔达斯姆:

我原以为至少 IL 总是可用的。不是这样吗?