Why is it so difficult to copy source code that is not “open source”?

884 views

It’s been in my mind if we are using the software/program or even hardware of a tech company, we can play around, install-unsinstall and more. Then how is it so difficult for someone to “unhide” the source code that the device uses? Technically the code is in the device somewhere hidden in it, so it’s there, but still, it’s almost impossible to obtain the source code. How do they achieve this so no one copies their code?

In: 366

42 Answers

Anonymous 0 Comments

Many people are saying source code is different than compiled executable, but they’ve forgotten about .Net. Java should be the same too, but I’ll talk about .Net.

.Net is not compiled to assembly, but instead an intermediary CLR Common Language Runtime. This code is executed by the .Net runtime.

So you can very well decompile code with a product like JetBrains DotPeek, but what you get out of it depends on how it was compiled. CLR is still fairly readable, and just as easily converted back to C#.

A proper Release build would enable optimizations, where the compiler will minify code, renaming variables and changing many human-readable blocks to obtuse Boolean statements. Code comments are also lost.

But can you reverse engineer this code and understand it? Yes, with enough time. But you can usually make any small tweaks you want, and recompile, in mere minutes.

Now enters Obfuscators. These compiling tools really mix up code, moving around logic blocks, variable names, and so on. Their purpose is to make code reverse-engineering more difficult. Nonetheless, you can still decompile them, make any small change if you can manage to figure it out, and then recompile.

Now enters code signing, you’ve create a new DLL but you lack the signing keys of the original so you can’t just drop it in under an exe, it demands trust. So you just recompile the exe itself, and run a stack of bootleg compilations.

Anyways, go get JetBrains DotPeek and decompile some of your video game files, you’ll be surprised what you get. Now if the game was written in C/C++ there’s no hope. We’re talking about .Net C#, but that’s most Unity games.

You are viewing 1 out of 42 answers, click here to view all answers.