i just wanna know if there is a way that the source code of an application written in C# can be known.
It is because i am making a small application but i don't want someone to know the source code and change it.

and if it can be known, is there a way to protect the source code? like encrypting it for example?

Thank You.

Animal

When you compile a program, the source-code is quite difficult to extract. It is possible to decompile some programs, but it is very difficult and requires specialist knowledge. The more complex a program is, generally the more difficult it is to decompile. Usually by compiling the program it is sufficient to protect the source - this is all commercial companies do.

root

Yah there really is no need to worry about that because compiling the source is enough to stop the average user. Of course, there are people who can decompile your program. But those people are gonna be too busy decompiling other pieces of software (like Windows) to even think about decompiling yours. In all, you source code is protected.

photon

getting the exact source code from a compiled program is pretty tough. and there is no guarantee that it can be done. at most one can change some parts of the program, and that too requires very strong knowledge of how s/w works, decompiling, assembly language, etc..

Ironz

thx a lot, i guess i'll just compile it then.

btw i have the Dotfuscator, and from what i've understood, it does something to the source code so it's harder to know but what does it really do?

yjwong

If you want to replace images or pictures, menus, dialogs and other things such as the windows logon background and the bootskin, you can use a resource hacker. Just do a Google search on "Resource Hacker" and you will find it. I used it to replace my logon background.

Mgccl

Using math, we can prove decomplie won't get the exact soruce code. But who cares, just let open source go everywhere

ocalhoun

Mgccl wrote:

Using math, we can prove decomplie won't get the exact soruce code. But who cares, just let open source go everywhere

True, closed source programming is immoral.

mj_loc_nl

Ironz wrote:

hey,

i just wanna know if there is a way that the source code of an application written in C# can be known.
It is because i am making a small application but i don't want someone to know the source code and change it.

and if it can be known, is there a way to protect the source code? like encrypting it for example?

Thank You.

Hi Ironz,
When you compile source code to binary code (machine readable / not human readable) there are ways to de-compile this (reverse engineering) and people will be able to view your code and make changes in it, compile it again and use it with the changes they made…. And yes there are ways to protect you against this; you can copyright your code without having to share the code itself.

However, why do this? Why do you not want other people to be unable to review your code? Why should other people not have the possibility to make changes and possibly improve your code? You can “copyright” it under GNU/GPL which is giving the source code to the public so other people can review your code, improve it and share those changes with you. So instead of locking the sourcode for the rest of the world you open it and you will give access to a lot of other coders who can help you to improve this.

The application is called Reflector and it can decompile an app to it's C#, VB.net, or even Delphi.net code...very cleanly and easily!

Reflector can also decompile the .dot framework itself and give you better documentation than what is provided by Microsoft. So if you are programming in C# or any other .net language, it's definately worth a look at it.

His post has a lot of info on it, how to use it to your advantage as a programmer, and a link to where to get it.

cyph33r

There are ways to encrypt your compiled code that make it almost impossible to decompile or reverse engineer. This can be achieved with obfuscation and there exist products that will do this for you.