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

863 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

> 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?

It’s not necessarily “difficult” – decompilers exist that can reconstruct some kind of source code from an executable program or library.

Decompliers often don’t produce *great* source code though – some languages have better reverse engineering tools than others but in virtually all cases comments in the code are going to be lost, and often variable names will be lost as they’re optimized out of the compiled code. A skilled programmer can still read the results and tell you what the program is doing, even copy and modify it themselves, but at a certain point you’re better off black-boxing it (have your programmer use the program, trying various inputs and noting the outputs/behavior, and write one that does the same thing) or doing a clean-room implementation (take a programmer who has never use the software, explain what you want the program to do, and let them write it from scratch) versus trying to reverse engineer a large, complex system.
(For example it would almost certainly be easier to write a new word processor than to reverse engineer Microsoft Word.)

Some (badly-compiled) programs may even *include* their source code – I’ve seen more than a few closed-source Java programs that had their source files buried inside the .jar file – all you need to do is open the archive and look around.
In cases like that you run up against the *real* deterrent – which is legal, not technical: I can *always* copy the program outright, because it’s a digital file. Software piracy is still a thing that happens.
I can even hack the executable to bypass license checks and the like – that’s often much easier to do than decompiling or reverse-engineering the code since you just have to run the code in a debugger, find the function it’s calling (which the debugger will help you do), and skip the actual *checking* part (which the debugger will *also* often help you do).

If I do those things – especially if I then distribute my modified copy – the folks who wrote the software and are selling it for money will sue me if they catch me, and they probably have a much larger supply of both money and lawyers than I do.

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