diff --git a/DiscImageChef.Decoders/ChangeLog b/DiscImageChef.Decoders/ChangeLog index 92da95ba1..0651a55e8 100644 --- a/DiscImageChef.Decoders/ChangeLog +++ b/DiscImageChef.Decoders/ChangeLog @@ -1,3 +1,7 @@ +2016-08-22 Natalia Portillo + + * LisaTag.cs: Removed temporal variable. + 2016-08-21 Natalia Portillo * LisaTag.cs: diff --git a/DiscImageChef.Decoders/LisaTag.cs b/DiscImageChef.Decoders/LisaTag.cs index 190f4b633..acc85b212 100644 --- a/DiscImageChef.Decoders/LisaTag.cs +++ b/DiscImageChef.Decoders/LisaTag.cs @@ -181,8 +181,6 @@ namespace DiscImageChef.Decoders BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian; - byte[] tmp = new byte[4]; - snTag.version = BigEndianBitConverter.ToUInt16(tag, 0); snTag.kind = (byte)((tag[2] & 0xC0) >> 6); snTag.reserved = (byte)(tag[2] & 0x3F); diff --git a/DiscImageChef.DiscImages/ChangeLog b/DiscImageChef.DiscImages/ChangeLog index 331d772ee..29c72f684 100644 --- a/DiscImageChef.DiscImages/ChangeLog +++ b/DiscImageChef.DiscImages/ChangeLog @@ -1,3 +1,9 @@ +2016-08-22 Natalia Portillo + + * ZZZRawImage.cs: Detect X68000 SASI hard disks that use 256 + bytes/sector. + Correct size of ECMA-154 magnetoptical. + 2016-08-21 Natalia Portillo * DIM.cs: diff --git a/DiscImageChef.DiscImages/ZZZRawImage.cs b/DiscImageChef.DiscImages/ZZZRawImage.cs index aef88ce04..5060c2680 100644 --- a/DiscImageChef.DiscImages/ZZZRawImage.cs +++ b/DiscImageChef.DiscImages/ZZZRawImage.cs @@ -275,6 +275,16 @@ namespace DiscImageChef.ImagePlugins break; } + // Sharp X68000 SASI hard disks + if(Path.GetExtension(imagePath).ToLowerInvariant() == ".hdf") + { + if(ImageInfo.imageSize % 256 == 0) + { + ImageInfo.sectorSize = 256; + ImageInfo.sectors = ImageInfo.imageSize / ImageInfo.sectorSize; + } + } + DicConsole.VerboseWriteLine("Raw disk image contains a disk of type {0}", ImageInfo.mediaType); return true; @@ -664,7 +674,7 @@ namespace DiscImageChef.ImagePlugins return MediaType.XDF_35; case 2949120: return MediaType.DOS_35_ED; - case 128000000: + case 127923200: return MediaType.ECMA_154; case 229632000: return MediaType.ECMA_201; diff --git a/DiscImageChef.Helpers/BigEndianMarshal.cs b/DiscImageChef.Helpers/BigEndianMarshal.cs new file mode 100644 index 000000000..3b6f72847 --- /dev/null +++ b/DiscImageChef.Helpers/BigEndianMarshal.cs @@ -0,0 +1,131 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : BigEndianMarshal.cs +// Author(s) : Natalia Portillo +// +// Component : Component +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2016 Natalia Portillo +// ****************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Linq; + +namespace DiscImageChef +{ + public static class BigEndianMarshal + { + /// + /// Marshals a big endian structure from a byte array. + /// Nested structures are still marshalled as little endian. + /// + /// The structure. + /// Byte array. + /// Structure type. + public static T ByteArrayToStructureBigEndian(byte[] bytes) where T : struct + { + GCHandle ptr = GCHandle.Alloc(bytes, GCHandleType.Pinned); + T str = (T)Marshal.PtrToStructure(ptr.AddrOfPinnedObject(), typeof(T)); + ptr.Free(); + return SwapStructureMembersEndian(str); + } + + /// + /// Swaps endian of structure members that correspond to numerical types. + /// Does not traverse nested structures. + /// + /// The structure with its members endian swapped. + /// The structure. + /// Structure type. + public static T SwapStructureMembersEndian(T str) where T : struct + { + Type t = str.GetType(); + FieldInfo[] fieldInfo = t.GetFields(); + foreach(FieldInfo fi in fieldInfo) + { + if(fi.FieldType == typeof(short)) + { + short int16 = (short)fi.GetValue(str); + byte[] int16_b = BitConverter.GetBytes(int16); + byte[] int16_r = int16_b.Reverse().ToArray(); + fi.SetValueDirect(__makeref(str), BitConverter.ToInt16(int16_r, 0)); + } + else if(fi.FieldType == typeof(int)) + { + int int32 = (int)fi.GetValue(str); + byte[] int32_b = BitConverter.GetBytes(int32); + byte[] int32_r = int32_b.Reverse().ToArray(); + fi.SetValueDirect(__makeref(str), BitConverter.ToInt32(int32_r, 0)); + } + else if(fi.FieldType == typeof(long)) + { + long int64 = (long)fi.GetValue(str); + byte[] int64_b = BitConverter.GetBytes(int64); + byte[] int64_r = int64_b.Reverse().ToArray(); + fi.SetValueDirect(__makeref(str), BitConverter.ToInt64(int64_r, 0)); + } + else if(fi.FieldType == typeof(ushort)) + { + ushort uint16 = (ushort)fi.GetValue(str); + byte[] uint16_b = BitConverter.GetBytes(uint16); + byte[] uint16_r = uint16_b.Reverse().ToArray(); + fi.SetValueDirect(__makeref(str), BitConverter.ToInt16(uint16_r, 0)); + } + else if(fi.FieldType == typeof(uint)) + { + uint uint32 = (uint)fi.GetValue(str); + byte[] uint32_b = BitConverter.GetBytes(uint32); + byte[] uint32_r = uint32_b.Reverse().ToArray(); + fi.SetValueDirect(__makeref(str), BitConverter.ToInt32(uint32_r, 0)); + } + else if(fi.FieldType == typeof(ulong)) + { + ulong uint64 = (ulong)fi.GetValue(str); + byte[] uint64_b = BitConverter.GetBytes(uint64); + byte[] uint64_r = uint64_b.Reverse().ToArray(); + fi.SetValueDirect(__makeref(str), BitConverter.ToInt64(uint64_r, 0)); + } + else if(fi.FieldType == typeof(float)) + { + float flt = (float)fi.GetValue(str); + byte[] flt_b = BitConverter.GetBytes(flt); + byte[] flt_r = flt_b.Reverse().ToArray(); + fi.SetValueDirect(__makeref(str), BitConverter.ToSingle(flt_r, 0)); + } + else if(fi.FieldType == typeof(double)) + { + double dbl = (double)fi.GetValue(str); + byte[] dbl_b = BitConverter.GetBytes(dbl); + byte[] dbl_r = dbl_b.Reverse().ToArray(); + fi.SetValueDirect(__makeref(str), BitConverter.ToDouble(dbl_r, 0)); + } + } + return str; + } + } +} + diff --git a/DiscImageChef.Helpers/BigEndianStructure.cs b/DiscImageChef.Helpers/BigEndianStructure.cs deleted file mode 100644 index c15ca8daf..000000000 --- a/DiscImageChef.Helpers/BigEndianStructure.cs +++ /dev/null @@ -1,118 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : EndianSwapStructure.cs -// Author(s) : Natalia Portillo -// -// Component : Component -// -// --[ Description ] ---------------------------------------------------------- -// -// Description -// -// --[ License ] -------------------------------------------------------------- -// -// This library is free software; you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 2.1 of the -// License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, see . -// -// ---------------------------------------------------------------------------- -// Copyright © 2011-2016 Natalia Portillo -// ****************************************************************************/ -using System; -using System.Linq; -using System.Reflection; -using System.Runtime.InteropServices; - -namespace DiscImageChef.Helpers -{ - public static class BigEndianStructure - { - // TODO: Check this works - /// - /// Marshals a big-endian byte array to a C# structure. Dunno if it works with nested structures. - /// - /// The big endian byte array. - /// Byte array. - /// C# structure type. - public static T ByteArrayToStructureBigEndian(byte[] bytes) where T : struct - { - GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned); - T stuff = (T)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(T)); - handle.Free(); - Type t = stuff.GetType(); - FieldInfo[] fieldInfo = t.GetFields(); - foreach(FieldInfo fi in fieldInfo) - { - if(fi.FieldType == typeof(short)) - { - short i16 = (short)fi.GetValue(stuff); - byte[] b16 = BitConverter.GetBytes(i16); - byte[] b16r = b16.Reverse().ToArray(); - fi.SetValueDirect(__makeref(stuff), BitConverter.ToInt16(b16r, 0)); - } - else if(fi.FieldType == typeof(int)) - { - int i32 = (int)fi.GetValue(stuff); - byte[] b32 = BitConverter.GetBytes(i32); - byte[] b32r = b32.Reverse().ToArray(); - fi.SetValueDirect(__makeref(stuff), BitConverter.ToInt32(b32r, 0)); - } - else if(fi.FieldType == typeof(long)) - { - long i64 = (long)fi.GetValue(stuff); - byte[] b64 = BitConverter.GetBytes(i64); - byte[] b64r = b64.Reverse().ToArray(); - fi.SetValueDirect(__makeref(stuff), BitConverter.ToInt64(b64r, 0)); - } - else if(fi.FieldType == typeof(ushort)) - { - ushort i16 = (ushort)fi.GetValue(stuff); - byte[] b16 = BitConverter.GetBytes(i16); - byte[] b16r = b16.Reverse().ToArray(); - fi.SetValueDirect(__makeref(stuff), BitConverter.ToUInt16(b16r, 0)); - } - else if(fi.FieldType == typeof(uint)) - { - uint i32 = (uint)fi.GetValue(stuff); - byte[] b32 = BitConverter.GetBytes(i32); - byte[] b32r = b32.Reverse().ToArray(); - fi.SetValueDirect(__makeref(stuff), BitConverter.ToUInt32(b32r, 0)); - } - else if(fi.FieldType == typeof(ulong)) - { - ulong i64 = (ulong)fi.GetValue(stuff); - byte[] b64 = BitConverter.GetBytes(i64); - byte[] b64r = b64.Reverse().ToArray(); - fi.SetValueDirect(__makeref(stuff), BitConverter.ToUInt64(b64r, 0)); - } - else if(fi.FieldType == typeof(float)) - { - float iflt = (float)fi.GetValue(stuff); - byte[] bflt = BitConverter.GetBytes(iflt); - byte[] bfltr = bflt.Reverse().ToArray(); - fi.SetValueDirect(__makeref(stuff), BitConverter.ToSingle(bfltr, 0)); - } - else if(fi.FieldType == typeof(double)) - { - double idbl = (double)fi.GetValue(stuff); - byte[] bdbl = BitConverter.GetBytes(idbl); - byte[] bdblr = bdbl.Reverse().ToArray(); - fi.SetValueDirect(__makeref(stuff), BitConverter.ToDouble(bdblr, 0)); - } - } - return stuff; - } - } -} - diff --git a/DiscImageChef.Helpers/ChangeLog b/DiscImageChef.Helpers/ChangeLog index 486a931fc..b50dcf8dc 100644 --- a/DiscImageChef.Helpers/ChangeLog +++ b/DiscImageChef.Helpers/ChangeLog @@ -1,3 +1,10 @@ +2016-08-22 Natalia Portillo + + * BigEndianMarshal.cs: + * BigEndianStructure.cs: + * DiscImageChef.Helpers.csproj: Reworked big endian marshal. + Does not traverse nested structures. + 2016-08-21 Natalia Portillo * BigEndianStructure.cs: diff --git a/DiscImageChef.Helpers/DiscImageChef.Helpers.csproj b/DiscImageChef.Helpers/DiscImageChef.Helpers.csproj index f1d6aea1c..bdccdb876 100644 --- a/DiscImageChef.Helpers/DiscImageChef.Helpers.csproj +++ b/DiscImageChef.Helpers/DiscImageChef.Helpers.csproj @@ -42,7 +42,7 @@ - + diff --git a/DiscImageChef.Partitions/Acorn.cs b/DiscImageChef.Partitions/Acorn.cs index 1fafae444..4ea6c43af 100644 --- a/DiscImageChef.Partitions/Acorn.cs +++ b/DiscImageChef.Partitions/Acorn.cs @@ -86,6 +86,9 @@ namespace DiscImageChef.PartPlugins int secCyl = bootBlock.discRecords.spt * heads; int mapSector = bootBlock.startCylinder * secCyl; + if(mapSector >= (int)imagePlugin.GetSectors()) + return false; + byte[] map = imagePlugin.ReadSector((ulong)mapSector); ulong counter = 0; diff --git a/DiscImageChef.Partitions/ChangeLog b/DiscImageChef.Partitions/ChangeLog index 79c45e6cf..a332cb093 100644 --- a/DiscImageChef.Partitions/ChangeLog +++ b/DiscImageChef.Partitions/ChangeLog @@ -1,3 +1,24 @@ +2016-08-22 Natalia Portillo + + * Human68k.cs: + * DiscImageChef.Partitions.csproj: Added Human68k partition + table. + + * RioKarma.cs: Corrected typo. + + * PC98.cs: Correct handling of partition name, do not directly + marshal as it may crash. + Prevent false positives checking for sanity and partition + type, so this limits it to FreeBSD right now. + + * Acorn.cs: Do not try to read past device. + + * SGI.cs: Corrected big endian marshaling, manually traversing + nested structures. + + * Sun.cs: Sun insists all devices must be 512 bytes/sector. + Really. Even CDs. But this allows bigger ones. + 2016-08-21 Natalia Portillo * Acorn.cs: Added support for Acorn FileCore partition, closes diff --git a/DiscImageChef.Partitions/DiscImageChef.Partitions.csproj b/DiscImageChef.Partitions/DiscImageChef.Partitions.csproj index f6fc78e71..226d7801a 100644 --- a/DiscImageChef.Partitions/DiscImageChef.Partitions.csproj +++ b/DiscImageChef.Partitions/DiscImageChef.Partitions.csproj @@ -50,6 +50,7 @@ + diff --git a/DiscImageChef.Partitions/Human68k.cs b/DiscImageChef.Partitions/Human68k.cs new file mode 100644 index 000000000..c7e343f46 --- /dev/null +++ b/DiscImageChef.Partitions/Human68k.cs @@ -0,0 +1,138 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Human68k.cs +// Author(s) : Natalia Portillo +// +// Component : Component +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2016 Natalia Portillo +// ****************************************************************************/ + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using DiscImageChef.CommonTypes; +using DiscImageChef.Console; +using DiscImageChef.ImagePlugins; + +namespace DiscImageChef.PartPlugins +{ + class Human68K : PartPlugin + { + const uint X68kMagic = 0x5836384B; + + public Human68K() + { + Name = "Human 68k partitions"; + PluginUUID = new Guid("246A6D93-4F1A-1F8A-344D-50187A5513A9"); + } + + public override bool GetInformation(ImagePlugin imagePlugin, out List partitions) + { + partitions = new List(); + + byte[] sector; + ulong sectsPerUnit = 0; + + DicConsole.DebugWriteLine("Human68k plugin", "sectorSize = {0}", imagePlugin.GetSectorSize()); + + switch(imagePlugin.GetSectorSize()) + { + case 256: + sector = imagePlugin.ReadSector(4); + sectsPerUnit = 1; + break; + case 512: + sector = imagePlugin.ReadSector(4); + sectsPerUnit = 2; + break; + case 1024: + sector = imagePlugin.ReadSector(2); + sectsPerUnit = 1; + break; + default: + return false; + } + + X68kTable table = BigEndianMarshal.ByteArrayToStructureBigEndian(sector); + for(int i = 0; i < table.entries.Length; i++) + table.entries[i] = BigEndianMarshal.SwapStructureMembersEndian(table.entries[i]); + + DicConsole.DebugWriteLine("Human68k plugin", "table.signature = {0:X4}", table.magic); + DicConsole.DebugWriteLine("Human68k plugin", "table.size = {0:X4}", table.size); + DicConsole.DebugWriteLine("Human68k plugin", "table.size2 = {0:X4}", table.size2); + DicConsole.DebugWriteLine("Human68k plugin", "table.unknown = {0:X4}", table.unknown); + + if(table.magic != X68kMagic) + return false; + + ulong counter = 0; + + foreach(X68kEntry entry in table.entries) + { + DicConsole.DebugWriteLine("Human68k plugin", "entry.name = {0}", StringHandlers.CToString(entry.name, Encoding.GetEncoding(932))); + DicConsole.DebugWriteLine("Human68k plugin", "entry.stateStart = {0}", entry.stateStart); + DicConsole.DebugWriteLine("Human68k plugin", "entry.length = {0}", entry.length); + DicConsole.DebugWriteLine("Human68k plugin", "sectsPerUnit = {0} {1}", sectsPerUnit, imagePlugin.GetSectorSize()); + + Partition part = new Partition(); + part.PartitionStartSector = (entry.stateStart & 0xFFFFFF) * sectsPerUnit; + part.PartitionStart = part.PartitionStartSector * (ulong)sector.Length; + part.PartitionSectors = entry.length * sectsPerUnit; + part.PartitionLength = part.PartitionSectors * (ulong)sector.Length; + part.PartitionType = StringHandlers.CToString(entry.name, Encoding.GetEncoding(932)); + part.PartitionSequence = counter; + if(entry.length > 0) + { + partitions.Add(part); + counter++; + } + } + + return true; + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct X68kTable + { + public uint magic; + public uint size; + public uint size2; + public uint unknown; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public X68kEntry[] entries; + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct X68kEntry + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public byte[] name; + public uint stateStart; + public uint length; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Partitions/PC98.cs b/DiscImageChef.Partitions/PC98.cs index 2b9867770..cb3b1116b 100644 --- a/DiscImageChef.Partitions/PC98.cs +++ b/DiscImageChef.Partitions/PC98.cs @@ -33,6 +33,7 @@ using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.ImagePlugins; @@ -81,15 +82,21 @@ namespace DiscImageChef.PartPlugins part.PartitionSectors = CHStoLBA(entry.dp_ecyl, entry.dp_ehd, entry.dp_esect) - part.PartitionStartSector; part.PartitionLength = part.PartitionSectors * imagePlugin.GetSectorSize(); part.PartitionType = string.Format("{0}", (entry.dp_sid << 8) | entry.dp_mid); - part.PartitionName = entry.dp_name; + part.PartitionName = StringHandlers.CToString(entry.dp_name, Encoding.GetEncoding(932)); part.PartitionSequence = counter; - partitions.Add(part); - counter++; + if((entry.dp_sid & 0x7F) == 0x44 && + (entry.dp_mid & 0x7F) == 0x14 && + part.PartitionStartSector < imagePlugin.ImageInfo.sectors && + part.PartitionSectors + part.PartitionStartSector <= imagePlugin.ImageInfo.sectors) + { + partitions.Add(part); + counter++; + } } } - return true; + return partitions.Count > 0; } static uint CHStoLBA(ushort cyl, byte head, byte sector) @@ -123,7 +130,7 @@ namespace DiscImageChef.PartPlugins public byte dp_ehd; public ushort dp_ecyl; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public string dp_name; + public byte[] dp_name; } } } \ No newline at end of file diff --git a/DiscImageChef.Partitions/RioKarma.cs b/DiscImageChef.Partitions/RioKarma.cs index b3a6ddf79..88a9849a0 100644 --- a/DiscImageChef.Partitions/RioKarma.cs +++ b/DiscImageChef.Partitions/RioKarma.cs @@ -102,7 +102,7 @@ namespace DiscImageChef.PartPlugins [StructLayout(LayoutKind.Sequential, Pack = 1)] struct RioKarmaEntry { - public uint reserverd; + public uint reserved; public byte type; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] reserved2; diff --git a/DiscImageChef.Partitions/SGI.cs b/DiscImageChef.Partitions/SGI.cs index e5b736366..f2d34c433 100644 --- a/DiscImageChef.Partitions/SGI.cs +++ b/DiscImageChef.Partitions/SGI.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using System.Runtime.InteropServices; using DiscImageChef.CommonTypes; -using DiscImageChef.Helpers; using DiscImageChef.ImagePlugins; namespace DiscImageChef.PartPlugins @@ -57,7 +56,11 @@ namespace DiscImageChef.PartPlugins if(sector.Length < 512) return false; - SGILabel disklabel = BigEndianStructure.ByteArrayToStructureBigEndian(sector); + SGILabel disklabel = BigEndianMarshal.ByteArrayToStructureBigEndian(sector); + for(int i = 0; i < disklabel.volume.Length; i++) + disklabel.volume[i] = BigEndianMarshal.SwapStructureMembersEndian(disklabel.volume[i]); + for(int i = 0; i < disklabel.partitions.Length; i++) + disklabel.partitions[i] = BigEndianMarshal.SwapStructureMembersEndian(disklabel.partitions[i]); if(disklabel.magic != SGI_MAGIC) return false; diff --git a/DiscImageChef.Partitions/Sun.cs b/DiscImageChef.Partitions/Sun.cs index ee418b346..1b5ecf539 100644 --- a/DiscImageChef.Partitions/Sun.cs +++ b/DiscImageChef.Partitions/Sun.cs @@ -86,6 +86,9 @@ namespace DiscImageChef.PartPlugins { partitions = new List(); + if(imagePlugin.GetSectorSize() < 512) + return false; + byte[] sunSector = imagePlugin.ReadSector(0); byte[] tmpString; SunDiskLabel sdl = new SunDiskLabel();