public MBR(byte[] data) { bootstrap = new byte[446]; PT = new MBRSection[4]; signature = new byte[2]; //------------fill bootstrap--------------- for (int i = 0; i < bootstrap.Length; i++) { bootstrap[i] = data[i]; } //------------------------------------------ //---------fill Partition table------------- int offset = 0x1BE; for (int i = 0; i < 4; i++) { PT[i] = new MBRSection(data, offset); offset += 0x10; } signature[0] = data[510]; signature[1] = data[511]; //------------------------------------------ }// ~MBR(byte[] data)
}// ~MBR(byte[] data) public void set(byte[] data) { //------------fill bootstrap--------------- for (int i = 0; i < bootstrap.Length; i++) { bootstrap[i] = data[i]; } //------------------------------------------ //---------fill Partition table------------- int offset = 0x1BE; for (int i = 0; i < 4; i++) { PT[i] = new MBRSection(data, offset); offset += 0x10; } //------------------------------------------ }// ~set()