How to send exact packet over TCP clientHow can I connect to Android with ADB over TCP?Payload split over two TCP packets when using Boost ASIO, when it fits within the MTUHow should I bridge TCP traffic using C#? Need to copy traffic on one port and send it to anotherWhy does my pc send more than 1514 byte packet in one godifferent tcp packets captured on sender and receiverTCP Packets in Raw socket - Centos 6.6Sending TCP Packets to outside computer without Port ForwardingWhich method of sending messages in TCP more preferred?Sending a packet in C# via TCP?Cannot receive TCP packet from FPGA

What to use instead of cling film to wrap pastry

Can I use a Cat5e cable with an RJ45 and Cat6 port?

Install LibreOffice-Writer Only not LibreOffice whole package

Why would a military not separate its forces into different branches?

Is disk brake effectiveness mitigated by tyres losing traction under strong braking?

Is there precedent or are there procedures for a US president refusing to concede to an electoral defeat?

Where to draw the line between quantum mechanics theory and its interpretation(s)?

Prove that a definite integral is an infinite sum

How do I, as a DM, handle a party that decides to set up an ambush in a dungeon?

Is there a word that describes the unjustified use of a more complex word?

Constitutional limitation of criminalizing behavior in US law?

Is Benjen dead?

How can Internet speed be 10 times slower without a router than when using the same connection with a router?

Dihedral group D4 composition with custom labels

Is “snitty” a popular American English term? What is its origin?

Why is "breaking the mould" positively connoted?

Why is my arithmetic with a long long int behaving this way?

Will 700 more planes a day fly because of the Heathrow expansion?

How do LIGO and VIRGO know that a gravitational wave has its origin in a neutron star or a black hole?

How does summation index shifting work?

Correct way of drawing empty, half-filled and fully filled circles?

Should homeowners insurance cover the cost of the home?

Why do people keep telling me that I am a bad photographer?

What are the advantages of luxury car brands like Acura/Lexus over their sibling non-luxury brands Honda/Toyota?



How to send exact packet over TCP client


How can I connect to Android with ADB over TCP?Payload split over two TCP packets when using Boost ASIO, when it fits within the MTUHow should I bridge TCP traffic using C#? Need to copy traffic on one port and send it to anotherWhy does my pc send more than 1514 byte packet in one godifferent tcp packets captured on sender and receiverTCP Packets in Raw socket - Centos 6.6Sending TCP Packets to outside computer without Port ForwardingWhich method of sending messages in TCP more preferred?Sending a packet in C# via TCP?Cannot receive TCP packet from FPGA






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-2















I am trying to send a specific TCP packet to a server but it doesn't seem like it is sending the right data. How should I go about this



I have tried StreamWriter class. Using the NetworkStream. Sending Bytes, sending ASCII and sending text.



TcpClient client = new TcpClient("game_server_ip", port);

NetworkStream stream = client.GetStream();
StreamWriter writer = new StreamWriter(stream);

writer.WriteLine("....T..hello");
writer.Flush();


I am trying to send this exact packet:



00 00 00 0c 54 00 05 68 65 6c 6c 6f


Which translates to the text above
This is also the raw bytes:
0000000c54000568656c6c6f



The expected result should mean that the ingame chat should send a message saying hello. I have made sure the connection is up and running and it is. Also have tried sending the packet using Wireshark and WPE Pro and they work fine. (I got this packet from snifing)










share|improve this question
























  • "Which translates to the text above". No. And neither does the text string "....T..hello" translate to the byte values you want to have... The dot character . is not a zero byte. Nor is the . character the value 0x0c or 0x05. Do you really think that if you type some dots in a string that it will sometimes turn into 0x00, then sometimes to 0x0c, and then sometimes to 0x05, and not just sometimes but also just at the right positions because... ...magic? Look up any ASCII table to see what the value of the . character really is...

    – elgonzo
    Mar 23 at 2:27












  • I may be wrong, and am unsure as to how wireshark presents the data but that looks a lot like the HEX representation of the data. Which when converted seems to equal to "Tel" - codebeautify.org/hex-string-converter

    – Hozikimaru
    Mar 23 at 4:10











  • @Hozikimaru, "Which when converted seems to equal to "Tel"" No, it doesn't. Where did you get that idea from? Doing random stuff on a random website without knowing what that website actually really does just gives random, meaningless "results". Clearly the bytes at the positions corresponding to "T" and "hello" are just the ASCII values (or UTF-8 values, if you will) of the respective characters. There is no "Tel" thing in what the OP presented here... o.O???

    – elgonzo
    Mar 23 at 15:01


















