首先,我们打开设置——安全防护中心——开发者模式,添加你的编译输出目录,即可屏蔽误报。(注:此方法有一定危险,请确定你编译的程序是否真的没有病毒)
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #include <windows.h>
- #define MIN1 48
- #define MAX1 57
- #define MIN2 65
- #define MAX2 70
- #define SLEEP 200
- void color (char background_color,char foreground_color)
- {
- char str[9]={'C','O','L','O','R',' ',' ',' ','\0'};
- str[6]=background_color;
- str[7]=foreground_color;
- system(str);
- }
- int main()
- {
- char background_color=0;
- char foreground_color=0;
- int count=0;
- srand (rand());
- puts ("hello, world");
- while (!kbhit())
- {
- if (rand()%2==0)
- background_color=rand()%(MAX1-MIN1)+MIN1;
- else
- background_color=rand()%(MAX2-MIN2)+MIN2;
- if (rand()%2==0)
- foreground_color=rand()%(MAX1-MIN1)+MIN1;
- else
- foreground_color=rand()%(MAX2-MIN2)+MIN2;
- color (background_color,foreground_color);
- putchar('\a');
- Sleep (SLEEP);
- count++;
- }
- color ('0','7');
- system ("cls");
- printf ("颜色共变化了%d次!\n",count);
- system ("pause");
- return 0;
- }
复制代码 比如这一段代码,虽然没有病毒,但被DevCpp编译输出后,却显示有病毒。若只有单个文件误报或不在同一个文件夹内的文件误报,建议添加信任。
(有兴趣的朋友们可以编译试试) |
|
|
|
评论
直达楼层