Examples of MasterBootRecord


Examples of cert.forensics.mbr.MasterBootRecord

        System.out.print( "Analysing image:"
                + System.getProperty( "line.separator" ) + rawImageLocation );

        // analyse the image
        MasterBootRecord MBR = new MasterBootRecord( imgFile );

        System.out.println( " [" + MBR.getFileSizeBytes( ) + " bytes]" );
        System.out.println( );

        numOfSectors = MBR.totalSectorsOnDiskFromFile( );
        System.out.println( "Number of sectors:\t" + numOfSectors );

        numOfCylinders = MBR.largestCylinderValOnDisk( );
        System.out.println( "Number of cylinders:\t" + numOfCylinders );

        headsPerTrack = MBR.getPartitionEntry1( ).getNumHeads( );
        System.out.println( "Heads per track:\t" + headsPerTrack );

        sectorsPerTrack = MBR.getPartitionEntry1( ).getEndSector( );
        System.out.println( "Sectors per track:\t" + sectorsPerTrack );

        // create hashmap holding data for the VMDK template
        HashMap<String, String> vmdkData = new HashMap<String, String>( );
View Full Code Here

Examples of org.jnode.partitions.ibm.MasterBootRecord

                File file = new File(stage1ResourceName);
                InputStream is = new FileInputStream(file);
                byte[] buf = new byte[512];
                FileUtils.copy(is, buf);
                is.close();
                stage1 = new MasterBootRecord(buf);
            } catch (IOException e) {
                throw new GrubException("error while reading stage1", e);
            }
        }
        return stage1;
View Full Code Here

Examples of org.jnode.partitions.ibm.MasterBootRecord

     * @throws GrubException
     */
    public void format(BlockDeviceAPI devApi) throws GrubException {

        log.info("Checking the old MBR...");
        MasterBootRecord oldMbr;
        try {
            oldMbr = new MasterBootRecord(devApi);
        } catch (IOException e) {
            throw new GrubException("error while reading MBR", e);
        }

        if (!oldMbr.containsPartitionTable()) {
            throw new GrubException("This device doesn't contain a valid MBR.");
        }
        log.info("done.");

        /*
 
View Full Code Here

Examples of org.jnode.partitions.ibm.MasterBootRecord

    public PartitionHelper(IDEDevice device, PrintWriter out) throws DeviceNotFoundException,
            ApiNotFoundException, IOException {
        this.current = device;
        this.api = current.getAPI(BlockDeviceAPI.class);
        this.MBR = new MasterBootRecord(api);
        this.out = out;

        reloadMBR();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.