Originally posted by ksoma
I was wondering if anyone knew how to view the source code for a program in Windows. I've used something called Dependency Walker which shows all the functions in the .dll and all the other functions necessary for the program to run. I was wondering if the source code is almost always hidden from the user and if it is, is there any way to get around that? I'm not too knowledgeable on this topic, so any feedback should help. I appreciate it.
No, you cannot view the source of a program by having the binaries. When you create a program you use the source and a special program called compiler, and the compiler creates assembly code out of the source and then another program the assembler created machine code out of assembly code. The machine code is actually assembly code, with every command being transformed into its opcode, which is a sequence of 1 and 0. The machine code is what the computer recognizes. The task that the assembler does is easy. if you have a command
<command> <value> <value>, what the assembler does is just put the corresponding opcode for the command and transform the hex values into binary values: e.x. 26 in decimal is FA in hex and 111111010 in binary. SO this task is reversible. You can see the assembly out of a binary (executable) file. But the task of creating assembly code out of source is a very hard and advanced task. Different compilers will create different code. This task is not reversible. This is why we talk about open sourced programs and close sourced programs. When a program is open sourced, it means that the source code is provided to anyone who cares to see it.