MCPcopy Create free account
hub / github.com/ELMERIKH/PyinMemoryPE / get_attribute

Method get_attribute

windows/alpc.py:260–270  ·  view source on GitHub ↗
(self, attribute)

Source from the content-addressed store, hash-verified

258 return bool(self.ValidAttributes & attribute)
259
260 def get_attribute(self, attribute):
261 if not self.is_allocated(attribute):
262 raise ValueError("Cannot get non-allocated attribute <{0}>".format(attribute))
263 offset = ctypes.sizeof(self)
264 for sflag, struct in self.ATTRIBUTE_BY_FLAG:
265 if sflag == attribute:
266 # print("Attr {0:#x} was at offet {1:#x}".format(attribute, offset))
267 return struct.from_address(ctypes.addressof(self) + offset)
268 elif self.is_allocated(sflag):
269 offset += ctypes.sizeof(struct)
270 raise ValueError("ALPC Attribute <{0}> not found :(".format(attribute))
271
272 def _extract_alpc_attributes_values(self, value):
273 attrs = []

Callers 4

security_attributeMethod · 0.80
view_attributeMethod · 0.80
context_attributeMethod · 0.80
handle_attributeMethod · 0.80

Calls 2

is_allocatedMethod · 0.95
sizeofMethod · 0.45

Tested by

no test coverage detected