Jump to content
  • Advertisement
Sign in to follow this  
Trix-Kun

Packet Conversion?

This topic is 4796 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been wondering because as I seen in some people emulator coding and such it seems that when a packet that is like dynamic such as 0xDE and 0xE9 the programmers some how turn it into 0x46 and 0x02 any idea why this happens? I remember them telling me something about stuff like DWORDs..etc but I forgot it all haven't been working with packets over 6 months.

Share this post


Link to post
Share on other sites
Advertisement
You know how I look at my friends source right? Whenever he writes a packet into his program it looks way different from the original packet sent. Like this is a example "A6 turns into 46" and I don't think there modifying the packet because the packet that was sent from another client never changes.

Share this post


Link to post
Share on other sites
This maybe a case of network byte order versus host byte order.

try convertering everything to network htons htonl etc and on the recieving end ntohs and htonl

Share this post


Link to post
Share on other sites
I'm still not sure I get what you're asking. I assume from "he writes a packet into his program it looks way different from the original packet sent" that your friend is receiving the packet, and then doing something with the data that you don't understand. Perhaps he's xor'ing it with a value, or the packet is encrypted somehow? Try posting the code you don't understand. "A6 turns into 46" is a little bit vague. :)

Share this post


Link to post
Share on other sites
No its not a linux to windows things, its an archtecture to archtecture thing. Going from a ppc to an x86 chip will have some problems. Its generally accepted as safe practice to use network byte order and convert to and from. You never know. But this may be a case of you reading the data incorrectly with wrong offsets.
if you post code i may be able to help you.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!