Click here to Skip to main content
15,914,071 members
Please Sign up or sign in to vote.
1.75/5 (4 votes)
Hey Friends,
I want to develop the program which will copy the source code from the executable file and paste it any best accessible format for eg: notepad, word, etc. using c#.net through visual studio.
Can anybody help me with the program that will help me to achieve my Goal.

Thanks In Advance!!!
Posted
Updated 5-Apr-11 21:46pm
v2
Comments
Wayne Gaylard 6-Apr-11 3:48am    
That sounds an awful lot like you want to pirate someone elses software. I don't think you are going to get many answers here.
Albin Abel 6-Apr-11 15:51pm    
Not true Wayne Gaylard it got six answers. Good test for .net exe. Still wondering why Ank_ush wants the source code by spending energy. he can right away use that exe :). When somebody said Watson find the DNA model, actually it was a team work. :). May be Ank_ush wants to own an exe.
Sergey Alexandrovich Kryukov 6-Apr-11 18:07pm    
Albin, you're not trusting. I assume OP is driven by curiosity and interesting theoretical issues.
You need to apply Presumption of innocence in all cases :-)

(Is that right, Ank_ush?)
--SA
dan!sh 6-Apr-11 22:58pm    
I think it is. I have checked other questions from him and it looks like he is just driven by curiosities for now.
Sergey Alexandrovich Kryukov 7-Apr-11 0:29am    
Great. All people deserve some initial credit in the form of trust.
--SA

Since reflector is a licensed product these days, I have started to use ILSpy[^] which is still free. It's not so rich in features but does the job.
 
Share this answer
 
Comments
Albin Abel 6-Apr-11 15:45pm    
Is this cross the obfuscation barrier? my 5
Wendelius 6-Apr-11 15:51pm    
Thank you :) Never tried but I wouldn't think so. If you give it a try at some point, please let me know.
Sergey Alexandrovich Kryukov 6-Apr-11 16:17pm    
So ILSpy also can generate C# code, is that true? Very interesting reference, thank you. My 5 certainly.
--SA
Wendelius 6-Apr-11 16:24pm    
Thanks :)
dan!sh 6-Apr-11 22:51pm    
Nice one Mika. Thanks :)
Hi,
there is already an application for reverse engineering. Some time ago it was even free of charge. http://www.reflector.net/[^]
Regards
 
Share this answer
 
v3
Comments
Albin Abel 6-Apr-11 15:42pm    
hmm really? will try it. :)
Sorry, no. This is a very big and difficult project, with your level of understanding — absolutely not feasible. Why do you think I'm trying to access your level? Sorry, this is apparent from your Question: you mix up unrelated concepts: C# project itself is unrelated to VS, the term C#.net makes no sense and is not used because C# not for .NET does not exist; you think that there is such thing as Notepad format (no, there is no Notepad format); and MS Word format is unrelated to C# (which is always a plain text, possible Unicode); you say "executable file" instead of ".NET assembly".

No wonder you have no idea of the scale of the problem of C# code generation based on .NET assembly

If you want to start learning some programming, do it, but in realistic tasks. I cannot advise anything better.

—SA
 
Share this answer
 
Comments
Albin Abel 6-Apr-11 15:41pm    
Wondering when code project starts reverse engineering support.lol.5
Sergey Alexandrovich Kryukov 6-Apr-11 18:04pm    
Thank you.
The situation when you need reverse engineering is quite ugly thing, but doing it is not really unlawful or something like that.
--SA
lol, emm an executble does not have source code int it, if you you open it with a hex editor or heck , even notepad you will find CIL code or machine code.
if you want to get the source code of an application you need to conduct reverse egninerring which is a realy complicated process.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 6-Apr-11 3:59am    
Yes. LOL. My 5. For OP - not feasible; see my Answer...
--SA
Albin Abel 6-Apr-11 15:44pm    
Think so, feasibility is a question thats what Microsoft hopes.
You are talking about Reverse Engineering.. From your exe you can disassembly instructions and see directly machine code of your exe, but, this probably will not be enough.. To have a view of high level structure of your code you need a reverse engineering tool.. see google
 
Share this answer
 
It already exists. Search for Reflector and google shall reveal it to you. :)
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 6-Apr-11 3:58am    
I never know Reflector can generate C# code... can it, really?
--SA
dan!sh 6-Apr-11 4:07am    
Yes it can and not just C# but VB.Net and I think J# and F# as well.
Sergey Alexandrovich Kryukov 6-Apr-11 4:20am    
OK, thank you for information, good to know. My 5.
--SA

P.S.:
By the way, thank you very much for your good words here: http://www.codeproject.com/Messages/3841469/A-big-thank-you-to-SAKryukov.aspx
dan!sh 6-Apr-11 4:27am    
That's well deserved. You sure are a great help here.
Sergey Alexandrovich Kryukov 6-Apr-11 16:19pm    
Thank you.

Remember, sometime people ask about translation between different .NET languages?
This could be another way: build a project in one language, generate in another one. Well, comments would be lost, but -- some solution, not worse than the original reverse engineering problem.

--SA

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