Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.04.25;
Скачать: CL | DM;

Вниз

Сканер сети   Найти похожие ветки 

 
Ron   (2004-02-23 12:09) [0]

народ, может кто знает как сделать сканер сети средствами WinSock через массив? А то у меня что-то не получается... :(


 
Verg ©   (2004-02-23 13:25) [1]

Не мучайся, не стОит... Возьми готовый http://www.oxid.it/


 
Verg ©   (2004-02-23 13:27) [2]

.... особенно если

> средствами WinSock через массив


:))


 
Anatoly Podgoretsky ©   (2004-02-23 13:32) [3]

Объявить массив и все рахличие по сравнению с переменной это использование идекса для обращения
Вместо V образаться так V[i]
Но может рано заниматься сканерами, а потратить усилия на изучения основ Паскаля, в том числе и массивы.


 
ALeX.B. ©   (2004-02-27 11:57) [4]

Тебе надо алгоритм перебора айпишников? Если да то смотри
unit Unit1;

interface

uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs, StdCtrls, Ping, IdBaseComponent, IdComponent, IdRawBase,
 IdRawClient, IdIcmpClient;

type
 TForm1 = class(TForm)
   Memo1: TMemo;
   Button1: TButton;
   startip: TEdit;
   endip: TEdit;
   IdIcmpClient1: TIdIcmpClient;
   procedure Button1Click(Sender: TObject);
   procedure IdIcmpClient1Reply(ASender: TComponent;
     const AReplyStatus: TReplyStatus);
 private
   { Private declarations }
 public
   { Public declarations }
 end;

var
Form1: TForm1;
var x, y, t: array [1..4] of integer; i: byte;
implementation

{$R *.dfm}
procedure scannet(a, b: byte);

begin
for i := a to b do
begin
Form1.IdIcmpClient1.Host := InttoStr(x[1]) + "." + InttoStr(x[2]) + "." + InttoStr(x[3]) + "." + InttoStr(i);
Form1.IdIcmpClient1.Ping();
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
label noscan;  var ipos,stip1,stip2,stip3,stip4,eip1,eip2,eip3,eip4,i1,i2,i3,i4,j,k:integer;
 stip,eip:string;
begin
Memo1.Lines.Clear;
stip := startip.Text;
ipos := pos(".",stip);
stip1 := strtoint(copy(stip,1,ipos-1));
delete(stip,1,ipos);
ipos := pos(".",stip);
stip2:= strtoint(copy(stip,1,ipos-1));
delete(stip,1,ipos);
ipos:=pos(".",stip);
stip3:= strtoint(copy(stip,1,ipos-1));
delete(stip,1,ipos);
ipos:=pos(".",stip);
stip4:= strtoint(copy(stip,1,ipos+3));
eip:=endip.Text;
ipos:=pos(".",eip);
eip1 := strtoint(copy(eip,1,ipos-1));
delete(eip,1,ipos);
ipos:=pos(".",eip);
eip2:= strtoint(copy(eip,1,ipos-1));
delete(eip,1,ipos);
ipos:=pos(".",eip);
eip3:= strtoint(copy(eip,1,ipos-1));
delete(eip,1,ipos);
ipos:=pos(".",eip);
eip4:= strtoint(copy(eip,1,ipos+3));
x[1] := stip1;x[2] := stip2;x[3] := stip3;x[4] := stip4;
y[1] := eip1;y[2] := eip2;y[3] := eip3;y[4] := eip4;
if ((x[1] = y[1]) and (x[2] = y[2]) and (x[3] = y[3]))
   then
     begin
       scannet(x[4], y[4]);
       goto noscan;
     end
   else scannet(x[4], 255);
 inc(x[3]);
 t[2] := y[2];
 t[3] := y[3];
 t[4] := y[4];
 y[2] := 255;
 y[3] := 255;
 y[4] := 255;
 while (x[1] <= y[1]) do
   begin
    if (x[1] = y[1]) then y[2] := t[2];
     while (x[2] <= y[2]) do
       begin
         if ((x[1] = y[1]) and (x[2] = t[2])) then y[3] := t[3] - 1;
         while (x[3] <= y[3]) do
           begin
             scannet(0, 255);
             if (x[3] = y[3]) then break else inc(x[3]);
           end;
         x[3] := 0;
         if (x[2] = y[2]) then break else inc(x[2]);
       end;
     x[2] := 0;
     if (x[1] = y[1]) then break else inc(x[1]);
   end;
 x[2] := t[2];
 x[3] := t[3];
 scannet(0,t[4]);
noscan:
end;
procedure TForm1.IdIcmpClient1Reply(ASender: TComponent;
 const AReplyStatus: TReplyStatus);
begin
if(IdIcmpClient1.ReplyData <> "") then
begin
Form1.Memo1.Lines.Add(InttoStr(x[1]) + "." + InttoStr(x[2]) + "." + InttoStr(x[3]) + "." + InttoStr(i));asm nop end;
IdIcmpClient1.CleanupInstance;
end;
end;
end.

Разберайся. Я сам тоже с этой бадягой долго парился.


 
Verg ©   (2004-02-27 12:06) [5]


> ALeX.B. ©   (27.02.04 11:57) [4]


Шо это было?


> asm nop end;


Это что?


 
Polevi ©   (2004-02-27 12:29) [6]

>Verg ©   (27.02.04 12:06) [5]
зато через массив :)



Страницы: 1 вся ветка

Текущий архив: 2004.04.25;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.049 c
1-1081333765
Samael6
2004-04-07 14:29
2004.04.25
Acrobat Reader GetVersion()


3-1080282737
ГАГН
2004-03-26 09:32
2004.04.25
Как в Fast Report е сделать так?


1-1081118674
Alex79
2004-04-05 02:44
2004.04.25
Проблема смены шрифтов


3-1080225142
Rule
2004-03-25 17:32
2004.04.25
Торможу, помогите с Lookup полями.


9-1066999903
andrM
2003-10-24 16:51
2004.04.25
Где можно достать алгоритм движка для игры?





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский