nobodd.mbr
Defines the data structures used by the Master Boot Record (MBR)
partitioning style. You should never need these directly; use the
nobodd.disk.DiskImage
class instead.
Data Structures
- class nobodd.mbr.MBRHeader(zero, physical_drive, seconds, minutes, hours, disk_sig, copy_protect, partition_1, partition_2, partition_3, partition_4, boot_sig)[source]
A
namedtuple()
representing the fields of the MBR header.- classmethod from_buffer(buf, offset=0)[source]
Construct a
MBRHeader
from the specified offset (which defaults to 0) in the buffer protocol object, buf.
- property partitions
Returns a sequence of the partitions defined by the header. This is always 4 elements long, and not all elements are guaranteed to be valid, or in order on the disk.
- class nobodd.mbr.MBRPartition(status, first_chs, part_type, last_chs, first_lba, part_size)[source]
A
namedtuple()
representing the fields of an MBR partition entry.- classmethod from_buffer(buf, offset=0)[source]
Construct a
MBRPartition
from the specified offset (which defaults to 0) in the buffer protocol object, buf.
- classmethod from_bytes(s)[source]
Construct a
MBRPartition
from the byte-string s.