Antivirus False positive in my executable

It is surprisingly common that Delphi applications are reported as (potentially) harmful by AV applications. It happened to me a while ago, using Delphi 2009, see http://en.wikipedia.org/wiki/Wikipedia:Reference_desk/Archives/Computing/2010_March_20#Delphi.2FAVG_Issue. At SO, we also have Virus in Delphi 7 Accidentally created a virus? and many more. It might be the actual Induc Virus. But most likely, it is … Read more

what’s in a .exe file?

MSDN has an article “An In-Depth Look into the Win32 Portable Executable File Format” that describes the structure of an executable file. Basically, a .exe contains several blobs of data and instructions on how they should be loaded into memory. Some of these sections happen to contain machine code that can be executed (other sections … Read more

Compile a Standalone Static Executable

Use the following flags for linking -static -static-libgcc -static-libstdc++ Use these three flags to link against the static versions of all dependencies (assuming gcc). Note, that in certain situation you don’t necessarily need all three flags, but they don’t “hurt” either. Therefore just turn on all three. Check if it actually worked Make sure that … Read more

Why are “Executable files” operating system dependent?

In order to do something meaningful, applications will need to interface with the OS. Since system calls and user-space infrastructure look fundamentally different on Windows and Unix/Linux, having different formats for executable programs is the smallest trouble. It’s the program logic that would need to be changed. (You might argue that this is meaningless if … Read more

Do ghc-compiled binaries require GHC or are they self-contained?

GHC does produce stand-alone binaries that do not require GHC itself to be installed, however they do link against some dynamic libraries, most notably libgmp. The remaining libraries are commonly found out of the box on most Linux systems. I believe the situation is similar on Windows. You can check which dynamic libraries you depend … Read more