Click here to Skip to main content
16,022,060 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Supposing that I have *.exe file but not the source in C#, is there a way to obtain the source in C#?

What I have tried:

I have not really tried the reverse. Only to "build" an app in the forward direction using Visual Studio.
Posted
Comments
charles henington 25-Aug-24 14:20pm    
Have you looked into ILSpy https://github.com/icsharpcode/ILSpy/releases/download/v9.0-preview2/ILSpy_Installer_9.0.0.7660-preview2-x64.msi

1 solution

Yes and no.
It is possible to regenerate some code from an exe, but whether that code is of any real use is variable.

The problem is that both optimisations (which normally happen with release builds) and obfuscations (which can be optionally added during the build step) change the code generated and can change all names (classes, fields, properties, and methods) to non-significant ones as well as deliberately using complex roundabout phrases and redundant logic to make the code difficult for the reader to understand.

Basically, what you decompile will not be identical to the original source, and may be wildly different!

There are also legal concerns: many (if not all) software licences explicitly forbid decompilation and you can get into some severe legal problems if you do this. (And ... if it's readable when decompiled it's going to be pretty obvious what you do if you try to produce a "clone" of existing software ...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900