偶尔用codeblock编一个小程序,很简单,如下:
#include <stdio.h>
#include <stdlib.h>
#include <string >
#include <iostream>
using namespace std;
int main()
{
string clear_text;
int cycle=0;
cout<< "please input the clear_text:";
getline(cin,clear_text);
cout << "please input the periodicity:" ;
cin >> cycle;
cout << cycle;
return 0;
}
运行没有结果:
不仅如此,每次敲这段代码,电脑杀毒软件都会提示我这段程序是木马
尝试删除重新建c++文件,也会提示木马。
于是,开始测试是哪句话出了问题,经过多次测试发现,在main函数中,除了必要的两条声明变量语句,其余四条语句:
cout<< "please input the clear_text:";
getline(cin,clear_text);
cout << "please input the periodicity:" ;
cin >> cycle;
cout << cycle;
删去任意一条,程序都可以正常运行;
除此之外,我还把两条声明语句,放在main函数外,程序仍然可以正常运行。
对木马的组成并不了解,所以不知道是什么造成被杀毒软件不识别。
本文探讨了一个使用C++编写的简单程序无法正常运行且被杀毒软件误认为木马的问题。通过分析代码,发现与输入交互的部分导致了程序异常。进一步研究发现,杀毒软件的误报可能与程序的输入输出行为有关,而非程序本身存在恶意代码。
302

被折叠的 条评论
为什么被折叠?



