Skip to main content

A python module to manipulate and create MBRs.

Project description

PyMBR is a simple module that allows the user to parse, manipulate or create MBR/Bootsectors easily.

  • Parse full MBR dump

  • Parse parts of the MBR such as the partition table.

  • Change the bootcode or the artition table values.

  • Compose the changes made into a a new MBR binary string.

Installation

python setup.py install

or

pip install pymbr

Sample usage - Creating a simple MBR

import pymbr
mbr = pymbr.MBR()
mbr.bootcode = pymbr.Bootcode.ZOIDBERG
mbr.partitionTable = pymbr.PartitionTable.parse('\x00' * 64)
mbr.signature = 0xaa55
bin = mbr.compose()
with open('mbr.bin', 'wb') as file:
    file.write(bin)

TODOs:

  • Add more common filesystems to the Filesystem class

  • Add common MBR bootcode to he Bootcode class

  • Add LBA to CHS converion

  • Add overlapping partition prevention

  • Tests?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymbr-1.0.3.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file pymbr-1.0.3.tar.gz.

File metadata

  • Download URL: pymbr-1.0.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pymbr-1.0.3.tar.gz
Algorithm Hash digest
SHA256 f22cab3345571d52b71a029eff17792268862a38ad509df108b085de04112d76
MD5 95ad7968b13e05dcc3876b033653454f
BLAKE2b-256 598cf4bcb610e2068dd5bcfa4569b5b6a39b347f748a32dd58a1f88e391b0539

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page