title: My programs are blocked by Avast Antivirus
body: <p>I'm an amateur programmer, and I'm getting desperate and mad because of a big issue: most of my programs are blocked by <a href="https://en.wikipedia.org/wiki/Avast_Antivirus" rel="nofollow noreferrer">Avast Antivirus</a>, while some aren't, and I don't understand why.
  The more I try to investigate, the less I understand what the problem could be.</p>
  <p>I'm requesting your help to find a solution so that my programs are no longer blocked, or, as a default, at least some strong clues that would explain why it might be the case.</p>
  <p>There are already many topics about that on the web. However, most of them give only superficial answers: they just explain how antivirus software works with signatures and detection heuristics, or state that you just have to add the offending application in the white list without asking any other question. While it is certainly correct, it's not acceptable answers in my sense, because I'm still left with my own programs that refuse to work without any concrete idea to start investigating.</p>
  <p>First of all, the only antivirus software that blocks my programs is Avast 7.x. No other antivirus software see any inconvenient to run my software. Secondly, I haven't installed Avast myself; it is installed on a friend's machine.</p>
  <p>I have <a href="https://en.wikipedia.org/wiki/Windows_7" rel="nofollow noreferrer">Windows 7</a>, and he has <a href="https://en.wikipedia.org/wiki/Windows_XP" rel="nofollow noreferrer">Windows XP</a>. I'm completely sure that the problem is avast only: when it is temporarily disabled, or if the program is added to its white list, everything works nicely as expected.</p>
  <p>Three different programs are in trouble:</p>
  <ul>
  <li>A text editor, with the goal to replace Windows <a href="https://en.wikipedia.org/wiki/Notepad_%28software%29" rel="nofollow noreferrer">Notepad</a> while keeping simple, efficient and customizable</li>
  <li>A small amateur audio player very simple to use</li>
  <li>The client program of an online game platform, currently having more than 1000 users</li>
  </ul>
  <p>The first one is open source, and I can give a link to the executable and the source code if needed. The two others are closed source but free to use, I can give a link to the executable of the current version only.</p>
  <p>The only obvious common things between these three programs are me as a developer, my Windows 7 machine that compiled them, the compiler family which is MinGW/GCC, and they are all <a href="https://en.wikipedia.org/wiki/Windows_API" rel="nofollow noreferrer">Win32</a> GUI applications without any framework (no <a href="https://en.wikipedia.org/wiki/Microsoft_Foundation_Class_Library" rel="nofollow noreferrer">MFC</a>, no <a href="https://en.wikipedia.org/wiki/Windows_Presentation_Foundation" rel="nofollow noreferrer">WPF</a>, no <a href="https://en.wikipedia.org/wiki/Qt_%28software%29" rel="nofollow noreferrer">Qt</a>, <a href="https://en.wikipedia.org/wiki/WxWidgets" rel="nofollow noreferrer">wxWidgets</a> or whatever; just pure Win32/C GUI applications).</p>
  <p>Here are my observations and thoughts so far:</p>
  <ul>
  <li>Versions 1.1, 1.2.1 and 1.3 of my text editor are blocked. They are in C, not C++, have been compiled with GCC 3.4.5 in Unicode mode, and are distributed in portable ZIP files (by portable, I simply mean no installer and no installation needed)</li>
  <li>Version 1.4.1 of the same text editor isn't blocked. It has been compiled with GCC 4.7.2, still in C and not C++, still in Unicode mode, and still as a portable zip file</li>
  <li>All versions of my audio player are blocked; they are in C++ with 0x features enabled, have been compiled by GCC 4.7.2 in ANSI mode, distributed in portable zip file</li>
  <li>The current version of my game, 1.7.2, isn't blocked. it is in C, has been compiled with GCC 3.4.5 in ANSI mode, and is distributed as an <a href="https://en.wikipedia.org/wiki/Inno_Setup" rel="nofollow noreferrer">Inno Setup</a> 5 installer.</li>
  <li>The new version of my game, 2.0.0, which is currently a private beta, is blocked. It is in C++ with 0x features enabled, has been compiled with GCC 4.7.2 in Unicode mode. I share it with my private beta-testing team as zip files within a private <a href="https://en.wikipedia.org/wiki/Dropbox_%28service%29" rel="nofollow noreferrer">Dropbox</a> folder</li>
  </ul>
  <p>The problem is caused by Avast 7.x auto-sandbox. The following happens when one try to start a program disliked by avast:</p>
  <ol>
  <li>The user double-click or hit enter on the executable</li>
  <li>The program starts, but it is almost instantaneously and forcibly crashed by Avast</li>
  <li>A pop-up appears and says something like: Avast has put this program into its sandbox because its reputation is low</li>
  <li>If one clicks on the continue button of the pop-up, the execution of the program is restarted and works normally</li>
  <li>If one doesn't click on the continue button, <a href="https://en.wikipedia.org/wiki/File_Explorer" rel="nofollow noreferrer">Windows Explorer</a> freezes, the executable remain in the <a href="https://en.wikipedia.org/wiki/Task_Manager_(Windows)" rel="nofollow noreferrer">Task Manager</a> and invariably use 76 KB of RAM while being impossible to kill; finally after about 5 minutes, Windows Explorer unfreezes, the program is restarted and works normally</li>
  </ol>
  <p>This is unacceptable. Newbie users of my program, especially the game, don't know how antivirus software works; don't know how to put it into the white list and why it will unblock it; don't know how to change settings of their antivirus software; if they see the pop-up, won't understand it and will end up being afraid or disappointed because they can't play without knowing why; and if they don't see the pop-up, I can't expect them to wait 5 minutes with a half-freezing computer. each time they want to play.</p>
  <p>From there, I made the following deductions:</p>
  <ul>
  <li>My machine isn't itself infected and no virus is injected into the executables I distribute; otherwise, all recent programs would be blocked; I have two which are (my player and the new version of my game), while one is not (the latest version of my text editor). The 1.7.2 of the game has been compiled in march 2012, while the 1.4.1 of the text editor is from October 2012.</li>
  <li>The newest version of GCC 4.7.2 is not in cause, by the same reasoning; same for ANSI vs Unicode compiling.</li>
  <li>The MinGW C++ runtime, distributed as a auto-linked DLL, mandatory in all C++ applications compiled with GCC 4.7.2, is probably not the cause, because many well-known programs use it; and my text editor is blocked and is in C, and thus don't use it.</li>
  <li>My audio player and my game have the audio library in common; this later is not the cause, because the version 1.7.2 of my game works and the newest private beta not. And of course, that audio library is also used in many other known or less known applications that aren't blocked.</li>
  <li>Both the player and the game access the network using <a href="https://en.wikipedia.org/wiki/Winsock" rel="nofollow noreferrer">Winsock</a>; so by the same reasoning, it's not the cause either</li>
  <li><em>If</em> it really were the reputation thing of Avast, why has the version 1.4.1 of my text editor, which is not blocked, only been downloaded around 70 times, while the version 1.3 which is blocked has been downloaded more than 300 times? It looks completely illogical. Are 70 users sufficient to claim something about reputation? Is it more with 300 users? I really don't think so... probably a critical mass of a dozens thousands users is necessary.</li>
  </ul>
  <p>Additionally to that, I also thought that the fact I'm distributing my programs as portable ZIP files may be a reason for Avast to block, and conversely, the fact that a program is well installed in program files may be a reason to trust it more.</p>
  <p>So I made a simple experience: I compiled a new Inno Setup 5 installer for the beta 2.0.0 of my game, as well as one for the version 1.3 of my text editor, and discover that the installers themselves were blocked!</p>
  <p>I made another experience with my friend, where I tried to find exactly the place where the programs crash, based on using MessageBeep (MessageBox is also blocked!). I didn't noticed anything problematic. The game is blocked when SetDlgItemText is called for the first time in the login dialog box, but if I remove all SetDlgItemText it is blocked further down. In the text editor, it is blocked while populating the menu bar...</p>
  <p>My conclusion is there is something that Avast doesn't like in the new version of my game, in the old versions of my text editor, and in my audio player. Something that is absent in the newest version of my text editor. What could it be? Do you have any clue? Do you have only an idea on how I could proceed to find what it is so that I can hope to fix it? Is there only a way to analyse such a problem, or is the whole world screwed by Avast?</p>
  <p>Note that I'm a single person and not a company, all those programs are free to use, I have not pay any IDE to develop them, and I'm not paid by the users when they use them, so I assume that a certificate is probably not affordable at all. Moreover, I don't know if it's a true solution, how to sign an application compiled with GCC, and I really don't want to switch to an &quot;usine à gaz&quot; like <a href="https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B" rel="nofollow noreferrer">Microsoft Visual C++</a> (MSVC). I would prefer strongly forget that option if there is any other solution, even a very dirty one.</p>