Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 20:34

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



TCP-Opened Socket

Discussion on TCP-Opened Socket within the AutoIt forum part of the Coders Den category.

Closed Thread
 
Old   #1
 
alexutu2013's Avatar
 
elite*gold: 0
Join Date: Feb 2014
Posts: 229
Received Thanks: 66
Question TCP-Opened Socket

Hi all, can some1 explain, how can I send packets like : 0000 53 7c 45 4D 50 0A 00 to a opened socket? I've tried to search on forum and google..but that didn't helped me at all...thx
alexutu2013 is offline  
Old 04/03/2016, 17:23   #2
 
elite*gold: 5
Join Date: Feb 2014
Posts: 654
Received Thanks: 1,857
Take a look at the _HexToString() Function, included in the String.au3
Deverixz is offline  
Old 04/03/2016, 19:20   #3
 
alexutu2013's Avatar
 
elite*gold: 0
Join Date: Feb 2014
Posts: 229
Received Thanks: 66
I know..but..how to send it with spaces like it is in first post..I should put it in an array or how?
and can you give me please, a simple example?
alexutu2013 is offline  
Old 04/03/2016, 21:13   #4
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
So u want to send byte array as raw text or want to send that bytes as a packet byte array...

two ways:

Way1 (send raw data)

Way2 (send message byte array)
elmarcia is offline  
Thanks
1 User
Old 04/03/2016, 22:03   #5
 
alexutu2013's Avatar
 
elite*gold: 0
Join Date: Feb 2014
Posts: 229
Received Thanks: 66
2nd way thanks a lot <3 #closerequest
alexutu2013 is offline  
Old 04/04/2016, 14:53   #6
 
FacePalmMan's Avatar
 
elite*gold: 0
Join Date: Jan 2013
Posts: 426
Received Thanks: 129
There you have a code for translating the Bytes you have into functioning hex string (and if you set $iSendRaw to False, also to a string of maybe readable characters):
Code:
TCPStartup()

$hSocket = TCPConnect("127.0.0.1",1234)

Global $iSendRaw = True ;Try both True and False. Both should work
Global $sString = "0000 53 7c 45 4D 50 0A 00" ;Or ClipGet()
$sString = "0x" & StringReplace($sString, " ", "")
If Not $iSendRaw Then $sString = BinaryToString($sString)
TcpSend($hSocket, $sString)
(untested, but should work)
FacePalmMan is offline  
Thanks
1 User
Old 04/05/2016, 13:31   #7


 
Lawliet's Avatar
 
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
#closed
Lawliet is offline  
Closed Thread




All times are GMT +1. The time now is 20:35.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.