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
34
votes
1 answer

Does Mono have the equivalent of ILDASM?

Is there an equivalent of ILDASM for Mono?
Iain Holder
  • 14,172
  • 10
  • 66
  • 86
23
votes
2 answers

Where is "ildasm" in Visual Studio 2019?

I used to be able to run ildasm in the Developer Command Prompt for Visual Studio 2017. With Visual Studio 2019, ildasm is no longer available: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community>ildasm 'ildasm' is not recognized as an…
redcurry
  • 2,381
  • 2
  • 24
  • 38
19
votes
1 answer

The *deps.json file in .NET Core

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…
Roman Roman
  • 617
  • 1
  • 9
  • 16
17
votes
5 answers

Why is the .ctor() created when I compile C# code into IL?

With this simple C# code, I run csc hello.cs; ildasm /out=hello.txt hello.exe. class Hello { public static void Main() { System.Console.WriteLine("hi"); } } This is the IL code from ildasm. .class private auto ansi…
prosseek
  • 182,215
  • 215
  • 566
  • 871
17
votes
3 answers

Why does this very simple C# method produce such illogical CIL code?

I've been digging into IL recently, and I noticed some odd behavior of the C# compiler. The following method is a very simple and verifiable application, it will immediately exit with exit code 1: static int Main(string[] args) { return…
lpmitchell
  • 181
  • 6
16
votes
3 answers

.net-core: Equivalent of ILDASM / ILASM

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).
Doug
  • 6,446
  • 9
  • 74
  • 107
12
votes
2 answers

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

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…
gmaran23
  • 2,118
  • 2
  • 17
  • 18
11
votes
2 answers

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

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…
myermian
  • 31,823
  • 24
  • 123
  • 215
10
votes
1 answer

Purpose and Meaning of "specialname" and "rtspecialname" in IL

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"); …
Ehsan Sajjad
  • 61,834
  • 16
  • 105
  • 160
9
votes
2 answers

ILDASM and ILASM, how use them?

I'm having a hard time trying to (Dis)assemble a dll using the Visual Studio command prompt, don't look that simple as I see in the microsoft page. I'm using the ildasm for these way: ildasm myLibrary.dll output:MyLibrary.il And I get: Unable to…
Freddx L.
  • 455
  • 2
  • 7
  • 16
8
votes
2 answers

Make type's instances non-storable

Is there a way to mark a type (or even better, an interface) so that no instances of it can be stored in a field (in a similar way to TypedReference and ArgIterator)? In the same way, is there a way to prevent instances from being passed through…
e_ne
  • 8,340
  • 32
  • 43
7
votes
1 answer

Different types have same signatures in CIL

I have one field defined in CIL like this: .field public int32 modopt(void*) fld I compile this to an assembly. Now I change it to: .field public int32 modopt(int16) fld Both how is it possible now, that ILDASM reports (when shown as hex) both…
IS4
  • 11,945
  • 2
  • 47
  • 86
6
votes
1 answer

Calculation of maxstack value in IL code

I have following program to add the values. When I am comenting Add method call in main method and looking into ILDASM.EXE Maxstack size is 2. And after uncommenting maxstack size becomes 4. Why in the case of Main method all variables are not…
Manjay_TBAG
  • 2,176
  • 3
  • 23
  • 43
6
votes
2 answers

C# to CIL Boxing vs. ToString Cost

I'm reading the book CLR via C# (4th edition), not as a newcomer to C# but as someone who knows the language trying to improve my grasp on the underlying functionality of the CLR. Anyway, in this book an example is given (pg127-131) when discussing…
Yushatak
  • 741
  • 1
  • 5
  • 15
6
votes
3 answers

System.Reflection - Global methods aren't available for reflection

System.Reflection does not (AFAIK) support reflecting on global methods in an assembly. At the assembly level, I must start with the root types. My compiler can produce assemblies with global methods, and my standard bootstrap lib is a dll that…
codenheim
  • 20,467
  • 1
  • 59
  • 80
1
2 3 4 5 6 7