Thread: provoking antivirus

  1. #1
    Tweaking master Aslaville's Avatar
    Join Date
    Sep 2012
    Location
    Rogueport
    Posts
    528

    Thumbs down provoking antivirus

    Should this piece of code provoke my antivirus by any chance?
    Code:
    #include<iostream>
    
    using namespace std;
    
    int main()
    {
        int sum=0 ,i;
    
    for(i=0;i<100;i++)
    {
    
        do{
            (sum+=i);
        }
        while
            (i%2!=0);
    }
    
        cout<<sum<<endl;
    
        return 0;
    
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > Should this piece of code provoke my antivirus by any chance?
    No.

    Which AV software are you using?
    Some (Eg Comodo, which I use) operate white-lists of known good files. Since the checksum will change every time you recompile, it seems like a new file to the AV, which has to be relisted as "good".
    You might consider adding an exception rule for your development directory to stop the AV from checking things you're working on.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Maybe the AV has a really good heuristic which is spotting that pointless infinite loop...
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. AntiVirus
    By mrafcho001 in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 05-22-2005, 12:13 AM
  2. Antivirus
    By MethodMan in forum Tech Board
    Replies: 11
    Last Post: 09-25-2002, 10:22 PM
  3. Antivirus
    By gnu-ehacks in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 04-03-2002, 09:18 AM
  4. Thought-provoking quotes
    By tim545666 in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-29-2002, 12:13 AM