Skip to main content
GameDev.net gamedev.net
🔒 Locked

Hex value question

Started by dark chrono4 Oct 18, 2000 at 11:36 PM 1 replies 450+ views
Original Post
dark chrono4
dark chrono4
How do I read a hex value out of a file? The number was written as AAA1(not by me), but when I look at it in a hex editor the values are backwards 00A1 AA00. First off how do I actually get the value out? And secondly why is it backwards? "I can't work like this! Where are my fuzzy dice?"
"I can't work like this! Where are my fuzzy dice?"
Sly
Sly
The number appears backwards because Intel use little-endian byte ordering. That means that the least significant byte comes first, then the next most significant byte, and so forth right up to the most significant byte.

To read it out, just do a binary read of two bytes into a short integer.



Steve 'Sly' Williams
Tools Developer
Krome Studios

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.