-2















I am trying to send a specific TCP packet to a server but it doesn't seem like it is sending the right data. How should I go about this



I have tried StreamWriter class. Using the NetworkStream. Sending Bytes, sending ASCII and sending text.



TcpClient client = new TcpClient("game_server_ip", port);

NetworkStream stream = client.GetStream();
StreamWriter writer = new StreamWriter(stream);

writer.WriteLine("....T..hello");
writer.Flush();


I am trying to send this exact packet:



00 00 00 0c 54 00 05 68 65 6c 6c 6f


Which translates to the text above
This is also the raw bytes:
0000000c54000568656c6c6f



The expected result should mean that the ingame chat should send a message saying hello. I have made sure the connection is up and running and it is. Also have tried sending the packet using Wireshark and WPE Pro and they work fine. (I got this packet from snifing)










share|improve this question
























  • "Which translates to the text above". No. And neither does the text string "....T..hello" translate to the byte values you want to have... The dot character . is not a zero byte. Nor is the . character the value 0x0c or 0x05. Do you really think that if you type some dots in a string that it will sometimes turn into 0x00, then sometimes to 0x0c, and then sometimes to 0x05, and not just sometimes but also just at the right positions because... ...magic? Look up any ASCII table to see what the value of the . character really is...

    – elgonzo
    Mar 23 at 2:27












  • I may be wrong, and am unsure as to how wireshark presents the data but that looks a lot like the HEX representation of the data. Which when converted seems to equal to "Tel" - codebeautify.org/hex-string-converter

    – Hozikimaru
    Mar 23 at 4:10











  • @Hozikimaru, "Which when converted seems to equal to "Tel"" No, it doesn't. Where did you get that idea from? Doing random stuff on a random website without knowing what that website actually really does just gives random, meaningless "results". Clearly the bytes at the positions corresponding to "T" and "hello" are just the ASCII values (or UTF-8 values, if you will) of the respective characters. There is no "Tel" thing in what the OP presented here... o.O???

    – elgonzo
    Mar 23 at 15:01














-2












-2








-2








I am trying to send a specific TCP packet to a server but it doesn't seem like it is sending the right data. How should I go about this



I have tried StreamWriter class. Using the NetworkStream. Sending Bytes, sending ASCII and sending text.



TcpClient client = new TcpClient("game_server_ip", port);

NetworkStream stream = client.GetStream();
StreamWriter writer = new StreamWriter(stream);

writer.WriteLine("....T..hello");
writer.Flush();


I am trying to send this exact packet:



00 00 00 0c 54 00 05 68 65 6c 6c 6f


Which translates to the text above
This is also the raw bytes:
0000000c54000568656c6c6f



The expected result should mean that the ingame chat should send a message saying hello. I have made sure the connection is up and running and it is. Also have tried sending the packet using Wireshark and WPE Pro and they work fine. (I got this packet from snifing)










share|improve this question
















I am trying to send a specific TCP packet to a server but it doesn't seem like it is sending the right data. How should I go about this



I have tried StreamWriter class. Using the NetworkStream. Sending Bytes, sending ASCII and sending text.



TcpClient client = new TcpClient("game_server_ip", port);

NetworkStream stream = client.GetStream();
StreamWriter writer = new StreamWriter(stream);

writer.WriteLine("....T..hello");
writer.Flush();


I am trying to send this exact packet:



00 00 00 0c 54 00 05 68 65 6c 6c 6f


Which translates to the text above
This is also the raw bytes:
0000000c54000568656c6c6f



The expected result should mean that the ingame chat should send a message saying hello. I have made sure the connection is up and running and it is. Also have tried sending the packet using Wireshark and WPE Pro and they work fine. (I got this packet from snifing)







c# networking tcp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 at 1:25







shtabbbe

















asked Mar 23 at 1:20









shtabbbeshtabbbe

145




