none
Small Visual Studio Apps are threated as Virus RRS feed

  • Frage

  • Hello,

    I wrote a small console program (C/C++) to investigate CString behaviour with GetString, GetBuffer etc.

    If I compile it and want to execute the program in Debug mode, my G Data Anti-Virus says, it is a virus.

    In a different Post (https://social.msdn.microsoft.com/Forums/vstudio/en-US/3d1a1288-0265-407f-ad2c-fb39f893d63f/my-program-is-seen-as-a-virus?forum=vbgeneral) it is mentioned.

    After I inserted a User Input, G Data does not thrreat my code as virus. Maybe a Bug from the heuristic of antivirus software, or mabye a bug from visual studio.

    Code:

    #include <stdio.h> #include <math.h> #include <cstring> #include <string.h> #include <stdlib.h> #include <atlstr.h> #include <iostream >#define CM_PI 3.14159265358979323846264338327950288 #pragma warning(disable : 4996) #pragma warning(disable : 4700) using namespace std; int main() { //Some commented earlier code

    CString string = _T("LOL"); std::string lol; std::cout << "press some symbol and enter to start ...: "; std::cin >> lol; std::wcout << "string with GetBuffer():" << *string.GetBuffer() << "||" << (const wchar_t*)string << std::endl; std::wcout << "string with GetString():" << *string.GetString() << "||" << (const wchar_t*)string << std::endl; string.ReleaseBuffer(); std::wcout << "string with ReleaseBuffer():" << (const wchar_t*)string << std::endl; return(0); }


    Freitag, 27. Mai 2022 09:47

Antworten

Alle Antworten

  • Hallo Stezura,

    Wie in dem von Dir verlinkten Artikel erläutert, kann Code, der eine Benutzerinteraktion in irgendeiner Weise, Form oder Gestalt verhindert, von Viruserkennungssoftware als bösartig angesehen werden.
    Wahrscheinlich blockiert Dein Antivirenprogramm alle ausführbaren Dateien, wenn es sie zum ersten Mal erkennt, und Du solltest einen Ausschluss für Deinen Code vornehmen, wie hier erklärt:
    Bitdefender detects my C++ file as a virus
    Da Du weißt, dass Deine Programme keinen Virus enthält, solltest Du Deinen Visual Studio Ordner und die Programmdateiordner von der Antivirensoftware ausschließen. Im folgenden Artikel erhältst Du weitere Informationen:
    Comodo internet security detect c++ hello world program as a viruses (trojan)

    Gruß,
    Ivan Dragov

    Bitte haben Sie Verständnis dafür, dass im Rahmen dieses Forums, welches auf dem Community-Prinzip „IT-Pros helfen IT-Pros“ beruht, kein technischer Support geleistet werden kann oder sonst welche garantierten Maßnahmen seitens Microsoft zugesichert werden können.

    Freitag, 27. Mai 2022 16:54
    Administrator
  • Hallo Stezura,

    das hatte ich auch mal. Ich habe die betroffenen Dateien zur Überprüfung an den G-Data-Support gesendet. Am nächsten Tag hat es wieder funktioniert. Die haben sehr schnell reagiert.

    Gruß Klaus.

    Sonntag, 29. Mai 2022 12:23