diff --git a/.gitmodules b/.gitmodules index 5515bb8a..8fb51acd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,3 @@ -[submodule "BurnOutSharp/External/LessIO"] - path = BurnOutSharp/External/LessIO - url = https://github.com/activescott/LessIO.git -[submodule "BurnOutSharp/External/libmspack4n"] - path = BurnOutSharp/External/libmspack4n - url = https://github.com/activescott/libmspack4n.git [submodule "BurnOutSharp/External/hllib"] path = BurnOutSharp/External/hllib url = https://github.com/RavuAlHemio/hllib.git diff --git a/BurnOutSharp.sln b/BurnOutSharp.sln index 4567039e..c182ff06 100644 --- a/BurnOutSharp.sln +++ b/BurnOutSharp.sln @@ -20,6 +20,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{182E02A8-5E8 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Dtf.WindowsInstaller", "WixToolset\src\WixToolset.Dtf.WindowsInstaller\WixToolset.Dtf.WindowsInstaller.csproj", "{B3537EB7-CEF6-4D90-A041-47626442A656}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Dtf.Compression", "WixToolset\src\WixToolset.Dtf.Compression\WixToolset.Dtf.Compression.csproj", "{CC76B5EC-976E-4063-8561-1CD50693A034}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Dtf.Compression.Cab", "WixToolset\src\WixToolset.Dtf.Compression.Cab\WixToolset.Dtf.Compression.Cab.csproj", "{AD836467-FC28-46A7-966D-4FDD0F72019B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -38,6 +42,14 @@ Global {B3537EB7-CEF6-4D90-A041-47626442A656}.Debug|Any CPU.Build.0 = Debug|Any CPU {B3537EB7-CEF6-4D90-A041-47626442A656}.Release|Any CPU.ActiveCfg = Release|Any CPU {B3537EB7-CEF6-4D90-A041-47626442A656}.Release|Any CPU.Build.0 = Release|Any CPU + {CC76B5EC-976E-4063-8561-1CD50693A034}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC76B5EC-976E-4063-8561-1CD50693A034}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC76B5EC-976E-4063-8561-1CD50693A034}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC76B5EC-976E-4063-8561-1CD50693A034}.Release|Any CPU.Build.0 = Release|Any CPU + {AD836467-FC28-46A7-966D-4FDD0F72019B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AD836467-FC28-46A7-966D-4FDD0F72019B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AD836467-FC28-46A7-966D-4FDD0F72019B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AD836467-FC28-46A7-966D-4FDD0F72019B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -45,6 +57,8 @@ Global GlobalSection(NestedProjects) = preSolution {182E02A8-5E8E-4140-9C9B-61049C33E921} = {09D405CA-CF15-4929-8408-C970F0656C62} {B3537EB7-CEF6-4D90-A041-47626442A656} = {182E02A8-5E8E-4140-9C9B-61049C33E921} + {CC76B5EC-976E-4063-8561-1CD50693A034} = {182E02A8-5E8E-4140-9C9B-61049C33E921} + {AD836467-FC28-46A7-966D-4FDD0F72019B} = {182E02A8-5E8E-4140-9C9B-61049C33E921} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0B343DD2-8852-47B0-9647-DFCFBEDF933C} diff --git a/BurnOutSharp/BurnOutSharp.csproj b/BurnOutSharp/BurnOutSharp.csproj index 230809c9..f70e3321 100644 --- a/BurnOutSharp/BurnOutSharp.csproj +++ b/BurnOutSharp/BurnOutSharp.csproj @@ -40,9 +40,6 @@ External\hllib\HLExtract\**\*; External\hllib\HLExtract.Net\Program.cs; External\hllib\HLLib\**\*; - External\LessIO\src\LessIO.Tests\**\*; - External\libmspack4n\lib\**\*; - External\libmspack4n\libmspack4ntest\**\*; External\stormlibsharp\lib\**; External\stormlibsharp\TestConsole\** @@ -61,6 +58,8 @@ + + all diff --git a/BurnOutSharp/External/LessIO b/BurnOutSharp/External/LessIO deleted file mode 160000 index 1def7d19..00000000 --- a/BurnOutSharp/External/LessIO +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1def7d19cc8b2c0a2b5bdaed28b272cd2c32c54f diff --git a/BurnOutSharp/External/libmspack4n b/BurnOutSharp/External/libmspack4n deleted file mode 160000 index 7213a361..00000000 --- a/BurnOutSharp/External/libmspack4n +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7213a361f80bee1d96f428aceb5595977d024855 diff --git a/BurnOutSharp/FileType/MicrosoftCAB.cs b/BurnOutSharp/FileType/MicrosoftCAB.cs index d9fc0349..4169e350 100644 --- a/BurnOutSharp/FileType/MicrosoftCAB.cs +++ b/BurnOutSharp/FileType/MicrosoftCAB.cs @@ -3,7 +3,7 @@ using System.Collections.Concurrent; using System.IO; using BurnOutSharp.Interfaces; using BurnOutSharp.Tools; -using LibMSPackN; +using WixToolset.Dtf.Compression.Cab; namespace BurnOutSharp.FileType { @@ -41,19 +41,17 @@ namespace BurnOutSharp.FileType string tempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); Directory.CreateDirectory(tempPath); - using (MSCabinet cabfile = new MSCabinet(file)) + CabInfo cabfile = new CabInfo(file); + foreach (var sub in cabfile.GetFiles()) { - foreach (var sub in cabfile.GetFiles()) + // If an individual entry fails + try { - // If an individual entry fails - try - { - // The trim here is for some very odd and stubborn files - string tempFile = Path.Combine(tempPath, sub.Filename.TrimEnd('.')); - sub.ExtractTo(tempFile); - } - catch { } + // The trim here is for some very odd and stubborn files + string tempFile = Path.Combine(tempPath, sub.Name.TrimEnd('.')); + sub.CopyTo(tempFile); } + catch { } } // Collect and format all found protections diff --git a/BurnOutSharp/mspack.dll b/BurnOutSharp/mspack.dll deleted file mode 100644 index 32fd7fb9..00000000 Binary files a/BurnOutSharp/mspack.dll and /dev/null differ diff --git a/README.md b/README.md index 0e008186..8643c1e2 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,12 @@ C# port of the protection scanning ability of [BurnOut](http://burnout.sourcefor In addition to the original BurnOut code, the following libraries (or ports thereof) are used for file handling: - [HLExtract](https://github.com/Rupan/HLLib) - Various Valve archive format extraction -- [libmspack4n](https://github.com/activescott/libmspack4n) - Microsoft CAB extraction - [psxt001z](https://github.com/Dremora/psxt001z) - PS1 LibCrypt detection - [SharpCompress](https://github.com/adamhathcock/sharpcompress) - 7zip/GZip/RAR/PKZIP extraction - [StormLibSharp](https://github.com/robpaveza/stormlibsharp) - MPQ extraction - [UnshieldSharp](https://github.com/mnadareski/UnshieldSharp) - InstallShield CAB extraction - [WiseUnpacker](https://github.com/mnadareski/WiseUnpacker) - Wise Installer extraction -- [WixToolset.Dtf](https://github.com/wixtoolset/Dtf) - MSI extraction +- [WixToolset.Dtf](https://github.com/wixtoolset/Dtf) - MSI and Microsoft CAB extraction ## Protections Detected