Pythonのライブラリ struct は各値をバイト単位でしか保存。この弊害として、構造体中に冗長なメモリ領域が発生してしまう。 Structはファイルに書き込むことを想定して整数バイトにしている。対して、Memberは1ビット単位で自分のサイズを指定できる。
This project provides a graphical user interface (GUI) tool built with Python and Tkinter to parse the memory layout of a C++ struct. It has been refactored to follow the Model-View-Presenter (MVP) ...
Convert C struct/union definitions into Python classes with methods for serializing/deserializing. The usage is very simple: create a class subclassing cstruct ...
>>> import struct >>> print (struct.pack (">I", 0xff)) b'\x00\x00\x00\xff'>>> print (struct.pack ("<I", 0xff)) b'\xff\x00\x00\x00' ...
一部の結果でアクセス不可の可能性があるため、非表示になっています。
アクセス不可の結果を表示する