145












  • "Which translates to the text above". No. And neither does the text string "....T..hello" translate to the byte values you want to have... The dot character . is not a zero byte. Nor is the . character the value 0x0c or 0x05. Do you really think that if you type some dots in a string that it will sometimes turn into 0x00, then sometimes to 0x0c, and then sometimes to 0x05, and not just sometimes but also just at the right positions because... ...magic? Look up any ASCII table to see what the value of the . character really is...

    – elgonzo
    Mar 23 at 2:27












  • I may be wrong, and am unsure as to how wireshark presents the data but that looks a lot like the HEX representation of the data. Which when converted seems to equal to "Tel" - codebeautify.org/hex-string-converter

    – Hozikimaru
    Mar 23 at 4:10











  • @Hozikimaru, "Which when converted seems to equal to "Tel"" No, it doesn't. Where did you get that idea from? Doing random stuff on a random website without knowing what that website actually really does just gives random, meaningless "results". Clearly the bytes at the positions corresponding to "T" and "hello" are just the ASCII values (or UTF-8 values, if you will) of the respective characters. There is no "Tel" thing in what the OP presented here... o.O???

    – elgonzo
    Mar 23 at 15:01


















  • "Which translates to the text above". No. And neither does the text string "....T..hello" translate to the byte values you want to have... The dot character . is not a zero byte. Nor is the . character the value 0x0c or 0x05. Do you really think that if you type some dots in a string that it will sometimes turn into 0x00, then sometimes to 0x0c, and then sometimes to 0x05, and not just sometimes but also just at the right positions because... ...magic? Look up any ASCII table to see what the value of the . character really is...

    – elgonzo
    Mar 23 at 2:27












  • I may be wrong, and am unsure as to how wireshark presents the data but that looks a lot like the HEX representation of the data. Which when converted seems to equal to "Tel" - codebeautify.org/hex-string-converter

    – Hozikimaru
    Mar 23 at 4:10











  • @Hozikimaru, "Which when converted seems to equal to "Tel"" No, it doesn't. Where did you get that idea from? Doing random stuff on a random website without knowing what that website actually really does just gives random, meaningless "results". Clearly the bytes at the positions corresponding to "T" and "hello" are just the ASCII values (or UTF-8 values, if you will) of the respective characters. There is no "Tel" thing in what the OP presented here... o.O???

    – elgonzo
    Mar 23 at 15:01

















"Which translates to the text above". No. And neither does the text string "....T..hello" translate to the byte values you want to have... The dot character . is not a zero byte. Nor is the . character the value 0x0c or 0x05. Do you really think that if you type some dots in a string that it will sometimes turn into 0x00, then sometimes to 0x0c, and then sometimes to 0x05, and not just sometimes but also just at the right positions because... ...magic? Look up any ASCII table to see what the value of the . character really is...

– elgonzo
Mar 23 at 2:27






"Which translates to the text above". No. And neither does the text string "....T..hello" translate to the byte values you want to have... The dot character . is not a zero byte. Nor is the . character the value 0x0c or 0x05. Do you really think that if you type some dots in a string that it will sometimes turn into 0x00, then sometimes to 0x0c, and then sometimes to 0x05, and not just sometimes but also just at the right positions because... ...magic? Look up any ASCII table to see what the value of the . character really is...

– elgonzo
Mar 23 at 2:27














I may be wrong, and am unsure as to how wireshark presents the data but that looks a lot like the HEX representation of the data. Which when converted seems to equal to "Tel" - codebeautify.org/hex-string-converter

– Hozikimaru
Mar 23 at 4:10





I may be wrong, and am unsure as to how wireshark presents the data but that looks a lot like the HEX representation of the data. Which when converted seems to equal to "Tel" - codebeautify.org/hex-string-converter

– Hozikimaru
Mar 23 at 4:10













@Hozikimaru, "Which when converted seems to equal to "Tel"" No, it doesn't. Where did you get that idea from? Doing random stuff on a random website without knowing what that website actually really does just gives random, meaningless "results". Clearly the bytes at the positions corresponding to "T" and "hello" are just the ASCII values (or UTF-8 values, if you will) of the respective characters. There is no "Tel" thing in what the OP presented here... o.O???

– elgonzo
Mar 23 at 15:01






@Hozikimaru, "Which when converted seems to equal to "Tel"" No, it doesn't. Where did you get that idea from? Doing random stuff on a random website without knowing what that website actually really does just gives random, meaningless "results". Clearly the bytes at the positions corresponding to "T" and "hello" are just the ASCII values (or UTF-8 values, if you will) of the respective characters. There is no "Tel" thing in what the OP presented here... o.O???

– elgonzo
Mar 23 at 15:01













1 Answer
1






active

oldest

votes


















0














For TCP you will need to connect to the remote endpoint.



Check this example out Example






