From 083ded8a7e56a0dc55cc37edba6556fc8244f759 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 7 Jul 2022 12:43:35 -0700 Subject: [PATCH] Add framework for extract all files --- BurnOutSharp/FileType/MicrosoftCAB.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/BurnOutSharp/FileType/MicrosoftCAB.cs b/BurnOutSharp/FileType/MicrosoftCAB.cs index 14265d54..c1dd6ad1 100644 --- a/BurnOutSharp/FileType/MicrosoftCAB.cs +++ b/BurnOutSharp/FileType/MicrosoftCAB.cs @@ -281,6 +281,27 @@ namespace BurnOutSharp.FileType return found ? index : -1; } + /// + /// Extract all files from the archive to + /// + public bool ExtractAllFiles(string outputDirectory) + { + // Perform sanity checks + if (Header == null || Files == null || Files.Length == 0) + return false; + + // Loop through and extract all files + foreach (CFFILE file in Files) + { + string outputPath = Path.Combine(outputDirectory, file.NameAsString); + } + + // TODO: We don't check for other cabinets here yet + // TODO: Read and decompress data blocks + + return true; + } + /// /// Extract a single file from the archive to ///