Password Screen Saver

Posted by @MINS

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Forms, StdCtrls, Registry, Classes, Controls,
ExtCtrls;

type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Panel2: TPanel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
reg: TRegistry;
const xorwert: array[1..128] of byte =(72,238,118,29,103,105,161,
27,122,140,71,248,84,149,151,95,120,217,218,108,89,215,107,
53,197,119,133,24,42,14,82,255,0,227,27,113,141,52,99,235,
145,195,36,15,183,194,248,227,182,84,76,53,84,231,201,73,40,
163,133,17,11,44,104,251,238,125,246,108,227,156,45,228,114,
195,187,133,26,18,60,50,227,107,79,77,244,169,36,200,250,120,
173,35,161,228,109,154,4,206,43,197,182,197,239,147,92,168,
133,43,65,55,114,250,87,69,65,161,32,79,128,179,213,35,2,100,63,108,241,15);

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
buf: Array[0..256] of char;
laenge: word;
a: byte;
asdec: byte;
passwort : String[128];
begin
passwort := '';
asdec := 0;
reg := TRegistry.Create;
reg.RootKey := HKEY_CURRENT_USER;
Reg.OpenKey('\Control Panel\Desktop',FALSE);
if reg.ValueExists ('ScreenSave_Data')= true then
Reg.ReadBinaryData('ScreenSave_Data', buf, sizeof(buf));
laenge := (Reg.GetDataSize('ScreenSave_Data') - 1) shr 1;
if reg.ValueExists ('ScreenSaveUsePassword')= true then
begin
if Reg.ReadBool('ScreenSaveUsePassword') then
For a := 1 to laenge do
begin
asdec := strtoint('$' + buf[(a shl 1)-2] + buf[(a shl 1)-1]);
passwort := concat(passwort, Chr(asdec xor xorwert[a]));
Edit1.Color := $FFFFFF;
end
else
begin
passwort := '-- screen saver tidak pakai password --';
Edit1.Color := $0000FF;
end;
reg.free;
Edit1.Text := passwort;
end

else begin
Edit1.Text := '-- screen saver tidak pakai password --';
Edit1.Color := $006C6CFF;
end;
//Edit1.SelectAll;
//Edit1.CopyToClipboard;
end;

end.

1 comments:

mmm said...

Assalamualaikum..

Referensi project2 delphi silahkan kunjungi blog saya :
http://energi08pnup.blogspot.com/
mungkin sya bisa membantu..

Smoga bermanfaat

Post a Comment