Questions tagged [ildasm]

Microsoft intermediate language (MSIL) Disassembler

The MSIL Disassembler is a companion tool to the MSIL Assembler (Ilasm.exe). Ildasm.exe takes a portable executable (PE) file that contains Microsoft intermediate language (MSIL) code and creates a text file suitable as input to Ilasm.exe.

This tool is automatically installed with Visual Studio and with the Windows SDK. To run the tool, you can use the Visual Studio Command Prompt or the Windows SDK Command Prompt (CMD Shell). These utilities enable you to run the tool easily, without navigating to the installation folder.

MSDN: Ildasm.exe (MSIL Disassembler)

101 questions
6
votes
1 answer

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

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…
Razor
  • 17,271
  • 25
  • 91
  • 138
6
votes
2 answers

Repeatable builds from same C# source code on different machines

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…
Comic Book Guy
  • 119
  • 2
  • 13
5
votes
3 answers

disassemble c# code to machine instructions

I am experimenting with compiler performance. I have a very small piece of code, just a few floating point multiplications and additions. The code gets executed in a loop several million times. I am trying to compile the code in C++, c#, java, perl,…
danatel
  • 4,844
  • 11
  • 48
  • 62
5
votes
5 answers

Could not find ildasm.exe

I recently upgraded to VS 2017 and uninstalled the previous VS 2015. However when I try and build and compile my project I keep getting and error: Microsoft.Build.Utilities.ToolLocationHelper could not find ildasm.exe The project uses Unmanaged…
Zeller33
  • 181
  • 2
  • 4
  • 16
5
votes
2 answers

If Powershell is built on top of .Net, what is the reason to write scripts instead of C# code?

As a person who is new to Powershell I am not 100% clear at one point: If "In PowerShell, administrative tasks are generally performed by cmdlets (pronounced command-lets), specialized .NET classes implementing a particular operation." What…
pencilCake
  • 51,323
  • 85
  • 226
  • 363
4
votes
1 answer

ildasm, then ilasm with same meta data

We need to patch an assembly and we can't rebuild from source code at the moment. I can dump the IL using ildasm mydll.dll /all /out=mydll.il and then I can rebuild it with ilasm /dll mydll.il and it's all good except that things like file version,…
ILovePaperTowels
  • 1,445
  • 2
  • 17
  • 30
4
votes
2 answers

How to run ildasm on .Net core exe/assembly?

I'm trying to run ildasm (Intermediate Language Disassembler) installed as part of Visual Studio 2019 against .NetCore3.1 console app. Use Developer command prompt of Visual Studio 2019 and run following command ildasm.exe …
pune
  • 79
  • 2
  • 9
4
votes
3 answers

How float and double work in IL

When we declare a variable of int for example: int i = 4; The following IL is generated : IL_0001: /* 1A | */ ldc.i4.4 I can understand that 1A is the hexadecimal representation of 4, so am i understanding right that…
Ehsan Sajjad
  • 61,834
  • 16
  • 105
  • 160
4
votes
2 answers

Objects based on nullable types are only boxed if the object is non-null

I have created a simple C# program: class Program { static void Main(string[] args) { Int32? a = null; object x = a; } } According to MSDN: Objects based on nullable types are only boxed if the object is non-null.…
J.King
  • 78
  • 5
4
votes
4 answers

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 : Loop the assemblies and invoke each one with ildasm Dump the manifest into a text file Search the…
MichaelS
  • 7,023
  • 10
  • 51
  • 75
4
votes
1 answer

How is the Visual Studio compiler compiling Security Attributes to CIL?

I have the following attribute SecurityPermission(SecurityAction.Assert) on a method in my class. I compile it (debug build) and view the output in ildasm.exe by viewing the raw heaps and looking at the blob heap containing the PermissionSet blob. …
Micah Zoltu
  • 6,764
  • 5
  • 44
  • 72
3
votes
3 answers

How can I decompiling IL code of .net framework

I want to investigate IL code of most .net framework library classes. Is it possible? I am trying to decompiling some dll (e.g.: System.Treading), and I only see signature of the functions. Then I go to mscorlib.dll and see only manifest. There is a…
YVEF
  • 139
  • 1
  • 9
3
votes
1 answer

Modifying IL code causing InvalidProgramException at runtime

Im trying to remove the subscription to the Tick event in IL Code so that it wont ever fire. Here is the IL Code: IL_0e19: ldftn instance void App.Framework.MainForm::mTimer_Tick(object, class [mscorlib]System.EventArgs) IL_0e1f: newobj …
CathalMF
  • 9,705
  • 6
  • 70
  • 106
3
votes
1 answer

How to diagnose "Type load failed" from PEVerify

I'm working on a compiler that's producing bad output in certain cases of expanding generators. PEVerify simply says "Type load failed" without giving any explanation as to why. When I've seen this in the past, it's generally been because the…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
3
votes
3 answers

ILDasm Visual Studio 2010

Is there a convenient method or tool available which will do the following for me from within visual studio 2010. Fire up ILDasm Load a current assembly from within Visual Studio within ILDasm. As opposed to me firing up a visual studio command…
user486523