Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def parse(buff):
mml = MINIDUMP_MEMORY_LIST()
mml.NumberOfMemoryRanges = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
for _ in range(mml.NumberOfMemoryRanges):
mml.MemoryRanges.append(MINIDUMP_MEMORY_DESCRIPTOR.parse(buff))
return mml
def parse(buff):
mt = MINIDUMP_THREAD()
mt.ThreadId = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mt.SuspendCount = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mt.PriorityClass = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mt.Priority = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mt.Teb = int.from_bytes(buff.read(8), byteorder = 'little', signed = False)
mt.Stack = MINIDUMP_MEMORY_DESCRIPTOR.parse(buff)
mt.ThreadContext = MINIDUMP_LOCATION_DESCRIPTOR.parse(buff)
return mt