pymhf.core.structs module#

class pymhf.core.structs.ContainerStruct#

Bases: object

Base class which, when inherited will automatically find any fields which are This will also utilise the pattern cache so the lookup within the binary only occurs once per unique exe.

class pymhf.core.structs.Field(datatype: _ctypes._SimpleCData | _ctypes.Structure | pymhf.core._Pointer | _ctypes._Pointer | _ctypes.Array | _ctypes.Union | pymhf.extensions.ctypes.c_enum8 | pymhf.extensions.ctypes.c_enum16 | pymhf.extensions.ctypes.c_enum32, offset: int | None = None)#

Bases: object

datatype: _SimpleCData | Structure | _Pointer | _Pointer | Array | Union | c_enum8 | c_enum16 | c_enum32#
offset: int | None = None#
class pymhf.core.structs.Pattern(pattern: str, address_offset: int = 3, address_dtype: Union[type[ctypes.c_ushort], type[ctypes.c_ulong], type[ctypes.c_ulonglong]] = <class 'ctypes.c_ulong'>, address_type: Literal['relative', 'absolute'] = 'relative')#

Bases: object

address_dtype#

alias of c_ulong

address_offset: int = 3#
address_type: Literal['relative', 'absolute'] = 'relative'#
pattern: str#
pymhf.core.structs.partial_struct(cls: _T) _T#

Mark the decorated class as a partial struct. This will automatically construct the _field_ attribute for this class