General discussion

Locked

sendto using Visual Basic 6

By chenjoey ·
I'm trying to write a packet generator in Visual Basic 6.0. Specifically I need to be able to create a custom TCP,UDP and ICMP packet.

I'm using the following: Public Declare Function sendto Lib "ws2_32.dll" (ByVal s As Long, ByRef buf As Any, ByVal lngLen As Long, ByVal flags As Long, udtTo As sockaddr_in, ByVal tolen As Long) As Long

I've read that for 'buf as Any' that I'm supposed to send in an array of bytes. Can anyone verify this? To convert the string to a byte array I'm using the following:
arrBuffer() = StrConv(Data, vbFromUnicode)

If I'm trying to send a self generated packet, what should be sent in for 'Data'?
Currently I'm sending something like this:
"4500000000320111000006419131011501011117"

The data is supposed to contain the ip header and tcp header, although this example just shows the ip header. Is this the correct way to use sendto?

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums