|
-
Jun 1st, 2008, 02:51 AM
#1
Thread Starter
New Member
Problem With display packet in hex file!!
Basically,i connect the product which use UDP protcol.
I can received the message with error display but something format wrongly.
The format of code should be 16bit, hex...and i use Visual basic 6.0
((capture port from Ethereal)
0000 ff ff ff ff ff ff 48 44 4c 2b 14 df 08 00 45 00 ......HD L+....E.
0010 00 3b 01 8f 00 00 40 11 b7 44 c0 a8 01 37 ff ff .;....@. .D...7..
0020 ff ff 17 70 17 70 00 27 9a 93 c0 a8 01 37 48 44 ...p.p.' .....7HD
0030 4c 4d 49 52 41 43 4c 45 aa aa 0f 01 ca 00 41 00 LMIRACLE ......A.
0040 31 01 65 01 00 00 00 51 ec 1.e....Q .
Is it use sys.io in visual basic?how to displayed packet from bit to bit and show together..
Highly appreciate for your help!!!!
BR
Eric
-
Jun 1st, 2008, 05:32 AM
#2
Re: Problem With display packet in hex file!!
I assume you're using the winsock component, as you're using VB6.
I dont think you will not be able to see the bytes of the actual package using winsock, as thats demultiplexed for you at the transport layer.
Having never used the winsock component before...I cant give you a good answer to your question, but isnt there a method for receiving bytes? Or does it only send and receive strings?
-
Jun 1st, 2008, 03:40 PM
#3
Re: Problem With display packet in hex file!!
you can specify vbByte in GetData, then receive bytes to an array, you can then output the bytes however you want, eg: chr , hex, left as a byte.
eg:
Code:
Private Sub Command1_Click()
Winsock1.Close
Winsock1.Connect "www.google.co.uk", 80
End Sub
Private Sub Winsock1_Connect()
Winsock1.SendData "GET /intl/en_uk/images/logo.gif" & vbCrLf & vbCrLf
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim data As String
Dim hxData As String
Dim buffer() As Byte
ReDim buffer(bytesTotal)
Winsock1.GetData buffer, vbByte, bytesTotal
Dim x As Integer
For x = 0 To bytesTotal - 1
data = data & " [ " & buffer(x) & " ]"
hxData = hxData & " [ 0x" & Hex(buffer(x)) & " ]"
Next x
Text1.Text = data
Text2.Text = hxData
End Sub
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Jun 12th, 2008, 12:31 PM
#4
New Member
Re: Problem With display packet in hex file!!
I also have this problem
I need to change the code to 16bit & 8bit
How can I do?
PS. I get the code, the code seem error.
À¨7HDLMIRACLEªªeÐïÿÿÿ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|