#!/usr/bin/python import os,sys,re,binascii #Open up Drive 0 f = open("\\\\.\\PhysicalDrive0",'rb') #Read in the first 512 bytes - MFT - Offset 446 size 64 bytes data = f.read(512)[446:446+64] f.close() #partitions = [] part = "" count = 0 for byte in data: if count == 16: if re.match("^[0].+$",part) is None: if part[0:2] == "80": bootable = "Active" else: bootable = "Not Active" part_type = part[8:10] print "Partition" print "\t%s" % str(part) print "\tStatus: %s" % str(bootable) print "\tType: %s" % str(part_type) count = 0 part = "" part += "%02X" % ord(byte) count += 1