share|improve this answer























  • Already tried this method, and it does not work

    – shtabbbe
    Mar 23 at 1:44











  • Need to do some debugging in here. Find out packet is being sent.

    – ctabuyo
    Mar 23 at 1:45











  • I know the packet is being sent because when I try to send it, the text box pops up on the game but does not send anything. Which maybe means I am not sending the right data.

    – shtabbbe
    Mar 23 at 1:50











  • @shtabbbe So I need to know exactly what is being sent. Can you use a sniffer to find out what's being sent?

    – ctabuyo
    Mar 23 at 1:53











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55309713%2fhow-to-send-exact-packet-over-tcp-client%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














For TCP you will need to connect to the remote endpoint.



Check this example out Example






share|improve this answer























  • Already tried this method, and it does not work

    – shtabbbe
    Mar 23 at 1:44











  • Need to do some debugging in here. Find out packet is being sent.

    – ctabuyo
    Mar 23 at 1:45











  • I know the packet is being sent because when I try to send it, the text box pops up on the game but does not send anything. Which maybe means I am not sending the right data.

    – shtabbbe
    Mar 23 at 1:50











  • @shtabbbe So I need to know exactly what is being sent. Can you use a sniffer to find out what's being sent?

    – ctabuyo
    Mar 23 at 1:53















0














For TCP you will need to connect to the remote endpoint.



Check this example out Example






share|improve this answer























  • Already tried this method, and it does not work

    – shtabbbe
    Mar 23 at 1:44











  • Need to do some debugging in here. Find out packet is being sent.

    – ctabuyo
    Mar 23 at 1:45











  • I know the packet is being sent because when I try to send it, the text box pops up on the game but does not send anything. Which maybe means I am not sending the right data.

    – shtabbbe
    Mar 23 at 1:50











  • @shtabbbe So I need to know exactly what is being sent. Can you use a sniffer to find out what's being sent?

    – ctabuyo
    Mar 23 at 1:53













0












0








0







For TCP you will need to connect to the remote endpoint.



Check this example out Example






share|improve this answer













For TCP you will need to connect to the remote endpoint.



Check this example out Example







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 23 at 1:26









ctabuyoctabuyo

355420




355420












  • Already tried this method, and it does not work

    – shtabbbe
    Mar 23 at 1:44











  • Need to do some debugging in here. Find out packet is being sent.

    – ctabuyo
    Mar 23 at 1:45











  • I know the packet is being sent because when I try to send it, the text box pops up on the game but does not send anything. Which maybe means I am not sending the right data.

    – shtabbbe
    Mar 23 at 1:50











  • @shtabbbe So I need to know exactly what is being sent. Can you use a sniffer to find out what's being sent?

    – ctabuyo
    Mar 23 at 1:53

















  • Already tried this method, and it does not work

    – shtabbbe
    Mar 23 at 1:44











  • Need to do some debugging in here. Find out packet is being sent.

    – ctabuyo
    Mar 23 at 1:45











  • I know the packet is being sent because when I try to send it, the text box pops up on the game but does not send anything. Which maybe means I am not sending the right data.

    – shtabbbe
    Mar 23 at 1:50











  • @shtabbbe So I need to know exactly what is being sent. Can you use a sniffer to find out what's being sent?

    – ctabuyo
    Mar 23 at 1:53
















Already tried this method, and it does not work

– shtabbbe
Mar 23 at 1:44





Already tried this method, and it does not work

– shtabbbe
Mar 23 at 1:44













Need to do some debugging in here. Find out packet is being sent.

– ctabuyo
Mar 23 at 1:45





Need to do some debugging in here. Find out packet is being sent.

– ctabuyo
Mar 23 at 1:45













I know the packet is being sent because when I try to send it, the text box pops up on the game but does not send anything. Which maybe means I am not sending the right data.

– shtabbbe
Mar 23 at 1:50





I know the packet is being sent because when I try to send it, the text box pops up on the game but does not send anything. Which maybe means I am not sending the right data.

– shtabbbe
Mar 23 at 1:50













@shtabbbe So I need to know exactly what is being sent. Can you use a sniffer to find out what's being sent?

– ctabuyo
Mar 23 at 1:53





@shtabbbe So I need to know exactly what is being sent. Can you use a sniffer to find out what's being sent?

– ctabuyo
Mar 23 at 1:53



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55309713%2fhow-to-send-exact-packet-over-tcp-client%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript