Skip to content

Instantly share code, notes, and snippets.

@mydreambei-ai
mydreambei-ai / read_struct.py
Last active July 7, 2016 02:05
python read binary structure from file
from ctypes import *
libc = cdll.LoadLibrary("libc.so.6")
class POINT(Structure):
_fields_ = ("x", c_int), ("y", c_int)
f = open("test_structure", "w")