namco
namco

Reputation: 6338

How does c# decompiler work

i am interested in decompilers like ILSpy or .Net Reflector and etc.

Can anybody tell me how this decompiler convert exe or dll files written in c# to its original source code?

Upvotes: 3

Views: 1951

Answers (2)

Steve Morgan
Steve Morgan

Reputation: 13091

There are two key points, here.

Firstly, IL, while a lower level language that C# or VB.NET, is a much higher level than assembler or machine code. Many high level constructs are still in place and can be used relatively easily to determine the flow and operation of the code.

The other key point, is that a decompiler does not generate the original source code. It generates high-level language constructs from the lower-level IL, which, typically are very similar to the original source code, but not identical.

Upvotes: 8

Samir Adel
Samir Adel

Reputation: 2499

Because the C# complier generates a meta data information and the generated code is intermediate language that is translated to binary code at runtime so each dll or exe generated from the complier can be refactored by .net reflector and the ILSpy can

Upvotes: 1

Related Questions