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):
mm = MINIDUMP_MODULE()
mm.BaseOfImage = int.from_bytes(buff.read(8), byteorder = 'little', signed = False)
mm.SizeOfImage = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mm.CheckSum = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mm.TimeDateStamp = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mm.ModuleNameRva = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
mm.VersionInfo = VS_FIXEDFILEINFO.parse(buff)
mm.CvRecord = MINIDUMP_LOCATION_DESCRIPTOR.parse(buff)
mm.MiscRecord = MINIDUMP_LOCATION_DESCRIPTOR.parse(buff)
mm.Reserved0 = int.from_bytes(buff.read(8), byteorder = 'little', signed = False)
mm.Reserved1 = int.from_bytes(buff.read(8), byteorder = 'little', signed = False)
return mm
def parse(buff):
vf = VS_FIXEDFILEINFO()
vf.dwSignature = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
vf.dwStrucVersion = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
vf.dwFileVersionMS = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
vf.dwFileVersionLS = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
vf.dwProductVersionMS = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
vf.dwProductVersionLS = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
vf.dwFileFlagsMask = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
vf.dwFileFlags = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
vf.dwFileOS = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
vf.dwFileType = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
vf.dwFileSubtype = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
vf.dwFileDateMS = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
vf.dwFileDateLS = int.from_bytes(buff.read(4), byteorder = 'little', signed = False)
return vf
def get_size(self):
return 8+4+4+4+4+8+8+VS_FIXEDFILEINFO().get_size() + 2 * MINIDUMP_LOCATION_DESCRIPTOR().get_size()