Oliver Nordestgaard Posted April 11, 2019 Share Posted April 11, 2019 Hi, I recently started creating a program for which i wanted my source code to be hidden, but discovered that in .NET this is not possible (to my knowledge), without external tools to obfuscate the code. I found out that more than a few developers, that don't have their source code available, have not obfuscated their code, meaning that the actual source code can be extracted using programs such as dotPeek. The source code that can be extracted includes the actual variable names and even comments. I saw that you had closed your source code because of copycats, and seeing as Paint.net is "affected" by this, i thought you wanted to know. I personally find confuserEx to be quite nice to circumvent this. If you are aware of this, or don't care, then feel free to ignore this Link to comment Share on other sites More sharing options...
Rick Brewster Posted April 11, 2019 Share Posted April 11, 2019 Yes, I'm fully aware of all of this. "Extracting" the source code isn't actually that simple. You can study it in a disassembly with dotPeek or Reflector, but you won't really be able to make changes and rebuild it. Even if you tell it to emit a directory structure full of .CS files. The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Oliver Nordestgaard Posted April 22, 2019 Author Share Posted April 22, 2019 No you can't just study it in disassembly - it's the actual source code including comments and original variable names. See the following example of your code. If still in doubt choose a class with a comment or something Link to comment Share on other sites More sharing options...
BoltBait Posted April 22, 2019 Share Posted April 22, 2019 While C# decompilers are pretty good, they are not perfect. In the code example you show, those are not the actual variable names used in the real code. And, without those names, the code is actually more difficult to understand. And, no, comments from the source files are not saved in the executable so the decompiler can not produce them. While function names are preserved, variable names are lost and so are lots of other things. Sometimes commands are changed (like from "switch" to "if then" blocks, etc.) Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Oliver Nordestgaard Posted April 22, 2019 Author Share Posted April 22, 2019 In my own example i would get the following - have you done anything so that is not the case? The variable names are an exact match Link to comment Share on other sites More sharing options...
BoltBait Posted April 22, 2019 Share Posted April 22, 2019 If you are decompiling a debug build with associated .pdb file, it may be possible to get the actual variable names. Not for a release build. Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Oliver Nordestgaard Posted April 22, 2019 Author Share Posted April 22, 2019 i can see that - thanks for the info and sorry for the bother Link to comment Share on other sites More sharing options...
BoltBait Posted April 22, 2019 Share Posted April 22, 2019 No problem. I'm just going to close this... Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Recommended Posts