Sign in to follow this  
Trix-Kun

Packet Conversion?

Recommended Posts

Trix-Kun    122
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
Trix-Kun    122
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
anonuser    148
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
Endogenous    166
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
anonuser    148
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

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