pymhf.core.memutils module#
- pymhf.core.memutils.find_pattern_in_binary(pattern: str, return_multiple: Literal[False], binary: str | None = None) int | None #
- pymhf.core.memutils.find_pattern_in_binary(pattern: str, return_multiple: Literal[True], binary: str | None = None) list[int] | None
Find a pattern in the specified binary. This is for the most part a wrapper around pymem’s pattern_scan_module function so that we can just call this with a module name (often the name of the binary we ran, but it could be some other dll under the same process.)
- pymhf.core.memutils.get_addressof(obj: _SimpleCData | Structure | _Pointer | Array) int #
Get the address in memory of some object. If obj is a pointer, this will return the address pointed to.
- pymhf.core.memutils.getsize(obj)#
Sum size of object & members.
- pymhf.core.memutils.map_struct(offset: int | c_ulonglong | c_ulong | _Pointer, type_: Type[Struct]) Struct #
Return an instance of the type_ struct provided which shares memory with the provided offset. Note that the amount of memory to read is automatically determined by the size of the struct provided.
- Parameters:
offset – The memory address to start reading the struct from.
type_ – The type of the ctypes.Structure to be loaded at this location.
- Return type:
An instance of the input type.