ildasm

ILDasm, mscorlib and System.Runtime decompilation differences depending on the directory

假装没事ソ 提交于 2019-12-09 18:21:56
问题 I have been playing around with ILDasm and have noticed that: Decompiling C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Runtime.dll (36KB) simply returns a manifest file. Decompiling C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.dll (114KB) returns the manifest and all types in the assembly. Decompiling C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\mscorlib.dll (38KB) simply returns a manifest file and

Purpose and Meaning of “specialname” and “rtspecialname” in IL

只谈情不闲聊 提交于 2019-12-08 20:45:34
问题 I am trying to understand the IL code and C# internals specifically nowadays, i wrote a simple c# hello world program whose code is : using System; class Program { public static void Main() { Console.WriteLine("Hello World"); } } and here is IL generated for the constuctor of Program class : .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL

The *deps.json file in .NET Core

☆樱花仙子☆ 提交于 2019-12-08 17:28:21
问题 What is the purpose of *deps.json file in .NET Core? What is the reason to store references in such file and not in assembly manifest(as in standalone .NET Framework)? Using Ildasm i checked that assembly manifest doesn't contain entries for these dependecies after dotnet build command. But it has entries after dotnet publish command. 回答1: The .deps.json file contains metadata about the assemblies referenced by the built assembly and the locations to search for them as well as information

How to find all assemblies that reference a specific dll?

馋奶兔 提交于 2019-12-06 05:04:44
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 : Loop the assemblies and invoke each one with ildasm Dump the manifest into a text file 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? You could write a small tool for that purpose, using Reflection to find the referenced assemblies: string[] fileNames = ...; // get all the filenames foreach (string fileName in fileNames) { var assembly = System.Reflection

Repeatable builds from same C# source code on different machines

泄露秘密 提交于 2019-12-05 08:23:01
I am trying to produce a tool which is smart enough to programmtically examine release version binaries produced by identical C# code compiled on two seperate machinces at different times and conclude that the code was identical while being able to pick up any code changes if present in the c# code used to produce these binaries. I have tried using a number of approaches but in order to keep this short i'll just stick to the latest attempt. I run ildasm with the /text option on the binaries and replace the GUIDs for anonymous fields etc in text, but when the binaries come from different pcs i

.net-core: Equivalent of ILDASM / ILASM

为君一笑 提交于 2019-12-04 21:38:04
问题 Is there the equivalent of ILDASM / ILASM for the .net-core? Specifically, I'm looking for something that runs on Linux (Hence why the .net-core). 回答1: Both the ildasm and ilasm tools are built with CoreCLR from this repo: https://github.com/dotnet/coreclr. They include similar functionality as the versions shipped with Windows (sans GUI, etc.). There are nuget packages shipped that include them as well (https://www.nuget.org/packages?q=ildasm), but they are platform-specific and also require

Can we disassemble (using ILDasm) an NGen-ed assembly?

╄→гoц情女王★ 提交于 2019-12-04 17:38:03
问题 If I NGen an assembly, is it normal that ildasm still disassembles it? Ok. I wrote a HelloWorld class library and the ensuing dll is named NGenILDasmTest.dll. --> Targeted for the .Net fw 4. From Vs 2010 command prompt, I did gacutil -i NGenILDasmTest.dll I could see the assembly installed in the GAC. And I ran ildasm so I could view the IL. So far so good. Then I run ngen NGenILDasmTest.dll (I did not specify any options for ngen). And this assembly successfully got compiled. I located it

ILDasm, mscorlib and System.Runtime decompilation differences depending on the directory

别来无恙 提交于 2019-12-04 09:24:48
I have been playing around with ILDasm and have noticed that: Decompiling C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Runtime.dll (36KB) simply returns a manifest file. Decompiling C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.dll (114KB) returns the manifest and all types in the assembly. Decompiling C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\mscorlib.dll (38KB) simply returns a manifest file and decompiling C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll (5171KB) returns a manifest and all

.net-core: Equivalent of ILDASM / ILASM

心已入冬 提交于 2019-12-03 13:32:33
Is there the equivalent of ILDASM / ILASM for the .net-core? Specifically, I'm looking for something that runs on Linux (Hence why the .net-core). Both the ildasm and ilasm tools are built with CoreCLR from this repo: https://github.com/dotnet/coreclr . They include similar functionality as the versions shipped with Windows (sans GUI, etc.). There are nuget packages shipped that include them as well ( https://www.nuget.org/packages?q=ildasm ), but they are platform-specific and also require a matching version of CoreCLR to use, so they are not straightforward to consume via nuget. The easiest

Guaranteed way to find the filepath of the ildasm.exe and ilasm.exe files regardless of .NET version/environment?

若如初见. 提交于 2019-12-03 12:53:18
Is there a way to programmatically get the FileInfo/Path of the ildasm.exe/ilasm.exe executables? I'm attempting to decompile and recompile a dll/exe file appropriately after making some alterations to it (I'm guessing PostSharp does something similar to alter the IL after the compilation). I found a blog post that pointed to: var pfDir = Environment.GetFolderPath(Environment.SpecialFolders.ProgramFiles)); var sdkDir = Path.Combine(pfDir, @"Microsoft SDKs\Windows\v6.0A\bin"); ... However, when I ran this code the directory did not exist (mainly because my SDK version is 7.1), so on my local