Esempio n. 1
0
    def __init__(self):
        super(PART_ENTRY, self).__init__()
        self.BootIndicator = v_types.uint8(enum=BOOTINDICATOR)
        # can be set to zero to force LBA mode (access via sector offsets only)
        # via: https://en.wikipedia.org/wiki/Master_boot_record
        self.StartingHead = v_types.uint8()
        self.StartingSectCylinder = v_types.uint16()

        # partition type (but doesn't necessarily decl
        self.SystemID = v_types.uint8(enum=SYSTEMID)

        # can be set to zero to force LBA mode (access via sector offsets only)
        # via: https://en.wikipedia.org/wiki/Master_boot_record
        self.EndingHead = v_types.uint8()
        self.EndingSectCylinder = v_types.uint16()

        # offset to partition in sectors from start of disk
        self.RelativeSector = v_types.uint32()
        # size of partition in sectors
        self.TotalSectors = v_types.uint32()
Esempio n. 2
0
 def __init__(self):
     super(MASTER_BOOT_RECORD, self).__init__()
     self.BootCode = v_types.vbytes(size=446)
     self.Partitions = v_types.VArray(fields=[PART_ENTRY() for _ in range(4)])
     self.EndOfSectorMarker = v_types.uint16()