(...)my teacher was talking about the differences of interpreted languages and compiled languages and pointed out that interpreted languages could have their code stolen, when in compiled it does not happen(...)
I’m going to give the benefit of the doubt to your teacher, and I’m going to assume that statement got here that way because of the wireless phone.
If you have a program on your computer, you have the source code. No exceptions.
The build process generates executables or libraries (for example, files .dll in Windows), which are files said "in machine language" rather than human-readable text. In fact, if you try to open these files, you will see that they are unreadable and do not match the source files. However, take this information to life: there is no compiled source code that cannot be decompiled.
Want an example? Use C# to generate an executable or file .dll. Then open the file with the Ilspy.
There are some people who believe that you can make the code more "protected" if you use a technique called obfuscation, which "scrambles" the decompiled code generated by tools like the one I mentioned above. But even obfuscation doesn’t protect anyone from "theft", since a really motivated and dedicated programmer can reassemble the original code anyway.
The only way to ensure that a source code will ever be read is not to hand it over to anyone. Leave the code on a server and ensure access to your system over the internet. Only those who have access to the server’s hard drive will have access to its source code. It’s not 100% safe, but it’s as close as you can get.
Relevant issue: someone commented on that in this reply:
But if any program can be "recompiled" because we do not have windows source code for example?
Look child, we have yes. It’s actually quite hilarious. My favorite is the Windows 2000, which has several pearls written in the comments in the code. Good reading :) (crossed out because this code was leaked, not obtained via reverse engineering, and comments are not included in compiled code).
For example, and again talking about Ilspy: many things in Windows use . NET, which is currently embedded with the system. You can open Ilspy and use the option File -> Open from Gac to see the source of the platform’s key libraries.
For other system libraries, you can try a C/C++ decompiler such as Snowman. But try to open only small DLL’s, otherwise the system hangs (to open large DLL’s, you need a plugin). Tip: On Windows 8, you can try to decompile this:
c: windows system32 Alttab.dll
About antivirus, they don’t care about their source code - they see the actions your program performs, regardless of how it was written. Every program interacts with the operating system through requests, requests... I.e.: Windows, tell me what time it is; Linux, send the byte 00101000 to serial port 2; Solaris, write it to this memory address etc.
The antivirus specifically looks for programs that do maracutaias of the type:
- try to read browser program status;
- impersonate a user to perform operations that require action by a human being (such as pressing the OK buttons on Windows permission requests);
- force actions for which there is no permission;
- send data to known malicious web addresses;
Etc., etc., etc....
This involves pattern identification and currently involves somewhat artificial intelligence.
One sad fact is that from time to time I see someone asking here at Sopt how to do something that will clearly be seen by antivirus as an action of malware. For example: Simulate "ok" via command line. Often people don’t think about the consequences that certain actions would bring to people’s security and privacy if possible.
See also this about how Windows recognizes an application as safe: Installer recognized as a virus.
This explanation about the "theft" of the compiled and interpreted, as much as I understand the "motivation" for him to say this, is very crude. It would fit well in a bar conversation, explaining to the grandmother (if she goes to the bar), but in a college it worries me a little. About Antivirus, the code is irrelevant. Detection is usually made by other features, such as fingerprinting, i.e., passages known from the executable in a table of definitions, and behaviors during execution.
– Bacco
I’m not sure, but in my guess the anti-virus does not look at the code of the program to know if it is ill-advised or not, it should use another parameter, but I can not say what is this parameter.
– Leandro Lima
@Leandrolima see Bacco’s comment.
– Oralista de Sistemas
Your question has already been very well answered by Renan, I am sharing a link about the difference between languages interpreted and compiled to complement your study: https://answall.com/questions/77070/difficult-compiledlanguage
– Caique Romero