void patch_image(char *filename)
{
int i,size;
-
+
view_only = 0;
f = open(filename, O_RDWR | O_BINARY);
if (f < 0) {
perror(filename);
return;
}
- view_only = 1;
+ view_only = 1;
}
lseek(f, search_base, SEEK_SET);
char filename[256];
char buf1[256];
char file2[256];
-
+
if (argc != 1) { /* If they specify names, patch them, exit */
for(i=1; i<argc; i++)
patch_image(argv[i]);
strcpy(file2,filename);
strcat(filename,"\\system32\\ntvdm.exe");
strcat(file2,"\\system32\\dllcache\\ntvdm.exe");
-
+
sprintf(buf1,"copy %s %s\\system32\\ntvdm.ori",filename,getenv("SYSTEMROOT"));
printf("%s\n",buf1);
system(buf1);
-
+
patch_image(file2);
patch_image(filename);
return 0;