diff --git a/SevenZip/7z.dll b/SevenZip/7z.dll index d5ff365..02d0974 100644 Binary files a/SevenZip/7z.dll and b/SevenZip/7z.dll differ diff --git a/SevenZip/7z64.dll b/SevenZip/7z64.dll index e9e5d23..b028a37 100644 Binary files a/SevenZip/7z64.dll and b/SevenZip/7z64.dll differ diff --git a/SevenZip/FileChecker.cs b/SevenZip/FileChecker.cs index 810b542..d383995 100644 --- a/SevenZip/FileChecker.cs +++ b/SevenZip/FileChecker.cs @@ -137,9 +137,9 @@ public static InArchiveFormat CheckSignature(Stream stream, out int offset, out return InArchiveFormat.Iso; } - if (SpecialDetect(stream, 0x9001, InArchiveFormat.Iso)) + if (SpecialDetect(stream, 0x200, InArchiveFormat.Gpt)) { - return InArchiveFormat.Iso; + return InArchiveFormat.Gpt; } if (SpecialDetect(stream, 0x400, InArchiveFormat.Hfs)) diff --git a/SevenZip/Formats.cs b/SevenZip/Formats.cs index 74d7d83..0d2538b 100644 --- a/SevenZip/Formats.cs +++ b/SevenZip/Formats.cs @@ -76,6 +76,11 @@ public enum InArchiveFormat /// Wikipedia information Nsis, /// + /// GUID Partition Table. + /// + /// Wikipedia information + Gpt, + /// /// RarLab Rar archive format, version 5. /// /// Wikipedia information @@ -387,6 +392,7 @@ internal static int GetMaxValue(Type type) {InArchiveFormat.Lzh, new Guid("23170f69-40c1-278a-1000-000110060000")}, {InArchiveFormat.Lzma, new Guid("23170f69-40c1-278a-1000-0001100a0000")}, {InArchiveFormat.Nsis, new Guid("23170f69-40c1-278a-1000-000110090000")}, + {InArchiveFormat.Gpt, new Guid("23170f69-40c1-278a-1000-000110cb0000")}, {InArchiveFormat.Rar, new Guid("23170f69-40c1-278a-1000-000110CC0000")}, {InArchiveFormat.Rar4, new Guid("23170f69-40c1-278a-1000-000110030000")}, {InArchiveFormat.Rpm, new Guid("23170f69-40c1-278a-1000-000110eb0000")}, @@ -422,7 +428,7 @@ internal static int GetMaxValue(Type type) {InArchiveFormat.MachO, new Guid("23170f69-40c1-278a-1000-000110DF0000")} }; - #endregion + #endregion /// /// List of writable archive format interface guids for 7-zip COM interop. @@ -437,10 +443,10 @@ internal static int GetMaxValue(Type type) {OutArchiveFormat.BZip2, new Guid("23170f69-40c1-278a-1000-000110020000")}, {OutArchiveFormat.GZip, new Guid("23170f69-40c1-278a-1000-000110ef0000")}, {OutArchiveFormat.Tar, new Guid("23170f69-40c1-278a-1000-000110ee0000")}, - {OutArchiveFormat.XZ, new Guid("23170f69-40c1-278a-1000-0001100C0000")}, + {OutArchiveFormat.XZ, new Guid("23170f69-40c1-278a-1000-0001100C0000")}, }; - #endregion + #endregion internal static readonly Dictionary MethodNames = new Dictionary @@ -456,7 +462,7 @@ internal static int GetMaxValue(Type type) {CompressionMethod.BZip2, "BZip2"} }; - #endregion + #endregion internal static readonly Dictionary InForOutFormats = new Dictionary @@ -471,7 +477,7 @@ internal static int GetMaxValue(Type type) {OutArchiveFormat.Zip, InArchiveFormat.Zip} }; - #endregion + #endregion /// /// List of archive formats corresponding to specific extensions @@ -506,7 +512,9 @@ internal static int GetMaxValue(Type type) {"swf", InArchiveFormat.Swf}, {"exe", InArchiveFormat.PE}, {"dll", InArchiveFormat.PE}, - {"vhd", InArchiveFormat.Vhd} + {"vhd", InArchiveFormat.Vhd}, + {"gpt", InArchiveFormat.Gpt }, + {"ntfs", InArchiveFormat.Ntfs } }; #endregion @@ -525,33 +533,34 @@ internal static int GetMaxValue(Type type) //257 byte offset {"52-61-72-21-1A-07-00", InArchiveFormat.Rar4}, {"52-61-72-21-1A-07-01-00", InArchiveFormat.Rar}, - {"50-4B-03-04", InArchiveFormat.Zip}, - {"5D-00-00-40-00", InArchiveFormat.Lzma}, - {"2D-6C-68", InArchiveFormat.Lzh}, + {"50-4B-03-04", InArchiveFormat.Zip}, + {"5D-00-00-40-00", InArchiveFormat.Lzma}, + {"2D-6C-68", InArchiveFormat.Lzh}, //^ 2 byte offset - {"1F-9D-90", InArchiveFormat.Lzw}, - {"60-EA", InArchiveFormat.Arj}, - {"42-5A-68", InArchiveFormat.BZip2}, - {"4D-53-43-46", InArchiveFormat.Cab}, - {"49-54-53-46", InArchiveFormat.Chm}, - {"21-3C-61-72-63-68-3E-0A-64-65-62-69-61-6E-2D-62-69-6E-61-72-79", InArchiveFormat.Deb}, - {"43-44-30-30-31", InArchiveFormat.Iso}, + {"1F-9D-90", InArchiveFormat.Lzw}, + {"60-EA", InArchiveFormat.Arj}, + {"42-5A-68", InArchiveFormat.BZip2}, + {"4D-53-43-46", InArchiveFormat.Cab}, + {"49-54-53-46", InArchiveFormat.Chm}, + {"21-3C-61-72-63-68-3E-0A-64-65-62-69-61-6E-2D-62-69-6E-61-72-79", InArchiveFormat.Deb}, + {"43-44-30-30-31", InArchiveFormat.Iso}, //^ 0x8001, 0x8801 or 0x9001 byte offset - {"ED-AB-EE-DB", InArchiveFormat.Rpm}, - {"4D-53-57-49-4D-00-00-00", InArchiveFormat.Wim}, - {"udf", InArchiveFormat.Udf}, - {"mub", InArchiveFormat.Mub}, - {"78-61-72-21", InArchiveFormat.Xar}, + {"ED-AB-EE-DB", InArchiveFormat.Rpm}, + {"4D-53-57-49-4D-00-00-00", InArchiveFormat.Wim}, + {"udf", InArchiveFormat.Udf}, + {"mub", InArchiveFormat.Mub}, + {"78-61-72-21", InArchiveFormat.Xar}, //0x400 byte offset - {"48-2B", InArchiveFormat.Hfs}, - {"FD-37-7A-58-5A", InArchiveFormat.XZ}, - {"46-4C-56", InArchiveFormat.Flv}, - {"46-57-53", InArchiveFormat.Swf}, - {"4D-5A", InArchiveFormat.PE}, - {"7F-45-4C-46", InArchiveFormat.Elf}, + {"48-2B", InArchiveFormat.Hfs}, + {"FD-37-7A-58-5A", InArchiveFormat.XZ}, + {"46-4C-56", InArchiveFormat.Flv}, + {"46-57-53", InArchiveFormat.Swf}, + {"4D-5A", InArchiveFormat.PE}, + {"7F-45-4C-46", InArchiveFormat.Elf}, {"78", InArchiveFormat.Dmg}, - {"63-6F-6E-65-63-74-69-78", InArchiveFormat.Vhd}}; - #endregion + {"63-6F-6E-65-63-74-69-78", InArchiveFormat.Vhd}, + {"45-46-49-20-50-41-52-54-00-00-01-00", InArchiveFormat.Gpt}}; + #endregion internal static Dictionary InSignatureFormatsReversed; @@ -583,8 +592,6 @@ public static InArchiveFormat FormatByFileName(string fileName, bool reportError if (!InExtensionFormats.ContainsKey(extension) && reportErrors) { throw new ArgumentException("Extension \"" + extension + "\" is not a supported archive file name extension."); - - } return InExtensionFormats[extension];