Why can't we extract source code from executable file?

时光毁灭记忆、已成空白 提交于 2019-12-12 18:40:16

问题


I need some information on executable files, thanks in advance, this is a new topic in our grade.

I've seen a lot of questions asking how to extract, but my question is why can't we get the original source code? Yeah using decompilers we can extract but those codes are not the exact code used to develop the program.
I mean, if a computer is running a software it obviously has to have some code to refer from, then why can't we get that code? Also, do exe files have the same code which is developed by the programmer? Is it that OSs are developed in such a way that they don't leak source code from an executable file?


回答1:


The .exe file is made up of binary numbers which consist of 1's and 0's. And these files contain some additional code that support code from many source. Operating systems use binary languages to operate, this is what we call machine code. (Getting the code back from the exe is like getting the apple back from the apple juice) ;)

Also check Compiled vs. Interpreted Languages




回答2:


The process to transform the source code into the exe file is extremely complex.
For example, when it is being compile, the language of the source code (eg. c++ etc) is transformed into machine code. It is like when you eat something, those things turns into feces after being process by your stomach. Therefore it's quite impossible to revert exe file to source code.



来源:https://stackoverflow.com/questions/24283493/why-cant-we-extract-source-code-from-executable-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!