Coaxing DWORD values out of a Binary file...

Dennis Lee Bieber wlfraed at ix.netcom.com
Sun Nov 24 20:53:10 EST 2002


adeptus fed this fish to the penguins on Sunday 24 November 2002 02:46 
pm:

> 
> I've tried unpacking them via the struct module, (by passing them in
> as 4 byte strings) but the numbers I get don't seem to make any sense
> for the file format...
> 
> Am I making a naive assumption about how VC++ would write a DWORD to a
> binary file???
> 
> I'm also assuming that:
>     (i386 centric)
>     8-Bits = 1 Char = 1 Byte
>     1 Word = 2 Bytes
>     1 DWORD = 4 Bytes

        Well, from the VC++ ver5 type definitions:

#ifndef _DWORD_DEFINED
#define _DWORD_DEFINED
typedef unsigned long DWORD;

#endif // !_DWORD_DEFINED

        So... 4 bytes may be correct, but nothing in that controls the byte 
order M$ decided to use in storage <G>


-- 
 > ============================================================== <
 >   wlfraed at ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed at dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >        Bestiaria Home Page: http://www.beastie.dm.net/         <
 >            Home Page: http://www.dm.net/~wulfraed/             <




More information about the Python-list mailing list