From de5ef2cba6505c112e8f63c042659d06a1e68a0b Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sun, 30 Aug 2015 19:10:01 +0200 Subject: find_bootsect is part of raidguessfs, drop outdated standalone version --- tools/find_bootsect.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100755 tools/find_bootsect.py (limited to 'tools') diff --git a/tools/find_bootsect.py b/tools/find_bootsect.py deleted file mode 100755 index f52e910..0000000 --- a/tools/find_bootsect.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -import os, logging, binascii - -disk_count = 15 -disk_order = [ 0,1,2,4,5,6,7,8,9,10,11,12,13,14,15 ] -disk_paths = [ 'disk%02i.img'%d for d in disk_order ] -disks = [ None for d in range(disk_count) ] -disks_size = [ 0 for d in range(disk_count) ] - -for d in range(disk_count): - path = disk_paths[d] - logging.debug("Try to open disk #%2d"%d) - try: - disks[d] = open(path, "r") - disks_size[d] = os.lstat(path).st_size - logging.debug("Opened disk #%2d"%d) - except IOError as e: - logging.error("Can't open disk #%2d ('%s') : %s"%(d, path, e.strerror)) - disks_size[d] = 0 - except: - logging.error("Can't open disk #%2d ('%s') : unhandled exception"%(d, path)) - disks_size[d] = 0 -logging.debug("Exit. open_disks()") - -ref_sig = binascii.unhexlify('55AA') - -for offset in range(0, min(disks_size), 512): - for disk_no in range(disk_count): - disks[disk_no].seek(offset) - data = disks[disk_no].read(512) - sig = data[510:] - if sig == ref_sig: - print "%s@%x:%s"%(disk_paths[disk_no],offset,binascii.hexlify(sig)) - - -- cgit v1.2.3