Codes... Sources


shah

Member
Joined
May 15, 2003
Messages
180
Forgive me for my intelligence, but i have always been interested between the definitions and what is:
1) Code
2) Source

As you can see i hear that Black and Gifel lost their PCE Source..

NOW: My thinking is that they obviously programmed the produce in say C or another language right. The then some how convert it to an .EXE or a similar GP32 file. and hey presto it runs. I understand theat the machine interprets the codes (Written in C) and translates them to machine code and then follows the instruction.

NOW: Why cannot some one get the PCE file and "Decompile it", i'e break it up and hence get back to the original code...? I cannot understad why not, so i would be very interested and like to be educated on this.

Many thanks.

Shah
 
I don't think that is possible. Even if it was, you can't legally decompile anything without the authors approval. Thats why nothing can be ported without the proper source code, unless its coded from scratch.

I also believe that source and code are the same thing, thats why its called source code.
 
shah posted on Dec 22 2004 at 08:23 PM said:
Forgive me for my intelligence, but i have always been interested between the definitions and what is:
1) Code
2) Source

As you can see i hear that Black and Gifel lost their PCE Source..

NOW: My thinking is that they obviously programmed the produce in say C or another language right. The then some how convert it to an .EXE or a similar GP32 file. and hey presto it runs. I understand theat the machine interprets the codes (Written in C) and translates them to machine code and then follows the instruction.

NOW: Why cannot some one get the PCE file and "Decompile it", i'e break it up and hence get back to the original code...? I cannot understad why not, so i would be very interested and like to be educated on this.

Many thanks.

Shah

1. Code are the commands and variables used in a programming language.
2. Source is a basically a list of commands and variables in plain text (depending on the programming language, where C is the most common for sure).

i.e. PRINT "Hello World!" is some code for one of the simplest languages around called BASIC.
If you run it, it will print "Hello World!" on the computer.

A source is made up of code, that's why you also call it a sourcecode.

A compiler translates that code into the only language a computer / console understands: Assembler. You can also directly code in assembler, but that's pretty hard (since you don't have easy commands like the one I mentioned above) and assembler code ONLY runs on the machine it is intended to run. So it's impossible to code for different platforms at once, whereas in C or other languages you just have to optimize the code a bit for a different computer / console and recompile it.

Now about the decompiling:

Assembler doesn't have that much commands. Basically, you're just turning registers in the CPU on and off. If you compile a C language, it gets translated into different assembler commands. But as you don't have that many commands in assembler, it's nearly impossible to translate it back.
Even if you DO translate it back, it would be a pretty messy code which is nearly impossible to optimize again - rewrite the whole thing would be faster...
 
Last edited:
What you have to understand is that code is not interpreted, it's compiled into directly executable code.

The difference is, that this code depends on what compiler you use, how it was set up, and also that the compiled executable contains not only the program, but also the data or some parts of it. And it can also be packed (it can un-pack itself at the beggining, thanks to Mr Spiv for that).

So disassembling a program is quite difficult, because you have to know if the program is compressed, where the program starts in the file, where it ends...
And even with that, there are tons of assembler combinations that can be generated from one c code.
 
Back
Top