Ok, that was easy, here is some example code... i took a shortcut for my project... im running a tcpdump or tcpick and filtering out the ip with this code
So, im searching threw the documents, im looking for a way to handle a ping request from a public wc3 game... i only find udp ping request from battlenet servers, is that the samething?
im watching tcpdump, i dont even know what byte im looking for that starts the ping request... this ping request is coming from a ghost++ bot hoxsting a public ladder game...
Code Select
#gather ip for all servers
s=""
Thread.start{
for i in 1..100000
data=IO.popen("tcpick -i wlan0 -yx 'port 6112'")
while line=data.gets
for x in line.split
if x.length==4
s<<x
end
end
end
sleep 1
end}
#create a list
ip_list=""
Thread.start{
for i in 1..100000
for x in s.scan(/400000.............../)
ip_list<<x[13..14].to_i(16).to_s+"."+x[15..16].to_i(16).to_s+"."+x[17..18].to_i(16).to_s+"."+x[19..20].to_i(16).to_s+" "+x[9..12].to_i(16).to_s+"\n"
end
#print ip_list.to_a.uniq
puts " IP LIST---#{ip_list.to_a.uniq.length}----"
puts "\n"
sleep 1
end}
So, im searching threw the documents, im looking for a way to handle a ping request from a public wc3 game... i only find udp ping request from battlenet servers, is that the samething?
im watching tcpdump, i dont even know what byte im looking for that starts the ping request... this ping request is coming from a ghost++ bot hoxsting a public ladder game...