From: Richard W.M. Jones Date: Sun, 18 May 2008 20:11:19 +0000 (+0000) Subject: Seems that the ELF fields are little-endian. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=a8bf42a6bd16d6a2067f0e1475e440dbdb5bc153;p=ocaml-bitstring.git Seems that the ELF fields are little-endian. --- diff --git a/examples/elf.ml b/examples/elf.ml index bafb490..f8bf341 100644 --- a/examples/elf.ml +++ b/examples/elf.ml @@ -11,8 +11,8 @@ let () = bitmatch bits with | { 0x7f : 8; "ELF" : 24 : string; (* ELF magic number *) _ : 12*8 : bitstring; (* ELF identifier *) - e_type : 16; (* object file type *) - e_machine : 16 (* architecture *) + e_type : 16 : littleendian; (* object file type *) + e_machine : 16 : littleendian (* architecture *) } -> printf "%s: ELF binary, type %d, arch %d\n" filename e_type e_machine