diff --git a/BurnOutSharp.Wrappers/AACSMediaKeyBlock.cs b/BurnOutSharp.Wrappers/AACSMediaKeyBlock.cs index 700f2602..da2021f2 100644 --- a/BurnOutSharp.Wrappers/AACSMediaKeyBlock.cs +++ b/BurnOutSharp.Wrappers/AACSMediaKeyBlock.cs @@ -6,6 +6,13 @@ namespace BurnOutSharp.Wrappers { public class AACSMediaKeyBlock : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "AACS Media Key Block"; + + #endregion + #region Pass-Through Properties #region Records diff --git a/BurnOutSharp.Wrappers/BDPlusSVM.cs b/BurnOutSharp.Wrappers/BDPlusSVM.cs index 6e04e206..cb3fc0d4 100644 --- a/BurnOutSharp.Wrappers/BDPlusSVM.cs +++ b/BurnOutSharp.Wrappers/BDPlusSVM.cs @@ -6,6 +6,13 @@ namespace BurnOutSharp.Wrappers { public class BDPlusSVM : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "BD+ SVM"; + + #endregion + #region Pass-Through Properties /// diff --git a/BurnOutSharp.Wrappers/BFPK.cs b/BurnOutSharp.Wrappers/BFPK.cs index 410b5c5c..c61381e8 100644 --- a/BurnOutSharp.Wrappers/BFPK.cs +++ b/BurnOutSharp.Wrappers/BFPK.cs @@ -7,6 +7,13 @@ namespace BurnOutSharp.Wrappers { public class BFPK : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "BFPK Archive"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp.Wrappers/BSP.cs b/BurnOutSharp.Wrappers/BSP.cs index 3d3e296d..acad763f 100644 --- a/BurnOutSharp.Wrappers/BSP.cs +++ b/BurnOutSharp.Wrappers/BSP.cs @@ -8,6 +8,13 @@ namespace BurnOutSharp.Wrappers { public class BSP : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "Half-Life Level (BSP)"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp.Wrappers/CFB.cs b/BurnOutSharp.Wrappers/CFB.cs index d660ddf8..33b144f6 100644 --- a/BurnOutSharp.Wrappers/CFB.cs +++ b/BurnOutSharp.Wrappers/CFB.cs @@ -7,6 +7,13 @@ namespace BurnOutSharp.Wrappers { public class CFB : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "Compact File Binary"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp.Wrappers/CIA.cs b/BurnOutSharp.Wrappers/CIA.cs index 7da0b8e0..98162c27 100644 --- a/BurnOutSharp.Wrappers/CIA.cs +++ b/BurnOutSharp.Wrappers/CIA.cs @@ -6,6 +6,13 @@ namespace BurnOutSharp.Wrappers { public class CIA : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "CTR Importable Archive (CIA)"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp.Wrappers/GCF.cs b/BurnOutSharp.Wrappers/GCF.cs index 1445907d..b5037270 100644 --- a/BurnOutSharp.Wrappers/GCF.cs +++ b/BurnOutSharp.Wrappers/GCF.cs @@ -7,6 +7,13 @@ namespace BurnOutSharp.Wrappers { public class GCF : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "Half-Life Game Cache File (GCF)"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp.Wrappers/InstallShieldCabinet.cs b/BurnOutSharp.Wrappers/InstallShieldCabinet.cs index a0747319..74d665b6 100644 --- a/BurnOutSharp.Wrappers/InstallShieldCabinet.cs +++ b/BurnOutSharp.Wrappers/InstallShieldCabinet.cs @@ -7,6 +7,13 @@ namespace BurnOutSharp.Wrappers { public partial class InstallShieldCabinet : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "InstallShield Cabinet"; + + #endregion + #region Pass-Through Properties #region Common Header diff --git a/BurnOutSharp.Wrappers/LinearExecutable.cs b/BurnOutSharp.Wrappers/LinearExecutable.cs index ccb9e6e5..7b5686d8 100644 --- a/BurnOutSharp.Wrappers/LinearExecutable.cs +++ b/BurnOutSharp.Wrappers/LinearExecutable.cs @@ -6,6 +6,13 @@ namespace BurnOutSharp.Wrappers { public class LinearExecutable : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "Linear Executable (LE/LX)"; + + #endregion + #region Pass-Through Properties #region MS-DOS Stub diff --git a/BurnOutSharp.Wrappers/MSDOS.cs b/BurnOutSharp.Wrappers/MSDOS.cs index 8d159735..771699c7 100644 --- a/BurnOutSharp.Wrappers/MSDOS.cs +++ b/BurnOutSharp.Wrappers/MSDOS.cs @@ -5,6 +5,13 @@ namespace BurnOutSharp.Wrappers { public class MSDOS : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "MS-DOS Executable"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp.Wrappers/MicrosoftCabinet.cs b/BurnOutSharp.Wrappers/MicrosoftCabinet.cs index b8708823..ac29c69c 100644 --- a/BurnOutSharp.Wrappers/MicrosoftCabinet.cs +++ b/BurnOutSharp.Wrappers/MicrosoftCabinet.cs @@ -7,6 +7,13 @@ namespace BurnOutSharp.Wrappers { public partial class MicrosoftCabinet : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "Microsoft Cabinet"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp.Wrappers/N3DS.cs b/BurnOutSharp.Wrappers/N3DS.cs index e2559bdb..91604efe 100644 --- a/BurnOutSharp.Wrappers/N3DS.cs +++ b/BurnOutSharp.Wrappers/N3DS.cs @@ -6,6 +6,13 @@ namespace BurnOutSharp.Wrappers { public class N3DS : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "Nintendo 3DS Cart Image"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp.Wrappers/NCF.cs b/BurnOutSharp.Wrappers/NCF.cs index 7287b0f0..c52bdb50 100644 --- a/BurnOutSharp.Wrappers/NCF.cs +++ b/BurnOutSharp.Wrappers/NCF.cs @@ -5,6 +5,13 @@ namespace BurnOutSharp.Wrappers { public class NCF : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "Half-Life No Cache File (NCF)"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp.Wrappers/NewExecutable.cs b/BurnOutSharp.Wrappers/NewExecutable.cs index e51ebd8a..084ca524 100644 --- a/BurnOutSharp.Wrappers/NewExecutable.cs +++ b/BurnOutSharp.Wrappers/NewExecutable.cs @@ -8,6 +8,13 @@ namespace BurnOutSharp.Wrappers { public class NewExecutable : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "New Executable (NE)"; + + #endregion + #region Pass-Through Properties #region MS-DOS Stub diff --git a/BurnOutSharp.Wrappers/Nitro.cs b/BurnOutSharp.Wrappers/Nitro.cs index dabb27a4..15eec5e6 100644 --- a/BurnOutSharp.Wrappers/Nitro.cs +++ b/BurnOutSharp.Wrappers/Nitro.cs @@ -6,6 +6,13 @@ namespace BurnOutSharp.Wrappers { public class Nitro : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "Nintendo DS/DSi Cart Image"; + + #endregion + #region Pass-Through Properties #region Common Header diff --git a/BurnOutSharp.Wrappers/PAK.cs b/BurnOutSharp.Wrappers/PAK.cs index 01f29d94..86a1c576 100644 --- a/BurnOutSharp.Wrappers/PAK.cs +++ b/BurnOutSharp.Wrappers/PAK.cs @@ -5,6 +5,13 @@ namespace BurnOutSharp.Wrappers { public class PAK : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "Half-Life Package File (PAK)"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp.Wrappers/PFF.cs b/BurnOutSharp.Wrappers/PFF.cs index 411eab54..115d1c99 100644 --- a/BurnOutSharp.Wrappers/PFF.cs +++ b/BurnOutSharp.Wrappers/PFF.cs @@ -5,6 +5,13 @@ namespace BurnOutSharp.Wrappers { public class PFF : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "NovaLogic Game Archive Format (PFF)"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp.Wrappers/PlayJAudioFile.cs b/BurnOutSharp.Wrappers/PlayJAudioFile.cs index 22b95bf8..ebd50ec7 100644 --- a/BurnOutSharp.Wrappers/PlayJAudioFile.cs +++ b/BurnOutSharp.Wrappers/PlayJAudioFile.cs @@ -6,6 +6,13 @@ namespace BurnOutSharp.Wrappers { public class PlayJAudioFile : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "PlayJ Audio File (PLJ)"; + + #endregion + #region Pass-Through Properties #region Audio Header diff --git a/BurnOutSharp.Wrappers/PortableExecutable.cs b/BurnOutSharp.Wrappers/PortableExecutable.cs index 04ddf034..7831855f 100644 --- a/BurnOutSharp.Wrappers/PortableExecutable.cs +++ b/BurnOutSharp.Wrappers/PortableExecutable.cs @@ -12,6 +12,13 @@ namespace BurnOutSharp.Wrappers { public class PortableExecutable : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "Portable Executable (PE)"; + + #endregion + #region Pass-Through Properties #region MS-DOS Stub diff --git a/BurnOutSharp.Wrappers/Quantum.cs b/BurnOutSharp.Wrappers/Quantum.cs index 9b09b692..b6c17682 100644 --- a/BurnOutSharp.Wrappers/Quantum.cs +++ b/BurnOutSharp.Wrappers/Quantum.cs @@ -5,6 +5,13 @@ namespace BurnOutSharp.Wrappers { public class Quantum : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "Quantum Archive"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp.Wrappers/SGA.cs b/BurnOutSharp.Wrappers/SGA.cs index 58db6fc0..ba096f05 100644 --- a/BurnOutSharp.Wrappers/SGA.cs +++ b/BurnOutSharp.Wrappers/SGA.cs @@ -9,6 +9,13 @@ namespace BurnOutSharp.Wrappers { public class SGA : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "SGA"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp.Wrappers/VBSP.cs b/BurnOutSharp.Wrappers/VBSP.cs index 1f763495..7c6a4a66 100644 --- a/BurnOutSharp.Wrappers/VBSP.cs +++ b/BurnOutSharp.Wrappers/VBSP.cs @@ -6,6 +6,13 @@ namespace BurnOutSharp.Wrappers { public class VBSP : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "Half-Life 2 Level (VBSP)"; + + #endregion + #region Pass-Through Properties /// diff --git a/BurnOutSharp.Wrappers/VPK.cs b/BurnOutSharp.Wrappers/VPK.cs index f7c713a7..d5b76c20 100644 --- a/BurnOutSharp.Wrappers/VPK.cs +++ b/BurnOutSharp.Wrappers/VPK.cs @@ -9,6 +9,13 @@ namespace BurnOutSharp.Wrappers { public class VPK : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "Valve Package File (VPK)"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp.Wrappers/WAD.cs b/BurnOutSharp.Wrappers/WAD.cs index 9c0cdaf8..0329a208 100644 --- a/BurnOutSharp.Wrappers/WAD.cs +++ b/BurnOutSharp.Wrappers/WAD.cs @@ -5,6 +5,13 @@ namespace BurnOutSharp.Wrappers { public class WAD : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "Half-Life Texture Package File (WAD)"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp.Wrappers/WrapperBase.cs b/BurnOutSharp.Wrappers/WrapperBase.cs index c6488214..5f9bc90c 100644 --- a/BurnOutSharp.Wrappers/WrapperBase.cs +++ b/BurnOutSharp.Wrappers/WrapperBase.cs @@ -9,6 +9,15 @@ namespace BurnOutSharp.Wrappers { public abstract class WrapperBase { + #region Descriptive Properties + + /// + /// Description of the object + /// + public abstract string Description { get; } + + #endregion + #region Instance Variables /// diff --git a/BurnOutSharp.Wrappers/XZP.cs b/BurnOutSharp.Wrappers/XZP.cs index 6d0a0c92..e46e1aff 100644 --- a/BurnOutSharp.Wrappers/XZP.cs +++ b/BurnOutSharp.Wrappers/XZP.cs @@ -6,6 +6,13 @@ namespace BurnOutSharp.Wrappers { public class XZP : WrapperBase { + #region Descriptive Properties + + /// + public override string Description => "Xbox Package File (XZP)"; + + #endregion + #region Pass-Through Properties #region Header diff --git a/BurnOutSharp/Enums.cs b/BurnOutSharp/Enums.cs index 7ebfd4f6..58588fd3 100644 --- a/BurnOutSharp/Enums.cs +++ b/BurnOutSharp/Enums.cs @@ -186,7 +186,7 @@ XZ, /// - /// xz archive + /// Xbox Package File /// XZP, } diff --git a/Test/Printer.cs b/Test/Printer.cs index a7496766..8787d890 100644 --- a/Test/Printer.cs +++ b/Test/Printer.cs @@ -2,9 +2,7 @@ using System; using System.IO; using System.Text; using BurnOutSharp; -using BurnOutSharp.Matching; using BurnOutSharp.Utilities; -using BurnOutSharp.Wrappers; namespace Test { @@ -63,202 +61,18 @@ namespace Test Console.WriteLine($"File format found: {ft}"); // Setup the wrapper to print - string wrapperName = null; - WrapperBase wrapper = null; - - // Assign the correct wrapper - switch (ft) - { - // AACS Media Key Block - case SupportedFileType.AACSMediaKeyBlock: - wrapperName = "AACS media key block"; - wrapper = AACSMediaKeyBlock.Create(stream); - break; - - // BD+ SVM - case SupportedFileType.BDPlusSVM: - wrapperName = "BD+ SVM"; - wrapper = BDPlusSVM.Create(stream); - break; - - // BFPK archive - case SupportedFileType.BFPK: - wrapperName = "BFPK archive"; - wrapper = BFPK.Create(stream); - break; - - // BSP - case SupportedFileType.BSP: - wrapperName = "BSP"; - wrapper = BSP.Create(stream); - break; - - // CFB - case SupportedFileType.CFB: - wrapperName = "Compact File Binary"; - wrapper = CFB.Create(stream); - break; - - // CIA - case SupportedFileType.CIA: - wrapperName = "CIA"; - wrapper = CIA.Create(stream); - break; - - // MS-DOS executable and decendents - case SupportedFileType.Executable: - wrapperName = "MS-DOS executable"; - wrapper = MSDOS.Create(stream); - if (wrapper != null) - { - // Check for a valid new executable address - if ((wrapper as MSDOS).NewExeHeaderAddr >= stream.Length) - break; - - // Try to read the executable info - stream.Seek((wrapper as MSDOS).NewExeHeaderAddr, SeekOrigin.Begin); - magic = stream.ReadBytes(4); - - // New Executable - if (magic.StartsWith(BurnOutSharp.Models.NewExecutable.Constants.SignatureBytes)) - { - stream.Seek(0, SeekOrigin.Begin); - wrapperName = "New Executable"; - wrapper = NewExecutable.Create(stream); - } - - // Linear Executable - else if (magic.StartsWith(BurnOutSharp.Models.LinearExecutable.Constants.LESignatureBytes) - || magic.StartsWith(BurnOutSharp.Models.LinearExecutable.Constants.LXSignatureBytes)) - { - stream.Seek(0, SeekOrigin.Begin); - wrapperName = "Linear Executable"; - wrapper = LinearExecutable.Create(stream); - } - - // Portable Executable - else if (magic.StartsWith(BurnOutSharp.Models.PortableExecutable.Constants.SignatureBytes)) - { - stream.Seek(0, SeekOrigin.Begin); - wrapperName = "Portable Executable"; - wrapper = PortableExecutable.Create(stream); - } - } - - break; - - // GCF - case SupportedFileType.GCF: - wrapperName = "GCF"; - wrapper = GCF.Create(stream); - break; - - // IS-CAB archive - case SupportedFileType.InstallShieldCAB: - wrapperName = "InstallShield Cabinet"; - wrapper = InstallShieldCabinet.Create(stream); - break; - - // MoPaQ (MPQ) archive - case SupportedFileType.MPQ: - wrapperName = "MoPaQ archive"; - //wrapper = MPQ.Create(stream); - break; - - // MS-CAB archive - case SupportedFileType.MicrosoftCAB: - wrapperName = "Microsoft Cabinet"; - wrapper = MicrosoftCabinet.Create(stream); - break; - - // N3DS - case SupportedFileType.N3DS: - wrapperName = "Nintendo 3DS"; - wrapper = N3DS.Create(stream); - break; - - // NCF - case SupportedFileType.NCF: - wrapperName = "NCF"; - wrapper = NCF.Create(stream); - break; - - // Nitro - case SupportedFileType.Nitro: - wrapperName = "Nintendo DS/DSi"; - wrapper = Nitro.Create(stream); - break; - - // PAK - case SupportedFileType.PAK: - wrapperName = "Nintendo DS/DSi"; - wrapper = PAK.Create(stream); - break; - - // PFF - case SupportedFileType.PFF: - wrapperName = "NovaLogic Game Archive Format"; - wrapper = PFF.Create(stream); - break; - - // PLJ - case SupportedFileType.PLJ: - wrapperName = "PlayJ audio file"; - wrapper = PlayJAudioFile.Create(stream); - break; - - // Quantum - case SupportedFileType.Quantum: - wrapperName = "Quantum archive"; - wrapper = Quantum.Create(stream); - break; - - // SGA - case SupportedFileType.SGA: - wrapperName = "SGA"; - wrapper = SGA.Create(stream); - break; - - // VBSP - case SupportedFileType.VBSP: - wrapperName = "VBSP"; - wrapper = VBSP.Create(stream); - break; - - // VPK - case SupportedFileType.VPK: - wrapperName = "VPK"; - wrapper = VPK.Create(stream); - break; - - // WAD - case SupportedFileType.WAD: - wrapperName = "Valve WAD"; - wrapper = WAD.Create(stream); - break; - - // XZP - case SupportedFileType.XZP: - wrapperName = "XZP"; - wrapper = XZP.Create(stream); - break; - - default: - Console.WriteLine($"{ft} cannot have information printed yet!"); - Console.WriteLine(); - return; - } + var wrapper = BurnOutSharp.Tools.Utilities.CreateWrapper(ft, stream); // If we don't have a wrapper if (wrapper == null) { - Console.WriteLine($"Something went wrong parsing {wrapperName}!"); + Console.WriteLine($"Either {ft} is not supported or something went wrong during parsing!"); Console.WriteLine(); return; } // Print the wrapper name - Console.WriteLine($"{wrapperName} wrapper created successfully!"); + Console.WriteLine($"{wrapper.Description} wrapper created successfully!"); // Get the base info output name string filenameBase = $"info-{DateTime.Now:yyyy-MM-dd_HHmmss.ffff}";