Wanted: Python module allowing direct access to raw sectors of harddrives (MFT, boot sector, etc.) in MS Windows

jepler at unpythonic.net jepler at unpythonic.net
Mon Oct 10 18:30:22 EDT 2005


I took the advice from this web page:
	http://support.microsoft.com/kb/q100027/
(I don't know how this extends to floppies, and the 9x family of OSes isn't
listed in "applies to", so this may not help your case)

Here, I open "physical drive 0" and see that the magic number indicates a valid
boot record.  I believe it is the MBR.

>>> f = open('\\\\.\\PhysicalDrive0', 'rb')
>>> f.read(512)[-2:]
'U\xaa'   # that is, hex 55 AA

I don't know much about low-level filesystem or partition details--I got the
tidbit about the 55 AA magic number from 
	http://www-uxsup.csx.cam.ac.uk/pub/doc/suse/sles9/adminguide-sles9/ch08.html

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20051010/8abaa52a/attachment.sig>


More information about the Python-list mailing list