Antivirus blocks my program?

I did make a very simple program to test the & parameter. But when I try to run the program, my Antivirus screams out loud!

The program I made:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
using namespace std;

void Test (int & TestTal)
{
    TestTal = 10;
    cout << "TestTal is: " << TestTal << endl;
}

int main ()
{
    int Tal = 5;
    cout << "Tal is: " << Tal << endl;

    Test ( Tal );
    cout << "Tal is: " << Tal << endl;
}


I made the program to test if the value of Tal will change after it has been sent to my function Test.

It runs through the compilor with no problems, but when I press RUN, my antivirus stops the process and tells me:

Attack Gen:Variant.Graftor.7493
And it gets removed.

I looked it up, and the description is:
A Generic Detection for programs with features or behaviors indicative of known malicious threats, such as trojans, worms or viruses.

What did I do?
The heuristics of most antivirus software are horribly broken, it's very hard to write a program that isn't detected as malware by at least a few scanners.

Are you testing the debug build? If so, does the release build work?
Are you testing the debug build? If so, does the release build work?

How do I do this? I use Code::Blocks10 on Win 7(32bit) if it helps.
top toolbar, there is drop down box with the word 'Debug' click it and set it to 'Release' and compile again.

You may also want to look into getting a different anti virus, although I've had problems like this with most of them, a bad one is more likely to detect a false-positive.
Last edited on
top toolbar, there is drop down box with the word 'Debug' click it and set it to 'Release' and compile again.


There is no 'Release' option in my drop down box, and all other options is grey besides 'Attach to Process', and I don't know what this option does?
http://i.imgur.com/QQvse.png

although yours will look difference since its an older version, that Debug drop down is still there, assuming you didn't change the toolbar layout.

if you did, go View->Toolbars->Compiler
Last edited on
This drop down list is grey on my code blocks, I have not changed it nor ever touched it. It has always been grey...

http://imageshack.us/photo/my-images/198/buildtargetgrey.jpg
Project->Properties..->Build Targets.

on the left-hand side it should show Debug and Release, they are both similar, except Release is (on that tab anyway)

bin\Release\simple stuff.exe
obj\Release\

where its Release instead of Debug

and then in Project->Build Options.

left-hand side, Debug, Compiler Settings (append target options to project options)

Compiler Flags:
Produce Debugging Symbols

where as release would have:

Strip all symbols from binary
Optimize even more (for speed)

Those are the only differences I can spot, in GUI apps though Release is usually edited to remove the console output.
I am sorry, I think I should had said so from the beginning. I'm not working on a project, just a simple *.cpp file.

So I do not have the Project->Properties.. etc.
Ah, no wonder.

If you want to make it run in what is the equivalent of Release mode, just go to Settings->Compiler, Compiler Settings->Compiler Flags, tick 'Strip all symbols from binary' and 'Optimize even more (for speed)' and untick 'Produce Debugging Symbols'
Last edited on
This solved the problem! Thank you!
no problem ^^
Topic archived. No new replies allowed.