Click here to Skip to main content
15,886,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have read about "Converting .exe into a readable source code".
Is it really true? It writes "Yes".
Now i am making an app to sell its source code on a marketplace, what stops buyers from turning my .exe app into a readable source code?
I mean, i show my app for free and they may buy its source code.
Can't they just turn it into a readable source code?
I look at sales and they buy, but can't they extract a source code?

I heard about .Net Reflector, people write it is possible to extract a source code out a .Net app, is it true?

And there are lots of other cases when the source code is kept seriously.
I am confused or it is not true?
Posted
Updated 14-Jun-22 2:07am
v6
Comments
Subramanyam Shankar 7-Mar-15 8:42am    
The .net reflector converts a dll to code .it's a reverse engineering of converting a dll assembly language to C# code. you idea will not work converting a .exe how come it will help end users. Converting a .dll to C# code helps deverlopers to understand the code.
Ziee-M 14-Feb-18 3:09am    
I just wanted to add, All Microsft product have been hacked/reversed (VS, SQL...). So wherever you do, if your product is targeted, it will very probably be reversed and hacked. However, there is a lot of mature consumer, it will not affect you sales as much as you think. In addition, if you do regular updates, you will very probably discourage them since they have to do all the process from scratch, witch is not an easy task! I remember there is an article written by microsoft support about this topic and how they deal with it but i could not find it.

Yes and no. No, because you are totally confused, and, formally, the questions don't even make sense. You cannot say "conversion" and "extract source code". There is nothing to extract. Source code is not contained in the assembly modules. It is not "kept". You just don't understand.

At the same time, "turn it into a readable source code"? Yes, easily. Anyone can decompile a .NET assembly and get source code which can be compiled again into the same assembly. Readable? Yes. It is, of course, not the same source code, which is completely lost during compilation, but it is usually quite readable. Use open-source ILSpy and you will see:
http://en.wikipedia.org/wiki/.NET_Reflector[^],
http://en.wikipedia.org/wiki/SharpDevelop[^],
http://ilspy.net[^],
https://github.com/icsharpcode/ILSpy[^].

This is possible because the compiled assemblies are "written" in CIL (not machine language) and the code is reflective. Please see:
http://en.wikipedia.org/wiki/Intermediate_language[^],
http://en.wikipedia.org/wiki/Common_Intermediate_Language[^],
http://en.wikipedia.org/wiki/Reflection_%28computer_programming%29[^],
https://msdn.microsoft.com/en-us/library/f7ykdhsy%28v=vs.110%29.aspx[^].

—SA
 
Share this answer
 
v2
Comments
Ziya1995 7-Mar-15 9:30am    
You are talking about .Net assemblies?
I am talking about .Net .exe app.

Ok, let's be simple, i made an app on C# .Net, and now i have .exe file i can use to run my whole app.
So, can anyone convert it into a readable source code, then customize it?

I am talking about .Net .exe app, no C++, managed .Net app, possible?
Sergey Alexandrovich Kryukov 7-Mar-15 11:09am    
Didn't I just answer? The answer is yes, it's possible, and, depending on the application, can be easy to modify.
"Managed .NET app" is the same as ".NET app". Even if it is written in C++/CLI. ILSpy will give you C# or VB.NET code.
—SA
Ziya1995 7-Mar-15 11:45am    
Yes, ok.
Sergey Alexandrovich Kryukov 7-Mar-15 11:52am    
Will you accept the answer formally now?
—SA
Ziya1995 7-Mar-15 12:24pm    
I accepted another answer, but as you wanted, yes, i accepted yours too.
In actually it is better to have one answer accepted to not confuse novices.
I got everything i wanted to get out the answer.
Thanks.
In addition to what Sergey wrote and answers to the questions in your comment:
Quote:
You say .Net Assemblies, i say .Net Application, same thing?
.Net Assemblies are either Executables (.exe) or Dynamic Link Libraries (.dll) which are being used by Executables. Usually you refer to an Application as the whole product with all the parts that it requires to run, which includes .Net Assemblies.

Quote:
Ok, let's be simple, i made an app on C# .Net, and now i have .exe file i can use to run my whole app.
So, can anyone convert it into a readable source code, then customize it?
Theoretically yes. In practise it obviously requires effort and the question would be if someone would be sufficiently motivated to do that. Assuming you're talking about potential revenue losses when selling an application: Consider if someone who would hack your application would be a paying customer if he wasn't able to do that. Probably not. However, there are measures you can take to increase the amount of effort required to hack your .Net application: Obfuscators[^] will modify your application's assemblies in a way that it becomes considerably more difficult to make any sense of the source code that comes from decompiling, some even provide measures to make the decompiling process itself much harder.
 
Share this answer
 
Comments
Ziya1995 7-Mar-15 11:21am    
So, there is no direct way in the case of native machine code like C++ executable, just to press a button and decompile is impossible.

But in the case with managed code, it is easy, you can use software like .Net Reflector to get readable source code just by pressing a button.

Right?
It is my last question.
[no name] 7-Mar-15 11:36am    
There's that Microsoft Project called ".Net Native" which compiles directly to machine code instead of MSIL (MSIL is the .Net "Intermediate Language" which allows for decompilation) - but until now it's only available for Windows Store Apps. They said they probably will do it for other target platforms too but unfortunately there were no news on this for a long time.

> But in the case with managed code, it is easy, you can use software like .Net Reflector to get readable source code just by pressing a button.

Yes, unless the assembly was obfuscated. Then the resulting source code will be readable but hard to understand (look up "Obfuscator" and you will find an explanation for that). Depending on the used obfuscator technique it may even be impossible with "standard tools" like .Net Reflector to decompile the assembly, but hackers have their own tools.
Ziya1995 7-Mar-15 11:46am    
Great, ok.

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