Sign in to follow this  
Followers 0
rysiora

Problem with NULL - Chr(0) *sending TCP*

6 posts in this topic

Hello, i have a problem. I want to send a packet via TCP Send function, but what with a null character?

TCPStartUp()

; That's how my packet should look like:
;09 00 8C AE 80 AF 7D 07 20 0E 01 (SIZE: 11)

$socket = TCPConnect($IPadress, $Port)

$A = 0x09
$B = 0x00
$C = 0x8C
$D = 0xAE
$E = 0x80
$F = 0xAF
$G = 0x7D
$H = 0x07
$I = 0x20
$J = 0x0E
$K = 0x01

$data = Chr($A) & Chr($B) & Chr($C) & Chr($D) & Chr($E) & Chr($F) & Chr($G) & Chr($H) & Chr($I) & Chr($J) & Chr($K)

TCPSend($socket, $data)

TCPShutdown()

;Now - the sent packet looks bad (I used sniffer to check it):
;09 8C AE 80 AF 7D 07 20 0E 01 (SIZE: 10)

I can't send the Chr(0) NULL 00 thing! But it is very needed in my packet (as you know).

I'm using beta .66, but I can use newer if needed.

Please - any solution code for my problem.

Thanks

Share this post


Link to post
Share on other sites



Where do you explain why the Chr'0) is really needed?

PS Today you can only receive Chr(0) with the binary support in the latest beta 3.1.1.80 ;)

Share this post


Link to post
Share on other sites

Do I really have to explain why my packet MUST look like

09 00 8C AE 80 AF 7D 07 20 0E 01

not like

09 8C AE 80 AF 7D 07 20 0E 01

?

Answer is veeeeery simple: because it WONT work!

There have to be 00 in this stupid packet or the server will simply don't understeand it....

As i understood - I can only *recevie* Chr(0) in beta .80 ? Not send ?

Damn, so I was so close to succesfully send a packet to server... ;)

Share this post


Link to post
Share on other sites

what is the purpose of such packet?

Share this post


Link to post
Share on other sites

what is the purpose of such packet?

What's it matter, JP? Who cares if he's writing a virus or sending a packet to an IRC server or a web server or it's a custom application. It's irrelevant what the packet is for, the user wants to send it and can't and wants to know how.

Share this post


Link to post
Share on other sites

Problem solved in beta 82.

Now it's working fine.

Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0