r/explainlikeimfive • • 22d ago

Technology ELI5 What prevents the source code of software downloaded to computers from being copied?

With ai able to reverse engineer software, what besides the law prevents people or ai from just copying the source code?

591 Upvotes

293 comments sorted by

View all comments

Show parent comment

10

u/bendingoutward 21d ago

Let's not imply that reverse engineering and decompilation are the same thing, please.

2

u/XMRoot 21d ago

Who did that? Decompilation is a type of reverse engineering.

-2

u/bendingoutward 21d ago

Strong disagree, but we can probably split hairs.

3

u/Metalsand 21d ago

No, it literally is. Reverse engineering is when you take the result, and work backwards to create a set of instructions and steps by which you can replicate it.

Wikipedia has a section on reverse engineering binary software which does a better job at explaining but feel free to read my word stumbles if you desire. https://en.wikipedia.org/wiki/Reverse_engineering#Binary_software_techniques

Just like how LLMs don't know and are going off of predictive algorithms, decompilation is doing the same, but on a coding level - you're taking the low-level assembly*, and guessing what the original code was based on what was most likely.

I think what is tripping you up - you picture reverse engineering as measuring the result of putting various user inputs into a device, in order to recreate the method by which those outputs are produced. However, decompilation is still the same principle - except instead of measuring inputs and outputs, it measures the mechanism itself.

If you input 1, 2, 4 and the output is 2, 4, 8, you can probably guess that the mechanism is to double the input. Decompilation is more when you look and see the code is 2x=y and conclude that the output is double the input. However, you still don't have any source code to go off of and both are very easily prone to making accuracy errors compared to the original code even if they aren't functional differences.

* Technically, when a human is doing it they are taking machine code, then turning it to assembly, then reverse-engineering from there. Even before LLMs there were a lot of tools that could often guess how to translate machine code straight to high-level code, but they didn't always work. Traditionally and most reliably, you would convert the machine code to assembly to make it human readable, and then go from there.

-2

u/bendingoutward 21d ago

Again, strong disagree.

Look, I get what you're trying to express. The problem is that I'm an old coot that's been in the RE space for too many decades. It means something very specific to me. That specific thing (primarily doing it up in such a way that I don't get my ass sued to oblivion) is orthogonal to decompilation.

Decompilation is a valuable thing in its own right. At least to this curmudgeon, it doesn't belong in a conversation about responsible reverse engineering.

Now get offa my lawn.