Skip to content

Instantly share code, notes, and snippets.

View merrybingo's full-sized avatar
👑
No Free Lunch

HyeJin Kim merrybingo

👑
No Free Lunch
  • Republic of Korea
View GitHub Profile
@JonathonReinhart
JonathonReinhart / ctypes_structs_example.py
Last active November 4, 2022 13:39
Using Python ctypes to manipulate binary data
#!/usr/bin/env python3
from __future__ import print_function
from tempfile import TemporaryFile
from binascii import hexlify
from ctypes import *
class StructHelper(object):
def __get_value_str(self, name, fmt='{}'):
val = getattr(self, name)