Questions tagged [ilspy]

ILSpy is the open-source .NET assembly browser and decompiler.

ILSpy is the open-source .NET assembly browser and decompiler. ILSpy.net

79 questions
3
votes
1 answer

Decompiled assembly - unusual code

I decompiled an assembly using ILSpy, and one class in particular got my attention: public class CustomTextStream : NetworkStream { private EventHandler someEvent; public event EventHandler
Less
  • 3,047
  • 3
  • 35
  • 46
3
votes
1 answer

What's __PostIncrement in decompiled VB (by ILSpy)

I was just perusing the decompiled code for System.Collections.Generic.List(Of T).Add(item As T) using ILSpy and I found a call to __PostIncrement. I've never heard of such a thing in VB, so I did some digging and found: In VB, the code is…
just.another.programmer
  • 8,579
  • 8
  • 51
  • 90
3
votes
1 answer

ILSpy "Failed to resolve assembly" in AstBuilder

I want to decompile a method in my assembly, which references e.g. 'Microsoft.SharePoint.dll', but I have no SharePoint installed on the machine. If I use the following code I get an Mono.Cecil.AssemblyResolutionException 'failed to resolve…
Torsten
  • 226
  • 3
  • 8
2
votes
3 answers

Reverse Engineering .NET C# what does this line means?

I've the following line retrieved with ilSpy p[var1] = (t[var1] + z.c[var1 % z.c.Length]) % 'Ā'; p,t and c are char array[]. my question is: how can he + characters? t[var1]+z.c[someNumber] are 2 characters and then he module the result with a…
NoobTom
  • 555
  • 1
  • 9
  • 21
2
votes
1 answer

Does Mono Implement CLR? Or At Least Some Unmanaged InternalCall? Or Nothing?

We know that C# uses unmanaged code like P/Invoke or CLR implemented code like InternalCall. What I want to know is does mono it self implements a complete CLR or just some unmanaged code or nothing? I can use .Net Reflactor or ILSpy to view…
chenwq
  • 123
  • 1
  • 11
2
votes
4 answers

Are we looking at the original code in a Disassembler or reverse engineered CIL?

Take ILSPy. When I view my assembly am I looking at my original C#? Or, is this code reconstructed from CIL using some type of reverse engineering process? My understanding is that release assemblies do not include any original code, just CIL. …
P.Brian.Mackey
  • 43,228
  • 68
  • 238
  • 348
2
votes
1 answer

Visual Studio Decompiled Source Definitions from Object Browser

In Visual Studio 2019, there is a new feature powered by ILSpy to view decompiled source definitions(C#). It's documented here. This is a great feature and when I have a snippet of code like, SomeExternalClass.MemberFunction() I can click right…
2
votes
1 answer

How Microsoft Hides C# Internal Classes from a DLL's Metadata?

It all started when I wanted to analyze the code around CVE-2017-8759. I knew that the fix for the CVE was in a class named WsdlParser.cs inside System.Runtime.Remoting.dll which is part of the .Net Framework. You probably have this dll on your…
Alex
  • 737
  • 1
  • 9
  • 19
2
votes
1 answer

Is there a way to do automated decompilation with ILSpy?

We have a rather large third party product which contains a lot of C# DLLs and is updated every month or so. While the decompiler does only a 98% job where it can't get everything, it's good enough for my purposes for the occasional comparative…
Bill Early
  • 131
  • 1
  • 8
2
votes
1 answer

How to use ICSharpCode.Decompiler to decompile a whole assembly to a text file?

I need to get either the whole IL Code or Decompiled Source Code to a text file. Is that possible with the ILSpy Decompile Engine ICSharpCode.Decompiler?
Rosen Petrov
  • 183
  • 1
  • 9
2
votes
1 answer

Is this line of code from ILSpy decompiler valid?

I decompiled a release assembly using ILSPy and I got code like below. When I open the decompiled project in VS 2013, I get an error for each of these statements. using #j;//this line shows up as an error in VS2013 using System; The error…
Sunil
  • 20,653
  • 28
  • 112
  • 197
2
votes
1 answer

What risks exist if I work in a C# shop and attempt to write F# just to rely on ILSpy for conversion?

What risks are involved if I work in a C# shop and I attempt to write a feature in F# and then rely on ILSpy to translate the F# source code to a C# representation?
Scott Nimrod
  • 11,206
  • 11
  • 54
  • 118
2
votes
1 answer

When tampering an assembly, why can't I remove original instructions?

In order to be able to test legacy code which relies on SharePoint, I need to mock some of the objects of SharePoint. I do this by tampering with SharePoint assemblies, replacing their methods by mine on the fly. This works for some cases, but not…
Arseni Mourzenko
  • 50,338
  • 35
  • 112
  • 199
2
votes
0 answers

Disassemble IL code into C# with line numbers using MDB (or mdb2pdb?)

Does anyone know of tools that can disassemble IL back into C# code and use information stored in a mdb file to annotate the line numbers of the dissassembled IL? I am trying to investigate stack traces that have line numbers included without having…
Imi
  • 1,579
  • 1
  • 12
  • 22
2
votes
0 answers

How can I use ILSpy or other tools to find out which code in the .NET framework generated a particular exception message?

Suppose I have a bit of a particular exception message generated by the framework while running in standard English-US culture, e.g. "This failure occured while attempting to connect to the Principle server." How can I figure out which code in the…
Jordan Rieger
  • 3,025
  • 3
  • 30
  • 50