When you buy software, the source code usually is not made public, but doesn’t your computer still have to run the code to use the software? How can it run the code without allowing the user to see the code?

877 views

When you buy software, the source code usually is not made public, but doesn’t your computer still have to run the code to use the software? How can it run the code without allowing the user to see the code?

In: Technology

12 Answers

Anonymous 0 Comments

With the assistance tools available today I think most runcode is close to 100% dis-assemblable. Piece by piece maybe. With lots of hands on and enough talented people working hard enough with these tools, you’ve pretty much got the software in hand.

But what then? That code was likely generated by a higher level of authoring (or multiple levels) that included all kinds of labelling, comments, documentation. There may be complex encryption keys that would be as hard to break as the disassembly itself. It’s unlikely you’re going to be able to do much in the way of editing or modifying or customizing the software (which is the point) without that guidance

Anonymous 0 Comments

Say you have some source code… in your source code is the line “if playerhealth<0, gameover = true.” Seems pretty easy to understand.

Now the compiler will convert that into binary. It will look something like this “010111000101010010.”

You can decompile it, but the compiler through out all of the variable names and just gave them numbers, so now you’re left with
“If AE0<0, 0F1=1”

Now maybe you can play around with the game and the code, and eventually you’ll figure out that AE0 means playerhealth and 0F1 means gameover… but you’ll have to do this with hundreds or thousands of variables. It would be a daunting task for any modern software, to say the least.

Anonymous 0 Comments

The source code is like a blueprint to make a car. The blueprint describes all that is needed for the factory to build the car, and the source code describes all the instructions for the *compiler* to build the software.

The finished product, the software, doesn’t need to know how to *make* said software, it just tells your computer how to *run* it – just as a car doesn’t tell you how to run a factory to make the same car.

A little more in depth: source code compiles into *assembly* code and it’s this that your computer runs (essentially just a bunch of instructions on what to display on your screen for given inputs).

Source code is written in a way that’s easy for humans to understand and therefore big projects can be achieved in a relatively small amount of time – but the assembly code this compiles to is much more complicated and not so easily understood by your average programmer.

Anonymous 0 Comments

The code is compiled into machine code, a language that your computer can read and understand. You could try to read the machine code and understand what it does – that’s [reverse engineering](https://en.wikipedia.org/wiki/Reverse_engineering) – but it is a difficult process. For example, the original source code contains a lot of data that is only useful for the programmers, such as comments and function and variable names, which are stripped when the code is compiled. Sometimes the code might even be [obfuscated](https://en.wikipedia.org/wiki/Obfuscation_(software)) which adds another layer of complexity to the code.

Besides, “open source” usually doesn’t just mean that the code is available, it also means that the code is legally free to use (with or without certain limitations).

Anonymous 0 Comments

The code is usually encrypted by the compiler, so the user doesn’t see the details of the code.

In any case, the license to run the program, purchased when you bought the CD or account, means that you have the right to have access to the code as is required to run the particular program. In most cases, that is the compiled software, but occasionally that can be uncompiled code.

Anonymous 0 Comments

The computer doesn’t run the software directly from the source code. At least not with most programming languages.

With something like C++ the source code is “compiled”. Which means it gets converted into machine code, which is what the computer can actually execute.

This is a one way process. Lots of contextual information is thrown out, so it’s impossible to convert it back into the source code. It’s theoretically possible to convert it back into valid source code, but it wouldn’t be the same as the actual original code and it would be very difficult to make sense of.

Anonymous 0 Comments

The software you buy is in machine code, not the human-readable programming language that you might be familiar with. While software is written in a programming language, it has to be converted to machine code (the term is ‘compiled’) for it to actually run. Machine code can be read directly by your computer’s CPU. I feel like people tend to go overboard with the explanations on this one.

Anonymous 0 Comments

There is a difference between human and machine code. Machine code is what the computer reads, which is mostly useless junk to a human. Human code is the kind of code that we can read and understand but needs to be translated to machine code for the computer.

Anonymous 0 Comments

The code you run is computer-readable. It’s incredibly optimised towards making things fast for the computer to do, not easy for a human to understand.

The original source is the complete opposite.

To get from the former to the latter is possibly one of the most difficult tasks in computer science, and even for the best programmers. Reverse-engineering published code is simple, right?! So we’re all running Windows 7 reverse engineered back to run on a Mac, aren’t we? No.

It can take *decades* of effort to reverse-engineer mere years of work, and when you’re talking about anything substantial, the man-years of work involved in the creation are enormous. We haven’t properly reverse-engineered the Windows file-sharing components, not the Active Directory (i.e. logon server) components yet. Samba Project has been trying to do that for about 20 years now, and even received documentation (not source) from Microsoft to do it, under an EU court ruling that said they had to.

It’s more akin to un-scrambling an egg… uncooking it, unravelling it, reassembling it back into something that resembles the original egg.

And worse: You’re doing it blind. You have no idea what’s code, what’s data, where the boundary lies, what the code-paths are, what any of the instructions are trying to achieve, how they’re doing it, what the original code looked like, or what anything was called. All you see is a bunch of millions of numbers modifying each other. The computer loves that, that’s what it was built for. Humans have the worst time interpreting that.

And you need to be an expert programmer, in both the language it was written in, the compiler that was used, and the machine language that it ended up with, to even *begin* to start on it. Even old 1MByte DOS games that sold millions of copies 20+ years ago haven’t been reverse-engineered yet. The number of people skilled enough to able to do it, the number of those able to devote that amount of time to it, the number of those that will happily do it for free, the number of those that *want* to do it, and the number of such other things that – with those skills – they’d rather be doing: it all combines to make it a rare and unusual thing to even start.

If a game took a team of people 5 years to write, assume it would take a similar team of people 10 years minimum to reverse-engineer. And then… what? You expect them to give the source away for free after 10 years of working 9-5 on it? And you expect not to get sued by whoever owns the rights to the game in the first place?

Reverse-engineering software is, sadly, a true waste of an enormous talent that is better put to making new things. Even emulators and the like are incredibly difficult to write, and that’s when you know everything the machine can do and can just follow books on how the chips operate. Reverse-engineering machine code back to usable code is really a dark art requiring incredible skill – which is why most people just run an emulator if they want an old game. It’s easier to write an emulator that it is to reverse-engineer. And most programmers probably couldn’t write a decent emulator.

Anonymous 0 Comments

Computer languages (C++, C#, python, etc) exist only to offer up an interface for humans to communicate instructions in a readable manner to a device.

Once a program is written and compiled they are turned into machine code and specifically Binary. You can view these instructions but it’s not easily readable and to actually convert it back to something that is readable you need to reverse engineer the code, that can be difficult to do and take a while to do.

So the code itself is not executed its the instructions created from the code.