c语言判断行的程序,C语言程序被检测为病毒

#include

#include

union abc

{

int a;

int x;

float g;

};

struct pqr

{

int a;

int x;

float g;

} ;

void main()

{

union abc b;

struct pqr c;

clrscr();

b.a=10;

textbackground(2);

textcolor(6);

cprintf(" A = %d",b.a);

printf("\nUnion = %d",sizeof(b));

printf("\nStructure = %d",sizeof(c));

getch();

}

我已将此程序保存为virus.cpp。我正在使用turbo c编译器编译这个程序并从turbo c(ctrl+f9)运行。

我使用的是Windows7,我已经安装了Avira防病毒系统。

当我试图运行上述程序时,它会产生一个蠕虫(DOS/Candy)。我相信这个计划没什么错。

这里有一些特别的东西。执行相同的程序,但有以下区别。这里唯一的区别是

\n

:

#include

#include

union abc

{

int a;

int x;

float g;

};

struct pqr

{

int a;

int x;

float g;

} ;

void main()

{

union abc b;

struct pqr c;

clrscr();

b.a=10;

textbackground(2);

textcolor(6);

cprintf(" A = %d",b.a);

printf("\n Union = %d",sizeof(b));

printf("\n Structure = %d",sizeof(c));

getch();

}

区别只是\n和空格。我的问题是,为什么我的简单程序被检测为病毒?

这里是另一个代码示例,这次是C++:

#include

#include

class A

{

int a,b;

public:

A()

{

a=0;b=0;

}

A(int x)

{a=x;

b=0;

}

A(int x,int y)

{

a=x;

b=y;

}

~A()

{

cout<

}

void get()

{

cout<

cout<

}

};

void main()

{

A a1(5,10);

clrscr();

a1.get();

getch();

}

当我运行这个程序时,它会发出“病毒警告”——即使它不是病毒。现在,悲剧是,当你移除了析构函数,它不会把它当作病毒来检测。

以下是屏幕截图和类似问题:

问题是如何,为什么?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值