I've found some little time and a project which was unfinished... so I finished the first step :grin:
PingChat will be a program (now it has only the first step which is icmp handling properly) with wich you can chat with others through ICMP protocol

hpe it will be a usefull example of raw icmp
Posted on 2003-08-20 09:28:14 by NEMO
Typo in the button "Cancle" :stupid:

Anyway it looks cool, though I have yet to really try chatting with my friends using it.
Posted on 2003-08-21 10:26:00 by roticv
Under XP the send works but no replies are caught.
Posted on 2003-08-23 21:31:19 by Homer
So how would one go about grabbing incoming ping packets on XP?
Posted on 2004-02-29 09:31:25 by tomdfx
Queerdy wrote an asm ping example which received replies under xp, take a look at that.
Posted on 2004-03-05 21:49:58 by Homer
I searched through the forums and couldn't locate Queerdy's example. Do you know of a link to it, or perhaps have a general idea how he went about capturing the replies on XP?
Posted on 2004-03-12 12:26:50 by tomdfx
Here u go :)
Posted on 2004-03-12 23:16:18 by Homer
Good code but at me is not present files icmp.lib came to me him please (ignat_ivanov@mail.ru)
A thank :)
Posted on 2004-03-17 00:58:18 by animator
Hmm... it is good for grabbing the replies, but is there any kind of functionality available through the APIs to setup callbacks when ICMP requests (in other words, when another computer is initiating the ping) are received? More of a catch-all example?
Posted on 2004-03-17 13:17:39 by tomdfx
Hi,
can the icmpchecksum proc be used to find the checksum of TCP headers?:confused: :stupid:

Thomas Antony
Posted on 2004-03-31 01:00:39 by thomasantony
From memory, icmp(udp) and tcp packet checksums are calculated using different (yet very similar) algos - but don't quote me on that - check for yourself :)
Posted on 2004-04-04 10:16:31 by Homer
Hi, I got a checksum algo in C. But didn't quite understand it so that I couldn't convert it into ASM. Can someone please post a TCP checksum algo in MASM or GoASM format?

Thomas Antony
Posted on 2004-04-05 02:10:20 by thomasantony
think this will help you a bit
Posted on 2004-04-05 06:37:30 by NEMO
Hi! Can i have a look at Queerdy example? Thanks!

grundic ~ gmail ~ com :roll:
Posted on 2005-01-22 06:09:02 by grundic
Hi,
  See the Raw ICMP ping example at my site at http://www.tomasm.tk/ . I haven't tested it on XP yet.

Thomas Antony
Posted on 2005-03-23 23:15:27 by thomasantony
you probably need to switch to promiscuous mode on xp, using WSAIoctl with SIO_RCVALL.
if anyone is interested, I could post my win32asm raw socket sniffer for a real-life example ...

Dominik

p.s. hi EvilHomer, i'm back :) ... you probably remember that raw socket sniffer...
unfortunately it was never finished to be object-orientated, though it does work fine without :)
Posted on 2005-08-10 01:05:11 by Dom
You could use a RAW socket to collect the ping replies. You have to parse through the headers of all the incoming data but it would work relatively well.

Here's a snippet of vb code to initialize the raw socket

Dim byteA(0 To 3)
byteA(0) = &H1
With sAddr
.sin_family = 2
.sin_port = 0
.sin_addr = xIP //ip of local host
End With
sd = socket(2&, 3&, 0&)
a = bind(sd, sAddr, 16&)
a = WSAIoctl(sd, &H98000001, byteA(0), 4&, vbNull, vbNull, XX, vbNull, vbNull)


Then run a RecvFrom api inside of a loop in another thread and check the incoming packets for the reply.

It's not the epitome of efficiency but meh.
Posted on 2005-08-13 00:30:43 by r22
a = WSAIoctl(sd, &H98000001, byteA(0), 4&, vbNull, vbNull, XX, vbNull, vbNull)

there we got the promiscous mode.
r22, better run a recv - loop or do you know whose data you are getting in with the raw socket!?
Posted on 2005-08-15 00:01:57 by Dom