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):
mmi = MINIDUMP_MISC_INFO_2()
mmi.SizeOfInfo = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.Flags1 = MinidumpMiscInfo2Flags1(int.from_bytes(buff.read(4), byteorder = 'little', signed = False))
if mmi.Flags1 & MinidumpMiscInfo2Flags1.MINIDUMP_MISC1_PROCESS_ID:
mmi.ProcessId = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
else:
buff.read(4)
if mmi.Flags1 & MinidumpMiscInfo2Flags1.MINIDUMP_MISC1_PROCESS_TIMES:
mmi.ProcessCreateTime = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessUserTime = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessKernelTime = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
else:
buff.read(12)
if mmi.Flags1 & MinidumpMiscInfo2Flags1.MINIDUMP_MISC1_PROCESSOR_POWER_INFO:
mmi.ProcessorMaxMhz = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorCurrentMhz = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorMhzLimit = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorMaxIdleState = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorCurrentIdleState = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
else:
def parse(buff):
mmi = MINIDUMP_MISC_INFO_2()
mmi.SizeOfInfo = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.Flags1 = MinidumpMiscInfo2Flags1(int.from_bytes(buff.read(4), byteorder = 'little', signed = False))
if mmi.Flags1 & MinidumpMiscInfo2Flags1.MINIDUMP_MISC1_PROCESS_ID:
mmi.ProcessId = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
else:
buff.read(4)
if mmi.Flags1 & MinidumpMiscInfo2Flags1.MINIDUMP_MISC1_PROCESS_TIMES:
mmi.ProcessCreateTime = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessUserTime = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessKernelTime = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
else:
buff.read(12)
if mmi.Flags1 & MinidumpMiscInfo2Flags1.MINIDUMP_MISC1_PROCESSOR_POWER_INFO:
mmi.ProcessorMaxMhz = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorCurrentMhz = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorMhzLimit = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorMaxIdleState = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorCurrentIdleState = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
else:
buff.read(20)
return mmi
def parse(buff):
mmi = MINIDUMP_MISC_INFO_2()
mmi.SizeOfInfo = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.Flags1 = MinidumpMiscInfo2Flags1(int.from_bytes(buff.read(4), byteorder = 'little', signed = False))
if mmi.Flags1 & MinidumpMiscInfo2Flags1.MINIDUMP_MISC1_PROCESS_ID:
mmi.ProcessId = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
else:
buff.read(4)
if mmi.Flags1 & MinidumpMiscInfo2Flags1.MINIDUMP_MISC1_PROCESS_TIMES:
mmi.ProcessCreateTime = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessUserTime = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessKernelTime = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
else:
buff.read(12)
if mmi.Flags1 & MinidumpMiscInfo2Flags1.MINIDUMP_MISC1_PROCESSOR_POWER_INFO:
mmi.ProcessorMaxMhz = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorCurrentMhz = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorMhzLimit = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorMaxIdleState = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorCurrentIdleState = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
def parse(buff):
mmi = MINIDUMP_MISC_INFO_2()
mmi.SizeOfInfo = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.Flags1 = MinidumpMiscInfo2Flags1(int.from_bytes(buff.read(4), byteorder = 'little', signed = False))
if mmi.Flags1 & MinidumpMiscInfo2Flags1.MINIDUMP_MISC1_PROCESS_ID:
mmi.ProcessId = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
else:
buff.read(4)
if mmi.Flags1 & MinidumpMiscInfo2Flags1.MINIDUMP_MISC1_PROCESS_TIMES:
mmi.ProcessCreateTime = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessUserTime = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessKernelTime = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
else:
buff.read(12)
if mmi.Flags1 & MinidumpMiscInfo2Flags1.MINIDUMP_MISC1_PROCESSOR_POWER_INFO:
mmi.ProcessorMaxMhz = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorCurrentMhz = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorMhzLimit = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorMaxIdleState = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mmi.ProcessorCurrentIdleState = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
else:
buff.read(20)
return mmi