|
|
1.1 ! root 1: # ! 2: /* flag version 6 a.outs by putting a 1 in word 6 */ ! 3: #include <stdio.h> ! 4: #include <sys/types.h> ! 5: #include <sys/stat.h> ! 6: struct stat stbuf; ! 7: int fd; ! 8: short hbuf[8]; ! 9: time_t timep[2]; ! 10: main(argc, argv) char *argv[]; { ! 11: if(stat(argv[1], &stbuf) < 0) exit(0); ! 12: if(!(stbuf.st_mode & S_IEXEC)) exit(0); ! 13: if((fd = open(argv[1], 2)) < 0) exit(0); ! 14: if(read(fd, hbuf, sizeof hbuf) != sizeof hbuf) exit(0); ! 15: lseek(fd, 0L, 0); ! 16: if(hbuf[0]!=0407&&hbuf[0]!=0410&&hbuf[0]!=0411&&hbuf[0]!=0405) exit(0); ! 17: if(hbuf[6] != 0) exit(0); ! 18: hbuf[6] = 01; ! 19: if(write(fd, hbuf, sizeof hbuf) != sizeof hbuf) exit(0); ! 20: close(fd); ! 21: timep[0] = stbuf.st_atime; ! 22: timep[1] = stbuf.st_mtime; ! 23: utime(argv[1], timep); ! 24: printf("%s fixed\n",argv[1]); ! 25: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.