您的位置:首页 > 其它

如何实现可执行文件的感染

2007-04-11 16:45 197 查看
做了一个小程序实现的是对可执行程序的感染,原理很简单.test.exe是我们要感染的文件, 我们要把我们自己的一个文件添加到其前面去,就实现了如果用户点击这一文件,先执行我们的程序.

其相关代码如下:

#include<iostream.h>
#include<stdio.h>
#include<conio.h>

void main()
{
FILE *fp ;
FILE *fp1;

if( ( fp = fopen("test1.exe","wb") ) == NULL )
{
printf("ERROR /n");
return ;
}

if( ( fp1 = fopen("test2.exe","rb") ) == NULL )
{
printf("ERROR /n");
return ;
}

while(!feof(fp1))
{
fputc(fgetc(fp1),fp);
}

fclose(fp1);

FILE *fp2;

if( ( fp2 = fopen("test12.exe","wb") ) == NULL )
{
printf("ERROR /n");
return ;
}

while(!feof(fp2))
{
fputc(fgetc(fp2),fp);
}

fclose(fp2);
fclose(fp);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: