Reading binary file defined by a struct

后端 未结 5 1769
轻奢々
轻奢々 2021-02-11 01:23

Could somebody point me in the right direction of how I could read a binary file that is defined by a C struct? It has a few #define inside of the struct, which makes me thing t

5条回答
  •  [愿得一人]
    2021-02-11 01:55

    You have to find out the endiannes of the machine where the file was written so you can interpret integers properly. Look out for ILP32 vs LP64 mismatch. The original structure packing/alignment might also be important.

提交回复
热议问题