Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint32_t read_magic(FILE *obj_file, int offset)
- {
- uint32_t magic;
- fseek(obj_file, offset, SEEK_SET);
- fread(&magic, sizeof(uint32_t), 1, obj_file);
- printf("%x\n", magic);
- return magic;
- }
- gives feedfacf as expected.
- With bitstring:
- let () =
- let file = Sys.argv.(1) in
- let b = Bitstring.bitstring_of_file file in
- bitmatch b with
- | { magic : 32 : littleendian} -> Printf.printf "%x\n" (Int32.to_int magic)
- | { _ } -> ()
- getting 7ffffffffeedfacf
- where I understand the 7ffffff means NaN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement