: How can software remain close-sourced?



Ever since I heard about open-source source software, I had a question as to how can a piece of software remain completely discreet in its internal functioning even while being present on a computer?

In simple words, all the files of the software are present on the computer, so why can’t the source-code of it be *extracted* in some way?

If that is not possible, then how come crackers/patchers *crack* a software to function without a license? (Because I reckon they would need access to the code in order to modify its functioning.)

Thanks in advance.

In: Technology

I’ll put it this way: think of open-sourced programs like a bakery that lets the customers look at its recipes, and closed-sourced programs like a bakery that doesn’t.

You can’t just rename a source code file to an .exe and expect it to run the same way you can’t expect to bite into a recipe and have it taste like bread. It has to be compiled first.

And after it’s been compiled, trying to extract the code from a compiled program is like trying to extract individual ingredients from a loaf of bread. The compilation process transforms the human-readable code into a usable form, just like the baking process transforms the ingredients into an edible form.

Edit: And while I don’t entirely know how cracking works, they don’t have to reverse-engineer the entire program; just the protection mechanism. Think of it like picking a lock, as opposed to rebuilding an entire house.

This is a really great question.

You’re absolutely right that technically if the software is present on your computer you can read it and see what it does, and therefore you can modify it. You’re absolutely 100% right. It is possible to do this, it’s just hard.

Source code is like the same thing but human-readable. It has function names and variable names in English, it has comments, it’s divided up into different files that do different things.

Compiled code – the stuff that the computer actually runs – has no structure at all. It’s one gigantic string of low-level instructions with no names or comments.

Yes, you can “decompile” compiled machine code into a readable computer language. But you’ll never get the structure, organization, and text back.

With a lot of patience and cleverness, you can try to find critical pieces of the software and modify them, but it could take dozens of hours to figure out how to make a change that would take minutes if you had the actual source code.

Another crazy analogy: let’s say that you’re the conductor of a city orchestra and you want to perform the theme from Star Wars. [You could buy the sheet music for just $85 online and play it, easily.](https://www.sheetmusicplus.com/title/star-wars-suite-for-orchestra-deluxe-score-sheet-music/3979685)

If you wanted to transpose it into a different key, that could be a big challenge. If they gave you the sheet music electronically it could take minutes. If not it could take a music student 50 hours to recopy the sheet music while transposing it.

If you didn’t want to buy the sheet music, a good musician could listen to the recording and try to reconstruct it, but it’d be extremely time-consuming – like months of work – and the end result wouldn’t perfectly match the original in some obscure places (though it might be so close that nobody could hear the difference).

Basically, anything’s possible given enough time and effort – but many things just aren’t worth it.

Source code is important because it’s written by humans, for humans to read. There is 70 years of best practices and standards and such that have been developed to make complex programs as easy to read and understand their functionality as possible, for humans.

When you compile source code into an executable, generally you expect all that loving craft and attempts to give pleasant experience get all discarded. Computer does not want to understand any bit of the code, it just wants to know what instruction to run next.

There are some un-compilers that try to reverse this process, using knowledge of what sorta common structures usually result in what kinda executable, but there are still things like names that are irreversibly lost, and it’s still only an approximation.

So yeah, it’s possible to reverse-engineer things, but it’s presenting all kinds of frustrating additional difficulties and ultimately require you to kinda re-build the software yourself.

Source is more than just the functional part of a program. It’s also the Humana readable text comments, naming of the functions, naming of the variables that help the source code to be readable

//add a number to a sum

loop (






is much easier to read than

c=func(a,b) (








jump _a

In the same way that if you buy a cake, you can’t extract the original recipe from it.

When you buy a piece of software (or technically, a license for it), you’re not getting the source code. You’re getting the software that was built from the source code, kind of similar to how a cake is baked. The recipe isn’t inside the cake, and the source code isn’t inside the software. The source code is just a set of instructions for creating the software. Those instructions were executed on the developer’s computer, which created the program. The instructions never left that computer, just like the recipe never left the bakery.

You can certainly make guesses about the recipe, and with enough work you might be able to recreate *a* recipe which creates a very similar cake. But you can’t get the original recipe just from cutting open the cake.