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

849 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

What we use as “code” is different from what the computer uses.

A programmer might “speak languages” like C++ or Python, but the computer only speaks in instructions, which are exact commands on what operation to do, like store a number on this address or add the number from this address to another address.

The languages like C++ allow us to write code in a much more human comprehensible format, but they then need to be translated, so that the computer understands them. This is a one way translation however. You might declare a variable and name it, so that you always know what it represents in code, like

“`
float playerHealth = 100f;
“`

When you translate the code for the computer, or compile the code, the name for the variable gets lost, because it serves no purpose. The computer stores the player health at a specific address and that’s all it needs to know, where it is. Storing the name would just take up space. So when you translate the code back (decompilation, not an exact process), the names are gone. And so much more stuff is gone, compilation is a lossy translation.

[This video about decompiling Lego Island](https://youtu.be/MToTEqoVv3I) might be a bit more technical, but it shows it nicely.

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