On Thu, Oct 28, 2010 at 06:22:38PM -0600, AJ ONeal wrote:
> 
> hexdump exposes the magic number as 42 4D
> instead I see 4D 42
> but if I make it two chars rather than one short I do get 42 4D

Hex editors show the bytes in the order that they exist in the file.  If
you are running a bigendian machine (which you probably aren't), then
your program would interpret multibyte values in the "intuitive" way.
However, on little-endian machines, you have to manually swap the order
of the bytes.  I believe that Stuart gave some helpful info about how to
do this in an earlier message in the thread.  In any case, part of a
file format spec is setting out whether multi-byte numbers are intended
to be interpreted as little-endian or bigendian.  If they're supposed to
be little-endian, then your hex editor should be able to translate
numbers for you while you're looking at the file.


-- 
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55  8012 AB4D 6098 8826 6868
--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list

Reply via email to