追捕oicq探测技术

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 ycrao 的 blog

追捕是怎样得到检测结果的呢?下面是具体实现的程序段:
mystream := tmemorystream.create;
try
nmudp1.readstream(mystream);
setlength(tmpstr,numberbytes);
mystream.read(tmpstr[1],numberbytes);
finally
mystream.free;
end;
j := pos( #$02 +#$02 +#$00 +#$00 , tmpstr);
k := pos( #$02 +#$03 +#$00 +#$00 , tmpstr);
m := pos( #$02 +#$03 +#$0a +#$00 , tmpstr);
o := pos( #$02 +#$03 +#$02 +#$00 , tmpstr);

if (j=1) or (k=1) or (m=1) or (o=1) then begin
j := pos( #$02 +#$02 +#$00 +#$00 + 'y', tmpstr);
k := pos( #$02 +#$03 +#$00 +#$00 + 'y', tmpstr);
m := pos( #$02 +#$03 +#$0a +#$00 + 'y', tmpstr);
o := pos( #$02 +#$03 +#$02 +#$00 + 'y', tmpstr);
oicqver := '未知';
if j=1 then oicqver := '425';
if k=1 then oicqver := '725';
if m=1 then oicqver := '820';
if o=1 then oicqver := '810';
if (j=1) or (k=1) or (m=1) or (o=1) then begin
tmps := '';
for j:=1 to length(tmpstr) do begin
if tmpstr[j] in ['0'..'9'] then tmps := tmps + tmpstr[j];
end;
if tmps='0' then label2.caption := 'oicq处于关闭状态,版本:'+ oicqver
else label2.caption :='oicq号码为'+ tmps + ',版本:'+ oicqver;
end;

j := pos( #$02 +#$02 +#$00 +#$00 + 'x', tmpstr);
k := pos( #$02 +#$03 +#$00 +#$00 + 'x', tmpstr);
m := pos( #$02 +#$03 +#$0a +#$00 + 'x', tmpstr);
o := pos( #$02 +#$03 +#$02 +#$00 + 'x', tmpstr);
if (j=1) or (k=1) or (m=1) or (o=1) then begin
j := 8;
tmpoicqnum := '';
while tmpstr[j]<>#$1f do begin
tmpoicqnum :=tmpoicqnum + tmpstr[j];
inc(j);
end;
j := j + 6;
while tmpstr[j]<>#$1f do begin
inc(j);
end;
j := j + 1;
while tmpstr[j]<>#$1f do begin
inc(j);
end;
j := j + 1;
tmpoicqmsg := '';
while tmpstr[j]<>#$03 do begin
tmpoicqmsg := tmpoicqmsg + tmpstr[j];
inc(j);
end;
if tmpoicqmsg<>lastoicqmessage then begin
lastoicqmessage := tmpoicqmsg;
messagebox(form1.handle, pchar('oicq用户' + tmpoicqnum + '对你的探测作出回应:' + #$0d + #$0a + tmpoicqmsg), '警告信息', mb_iconwarning +mb_ok);
end;
end;
exit;
end;

本文关键:追捕oicq探测技术
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top