okay, so this doesn't really have much to do with C, however I don't know where else to ask it. if moderators feel that this is an inappropriate spot to post this, feel free to move it, and sorry for the inconvience.
I'm trying to write the characters FDG into an int using their hex values. so far, this is what I've established: 0x00464447.
however I'm a little confused here. in the Windows PE file format's IMAGE_DOS_HEADER, there is the member e_magic (a WORD, or in native C, a short) which should be IMAGE_DOS_SIGNATURE for a valid executable file. IMAGE_DOS_SIGNATURE is defined like so:
this is the very first value in any executable file, which from a hex editor is visible as the ASCII characters MZ. what I don't understand here, is that if the hex value for the ASCII character 'M' is 0x4D, and for 'Z' it is 0x5A, wouldn't that be ZM?Code:#define IMAGE_DOS_SIGNATURE 0x5A4D
after doing a little research, I found something about big endian, and how it affects the order in which bytes are represented. I read a little about it at wikipedia but got lost in some complex explanations and equations.
is 0x00464447 what I'm looking for here for FDG, or should it be 0x00474446? or neither of them, and if this is the case, could someone please explain why?
thank you in advance.