what Avast does or can do if needed is “emulate a malware code”, ie simulate it in a safe environment

If the box "use code emulation" is checked and avast! detects some suspicious code in a file, it will attempt to run the code in a virtual environment to determine how it behaves. If potential malicious behavior is detected, it will be reported as a virus. Running the code in this virtual environment means that if the code is malicious it will not be able to cause damage to your computer.

ps: what’s been formulated by tech as “final code” is just software code, what you got running on your system. Not the source code obviously, but that’s still code, what else ???