diff --git a/BinaryObjectScanner.Builders/AACS.cs b/BinaryObjectScanner.Builders/AACS.cs index 73fb6087..1e6ceadb 100644 --- a/BinaryObjectScanner.Builders/AACS.cs +++ b/BinaryObjectScanner.Builders/AACS.cs @@ -2,8 +2,8 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; -using BinaryObjectScanner.Models.AACS; using BinaryObjectScanner.Utilities; +using SabreTools.Models.AACS; namespace BinaryObjectScanner.Builders { diff --git a/BinaryObjectScanner.Builders/BDPlus.cs b/BinaryObjectScanner.Builders/BDPlus.cs index 03dc3f73..a5b5d88b 100644 --- a/BinaryObjectScanner.Builders/BDPlus.cs +++ b/BinaryObjectScanner.Builders/BDPlus.cs @@ -1,8 +1,8 @@ using System.IO; using System.Text; -using BinaryObjectScanner.Models.BDPlus; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.BDPlus.Constants; +using SabreTools.Models.BDPlus; +using static SabreTools.Models.BDPlus.Constants; namespace BinaryObjectScanner.Builders { diff --git a/BinaryObjectScanner.Builders/BFPK.cs b/BinaryObjectScanner.Builders/BFPK.cs index e2a3e9d2..337d7ccf 100644 --- a/BinaryObjectScanner.Builders/BFPK.cs +++ b/BinaryObjectScanner.Builders/BFPK.cs @@ -1,8 +1,8 @@ using System.IO; using System.Text; -using BinaryObjectScanner.Models.BFPK; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.BFPK.Constants; +using SabreTools.Models.BFPK; +using static SabreTools.Models.BFPK.Constants; namespace BinaryObjectScanner.Builders { diff --git a/BinaryObjectScanner.Builders/BSP.cs b/BinaryObjectScanner.Builders/BSP.cs index d0af8c36..ba86685f 100644 --- a/BinaryObjectScanner.Builders/BSP.cs +++ b/BinaryObjectScanner.Builders/BSP.cs @@ -1,9 +1,9 @@ using System.IO; using System.Linq; using System.Text; -using BinaryObjectScanner.Models.BSP; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.BSP.Constants; +using SabreTools.Models.BSP; +using static SabreTools.Models.BSP.Constants; namespace BinaryObjectScanner.Builders { @@ -17,7 +17,7 @@ namespace BinaryObjectScanner.Builders /// Byte array to parse /// Offset into the byte array /// Filled Half-Life Level on success, null on error - public static Models.BSP.File ParseFile(byte[] data, int offset) + public static SabreTools.Models.BSP.File ParseFile(byte[] data, int offset) { // If the data is invalid if (data == null) @@ -41,7 +41,7 @@ namespace BinaryObjectScanner.Builders /// /// Stream to parse /// Filled Half-Life Level on success, null on error - public static Models.BSP.File ParseFile(Stream data) + public static SabreTools.Models.BSP.File ParseFile(Stream data) { // If the data is invalid if (data == null || data.Length == 0 || !data.CanSeek || !data.CanRead) @@ -55,7 +55,7 @@ namespace BinaryObjectScanner.Builders int initialOffset = (int)data.Position; // Create a new Half-Life Level to fill - var file = new Models.BSP.File(); + var file = new SabreTools.Models.BSP.File(); #region Header diff --git a/BinaryObjectScanner.Builders/BinaryObjectScanner.Builders.csproj b/BinaryObjectScanner.Builders/BinaryObjectScanner.Builders.csproj index be1e943e..e929642e 100644 --- a/BinaryObjectScanner.Builders/BinaryObjectScanner.Builders.csproj +++ b/BinaryObjectScanner.Builders/BinaryObjectScanner.Builders.csproj @@ -21,8 +21,11 @@ - + + + + diff --git a/BinaryObjectScanner.Builders/CFB.cs b/BinaryObjectScanner.Builders/CFB.cs index 3328937f..e7410d93 100644 --- a/BinaryObjectScanner.Builders/CFB.cs +++ b/BinaryObjectScanner.Builders/CFB.cs @@ -2,9 +2,9 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; -using BinaryObjectScanner.Models.CFB; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.CFB.Constants; +using SabreTools.Models.CFB; +using static SabreTools.Models.CFB.Constants; namespace BinaryObjectScanner.Builders { diff --git a/BinaryObjectScanner.Builders/Extensions.cs b/BinaryObjectScanner.Builders/Extensions.cs index f90c3b0c..f083cbeb 100644 --- a/BinaryObjectScanner.Builders/Extensions.cs +++ b/BinaryObjectScanner.Builders/Extensions.cs @@ -17,7 +17,7 @@ namespace BinaryObjectScanner.Builders /// /// Resource type information entry to check /// True if the entry is an integer type, false if an offset, null on error - public static bool? IsIntegerType(this Models.NewExecutable.ResourceTypeInformationEntry entry) + public static bool? IsIntegerType(this SabreTools.Models.NewExecutable.ResourceTypeInformationEntry entry) { // We can't do anything with an invalid entry if (entry == null) @@ -32,7 +32,7 @@ namespace BinaryObjectScanner.Builders /// /// Resource type resource entry to check /// True if the entry is an integer type, false if an offset, null on error - public static bool? IsIntegerType(this Models.NewExecutable.ResourceTypeResourceEntry entry) + public static bool? IsIntegerType(this SabreTools.Models.NewExecutable.ResourceTypeResourceEntry entry) { // We can't do anything with an invalid entry if (entry == null) @@ -47,22 +47,22 @@ namespace BinaryObjectScanner.Builders /// /// Entry table bundle to check /// SegmentEntryType corresponding to the type - public static Models.NewExecutable.SegmentEntryType GetEntryType(this Models.NewExecutable.EntryTableBundle entry) + public static SabreTools.Models.NewExecutable.SegmentEntryType GetEntryType(this SabreTools.Models.NewExecutable.EntryTableBundle entry) { // We can't do anything with an invalid entry if (entry == null) - return Models.NewExecutable.SegmentEntryType.Unused; + return SabreTools.Models.NewExecutable.SegmentEntryType.Unused; // Determine the entry type based on segment indicator if (entry.SegmentIndicator == 0x00) - return Models.NewExecutable.SegmentEntryType.Unused; + return SabreTools.Models.NewExecutable.SegmentEntryType.Unused; else if (entry.SegmentIndicator >= 0x01 && entry.SegmentIndicator <= 0xFE) - return Models.NewExecutable.SegmentEntryType.FixedSegment; + return SabreTools.Models.NewExecutable.SegmentEntryType.FixedSegment; else if (entry.SegmentIndicator == 0xFF) - return Models.NewExecutable.SegmentEntryType.MoveableSegment; + return SabreTools.Models.NewExecutable.SegmentEntryType.MoveableSegment; // We should never get here - return Models.NewExecutable.SegmentEntryType.Unused; + return SabreTools.Models.NewExecutable.SegmentEntryType.Unused; } #endregion @@ -75,7 +75,7 @@ namespace BinaryObjectScanner.Builders /// Relative virtual address to convert /// Array of sections to check against /// Physical address, 0 on error - public static uint ConvertVirtualAddress(this uint rva, Models.PortableExecutable.SectionHeader[] sections) + public static uint ConvertVirtualAddress(this uint rva, SabreTools.Models.PortableExecutable.SectionHeader[] sections) { // If we have an invalid section table, we can't do anything if (sections == null || sections.Length == 0) @@ -118,7 +118,7 @@ namespace BinaryObjectScanner.Builders /// Relative virtual address to convert /// Array of sections to check against /// Section index, null on error - public static int ContainingSectionIndex(this uint rva, Models.PortableExecutable.SectionHeader[] sections) + public static int ContainingSectionIndex(this uint rva, SabreTools.Models.PortableExecutable.SectionHeader[] sections) { // If we have an invalid section table, we can't do anything if (sections == null || sections.Length == 0) @@ -156,14 +156,14 @@ namespace BinaryObjectScanner.Builders /// Data to parse into overlay data /// Offset into the byte array /// A filled SecuROM AddD overlay data on success, null on error - public static Models.PortableExecutable.SecuROMAddD AsSecuROMAddD(this byte[] data, ref int offset) + public static SabreTools.Models.PortableExecutable.SecuROMAddD AsSecuROMAddD(this byte[] data, ref int offset) { // If we have data that's invalid, we can't do anything if (data == null) return null; // Read in the table - var addD = new Models.PortableExecutable.SecuROMAddD(); + var addD = new SabreTools.Models.PortableExecutable.SecuROMAddD(); addD.Signature = data.ReadUInt32(ref offset); if (addD.Signature != 0x44646441) @@ -189,10 +189,10 @@ namespace BinaryObjectScanner.Builders addD.Unknown14h = data.ReadBytes(ref offset, bytesToRead); - addD.Entries = new Models.PortableExecutable.SecuROMAddDEntry[addD.EntryCount]; + addD.Entries = new SabreTools.Models.PortableExecutable.SecuROMAddDEntry[addD.EntryCount]; for (int i = 0; i < addD.EntryCount; i++) { - var addDEntry = new Models.PortableExecutable.SecuROMAddDEntry(); + var addDEntry = new SabreTools.Models.PortableExecutable.SecuROMAddDEntry(); addDEntry.PhysicalOffset = data.ReadUInt32(ref offset); addDEntry.Length = data.ReadUInt32(ref offset); @@ -219,13 +219,13 @@ namespace BinaryObjectScanner.Builders /// Data to parse into a database /// Offset into the byte array /// A filled NB10 Program Database on success, null on error - public static Models.PortableExecutable.NB10ProgramDatabase AsNB10ProgramDatabase(this byte[] data, ref int offset) + public static SabreTools.Models.PortableExecutable.NB10ProgramDatabase AsNB10ProgramDatabase(this byte[] data, ref int offset) { // If we have data that's invalid, we can't do anything if (data == null) return null; - var nb10ProgramDatabase = new Models.PortableExecutable.NB10ProgramDatabase(); + var nb10ProgramDatabase = new SabreTools.Models.PortableExecutable.NB10ProgramDatabase(); nb10ProgramDatabase.Signature = data.ReadUInt32(ref offset); if (nb10ProgramDatabase.Signature != 0x3031424E) @@ -245,13 +245,13 @@ namespace BinaryObjectScanner.Builders /// Data to parse into a database /// Offset into the byte array /// A filled RSDS Program Database on success, null on error - public static Models.PortableExecutable.RSDSProgramDatabase AsRSDSProgramDatabase(this byte[] data, ref int offset) + public static SabreTools.Models.PortableExecutable.RSDSProgramDatabase AsRSDSProgramDatabase(this byte[] data, ref int offset) { // If we have data that's invalid, we can't do anything if (data == null) return null; - var rsdsProgramDatabase = new Models.PortableExecutable.RSDSProgramDatabase(); + var rsdsProgramDatabase = new SabreTools.Models.PortableExecutable.RSDSProgramDatabase(); rsdsProgramDatabase.Signature = data.ReadUInt32(ref offset); if (rsdsProgramDatabase.Signature != 0x53445352) @@ -275,20 +275,20 @@ namespace BinaryObjectScanner.Builders /// Data to parse into a resource header /// Offset into the byte array /// A filled resource header on success, null on error - public static Models.PortableExecutable.ResourceHeader AsResourceHeader(this byte[] data, ref int offset) + public static SabreTools.Models.PortableExecutable.ResourceHeader AsResourceHeader(this byte[] data, ref int offset) { // If we have data that's invalid, we can't do anything if (data == null) return null; // Read in the table - var header = new Models.PortableExecutable.ResourceHeader(); + var header = new SabreTools.Models.PortableExecutable.ResourceHeader(); header.DataSize = data.ReadUInt32(ref offset); header.HeaderSize = data.ReadUInt32(ref offset); - header.ResourceType = (Models.PortableExecutable.ResourceType)data.ReadUInt32(ref offset); // TODO: Could be a string too + header.ResourceType = (SabreTools.Models.PortableExecutable.ResourceType)data.ReadUInt32(ref offset); // TODO: Could be a string too header.Name = data.ReadUInt32(ref offset); // TODO: Could be a string too header.DataVersion = data.ReadUInt32(ref offset); - header.MemoryFlags = (Models.PortableExecutable.MemoryFlags)data.ReadUInt16(ref offset); + header.MemoryFlags = (SabreTools.Models.PortableExecutable.MemoryFlags)data.ReadUInt16(ref offset); header.LanguageId = data.ReadUInt16(ref offset); header.Version = data.ReadUInt32(ref offset); header.Characteristics = data.ReadUInt32(ref offset); @@ -301,7 +301,7 @@ namespace BinaryObjectScanner.Builders /// /// Resource data entry to parse into an accelerator table resource /// A filled accelerator table resource on success, null on error - public static Models.PortableExecutable.AcceleratorTableEntry[] AsAcceleratorTableResource(this Models.PortableExecutable.ResourceDataEntry entry) + public static SabreTools.Models.PortableExecutable.AcceleratorTableEntry[] AsAcceleratorTableResource(this SabreTools.Models.PortableExecutable.ResourceDataEntry entry) { // If we have data that's invalid for this resource type, we can't do anything if (entry?.Data == null || entry.Data.Length % 8 != 0) @@ -314,14 +314,14 @@ namespace BinaryObjectScanner.Builders int offset = 0; // Create the output object - var table = new Models.PortableExecutable.AcceleratorTableEntry[count]; + var table = new SabreTools.Models.PortableExecutable.AcceleratorTableEntry[count]; // Read in the table for (int i = 0; i < count; i++) { - var acceleratorTableEntry = new Models.PortableExecutable.AcceleratorTableEntry(); + var acceleratorTableEntry = new SabreTools.Models.PortableExecutable.AcceleratorTableEntry(); - acceleratorTableEntry.Flags = (Models.PortableExecutable.AcceleratorTableFlags)entry.Data.ReadUInt16(ref offset); + acceleratorTableEntry.Flags = (SabreTools.Models.PortableExecutable.AcceleratorTableFlags)entry.Data.ReadUInt16(ref offset); acceleratorTableEntry.Ansi = entry.Data.ReadUInt16(ref offset); acceleratorTableEntry.Id = entry.Data.ReadUInt16(ref offset); acceleratorTableEntry.Padding = entry.Data.ReadUInt16(ref offset); @@ -337,7 +337,7 @@ namespace BinaryObjectScanner.Builders /// /// Resource data entry to parse into a side-by-side assembly manifest /// A filled side-by-side assembly manifest on success, null on error - public static Models.PortableExecutable.AssemblyManifest AsAssemblyManifest(this Models.PortableExecutable.ResourceDataEntry entry) + public static SabreTools.Models.PortableExecutable.AssemblyManifest AsAssemblyManifest(this SabreTools.Models.PortableExecutable.ResourceDataEntry entry) { // If we have an invalid entry, just skip if (entry?.Data == null) @@ -345,8 +345,8 @@ namespace BinaryObjectScanner.Builders try { - XmlSerializer serializer = new XmlSerializer(typeof(Models.PortableExecutable.AssemblyManifest)); - return serializer.Deserialize(new MemoryStream(entry.Data)) as Models.PortableExecutable.AssemblyManifest; + XmlSerializer serializer = new XmlSerializer(typeof(SabreTools.Models.PortableExecutable.AssemblyManifest)); + return serializer.Deserialize(new MemoryStream(entry.Data)) as SabreTools.Models.PortableExecutable.AssemblyManifest; } catch { @@ -359,7 +359,7 @@ namespace BinaryObjectScanner.Builders /// /// Resource data entry to parse into a dialog box /// A filled dialog box on success, null on error - public static Models.PortableExecutable.DialogBoxResource AsDialogBox(this Models.PortableExecutable.ResourceDataEntry entry) + public static SabreTools.Models.PortableExecutable.DialogBoxResource AsDialogBox(this SabreTools.Models.PortableExecutable.ResourceDataEntry entry) { // If we have an invalid entry, just skip if (entry?.Data == null) @@ -369,7 +369,7 @@ namespace BinaryObjectScanner.Builders int offset = 0; // Create the output object - var dialogBoxResource = new Models.PortableExecutable.DialogBoxResource(); + var dialogBoxResource = new SabreTools.Models.PortableExecutable.DialogBoxResource(); // Try to read the signature for an extended dialog box template int signatureOffset = sizeof(ushort); @@ -378,13 +378,13 @@ namespace BinaryObjectScanner.Builders { #region Extended dialog template - var dialogTemplateExtended = new Models.PortableExecutable.DialogTemplateExtended(); + var dialogTemplateExtended = new SabreTools.Models.PortableExecutable.DialogTemplateExtended(); dialogTemplateExtended.Version = entry.Data.ReadUInt16(ref offset); dialogTemplateExtended.Signature = entry.Data.ReadUInt16(ref offset); dialogTemplateExtended.HelpID = entry.Data.ReadUInt32(ref offset); - dialogTemplateExtended.ExtendedStyle = (Models.PortableExecutable.ExtendedWindowStyles)entry.Data.ReadUInt32(ref offset); - dialogTemplateExtended.Style = (Models.PortableExecutable.WindowStyles)entry.Data.ReadUInt32(ref offset); + dialogTemplateExtended.ExtendedStyle = (SabreTools.Models.PortableExecutable.ExtendedWindowStyles)entry.Data.ReadUInt32(ref offset); + dialogTemplateExtended.Style = (SabreTools.Models.PortableExecutable.WindowStyles)entry.Data.ReadUInt32(ref offset); dialogTemplateExtended.DialogItems = entry.Data.ReadUInt16(ref offset); dialogTemplateExtended.PositionX = entry.Data.ReadInt16(ref offset); dialogTemplateExtended.PositionY = entry.Data.ReadInt16(ref offset); @@ -493,7 +493,7 @@ namespace BinaryObjectScanner.Builders #region Point size and typeface // Only if DS_SETFONT is set are the values here used - if (dialogTemplateExtended.Style.HasFlag(Models.PortableExecutable.WindowStyles.DS_SETFONT)) + if (dialogTemplateExtended.Style.HasFlag(SabreTools.Models.PortableExecutable.WindowStyles.DS_SETFONT)) { dialogTemplateExtended.PointSize = entry.Data.ReadUInt16(ref offset); dialogTemplateExtended.Weight = entry.Data.ReadUInt16(ref offset); @@ -517,15 +517,15 @@ namespace BinaryObjectScanner.Builders #region Extended dialog item templates - var dialogItemExtendedTemplates = new List(); + var dialogItemExtendedTemplates = new List(); for (int i = 0; i < dialogTemplateExtended.DialogItems; i++) { - var dialogItemTemplate = new Models.PortableExecutable.DialogItemTemplateExtended(); + var dialogItemTemplate = new SabreTools.Models.PortableExecutable.DialogItemTemplateExtended(); dialogItemTemplate.HelpID = entry.Data.ReadUInt32(ref offset); - dialogItemTemplate.ExtendedStyle = (Models.PortableExecutable.ExtendedWindowStyles)entry.Data.ReadUInt32(ref offset); - dialogItemTemplate.Style = (Models.PortableExecutable.WindowStyles)entry.Data.ReadUInt32(ref offset); + dialogItemTemplate.ExtendedStyle = (SabreTools.Models.PortableExecutable.ExtendedWindowStyles)entry.Data.ReadUInt32(ref offset); + dialogItemTemplate.Style = (SabreTools.Models.PortableExecutable.WindowStyles)entry.Data.ReadUInt32(ref offset); dialogItemTemplate.PositionX = entry.Data.ReadInt16(ref offset); dialogItemTemplate.PositionY = entry.Data.ReadInt16(ref offset); dialogItemTemplate.WidthX = entry.Data.ReadInt16(ref offset); @@ -545,7 +545,7 @@ namespace BinaryObjectScanner.Builders _ = entry.Data.ReadUInt16(ref offset); // Read the ordinal - dialogItemTemplate.ClassResourceOrdinal = (Models.PortableExecutable.DialogItemTemplateOrdinal)entry.Data.ReadUInt16(ref offset); + dialogItemTemplate.ClassResourceOrdinal = (SabreTools.Models.PortableExecutable.DialogItemTemplateOrdinal)entry.Data.ReadUInt16(ref offset); } else { @@ -623,10 +623,10 @@ namespace BinaryObjectScanner.Builders { #region Dialog template - var dialogTemplate = new Models.PortableExecutable.DialogTemplate(); + var dialogTemplate = new SabreTools.Models.PortableExecutable.DialogTemplate(); - dialogTemplate.Style = (Models.PortableExecutable.WindowStyles)entry.Data.ReadUInt32(ref offset); - dialogTemplate.ExtendedStyle = (Models.PortableExecutable.ExtendedWindowStyles)entry.Data.ReadUInt32(ref offset); + dialogTemplate.Style = (SabreTools.Models.PortableExecutable.WindowStyles)entry.Data.ReadUInt32(ref offset); + dialogTemplate.ExtendedStyle = (SabreTools.Models.PortableExecutable.ExtendedWindowStyles)entry.Data.ReadUInt32(ref offset); dialogTemplate.ItemCount = entry.Data.ReadUInt16(ref offset); dialogTemplate.PositionX = entry.Data.ReadInt16(ref offset); dialogTemplate.PositionY = entry.Data.ReadInt16(ref offset); @@ -735,7 +735,7 @@ namespace BinaryObjectScanner.Builders #region Point size and typeface // Only if DS_SETFONT is set are the values here used - if (dialogTemplate.Style.HasFlag(Models.PortableExecutable.WindowStyles.DS_SETFONT)) + if (dialogTemplate.Style.HasFlag(SabreTools.Models.PortableExecutable.WindowStyles.DS_SETFONT)) { dialogTemplate.PointSizeValue = entry.Data.ReadUInt16(ref offset); @@ -758,14 +758,14 @@ namespace BinaryObjectScanner.Builders #region Dialog item templates - var dialogItemTemplates = new List(); + var dialogItemTemplates = new List(); for (int i = 0; i < dialogTemplate.ItemCount; i++) { - var dialogItemTemplate = new Models.PortableExecutable.DialogItemTemplate(); + var dialogItemTemplate = new SabreTools.Models.PortableExecutable.DialogItemTemplate(); - dialogItemTemplate.Style = (Models.PortableExecutable.WindowStyles)entry.Data.ReadUInt32(ref offset); - dialogItemTemplate.ExtendedStyle = (Models.PortableExecutable.ExtendedWindowStyles)entry.Data.ReadUInt32(ref offset); + dialogItemTemplate.Style = (SabreTools.Models.PortableExecutable.WindowStyles)entry.Data.ReadUInt32(ref offset); + dialogItemTemplate.ExtendedStyle = (SabreTools.Models.PortableExecutable.ExtendedWindowStyles)entry.Data.ReadUInt32(ref offset); dialogItemTemplate.PositionX = entry.Data.ReadInt16(ref offset); dialogItemTemplate.PositionY = entry.Data.ReadInt16(ref offset); dialogItemTemplate.WidthX = entry.Data.ReadInt16(ref offset); @@ -785,7 +785,7 @@ namespace BinaryObjectScanner.Builders _ = entry.Data.ReadUInt16(ref offset); // Read the ordinal - dialogItemTemplate.ClassResourceOrdinal = (Models.PortableExecutable.DialogItemTemplateOrdinal)entry.Data.ReadUInt16(ref offset); + dialogItemTemplate.ClassResourceOrdinal = (SabreTools.Models.PortableExecutable.DialogItemTemplateOrdinal)entry.Data.ReadUInt16(ref offset); } else { @@ -868,7 +868,7 @@ namespace BinaryObjectScanner.Builders /// /// Resource data entry to parse into a font group /// A filled font group on success, null on error - public static Models.PortableExecutable.FontGroupHeader AsFontGroup(this Models.PortableExecutable.ResourceDataEntry entry) + public static SabreTools.Models.PortableExecutable.FontGroupHeader AsFontGroup(this SabreTools.Models.PortableExecutable.ResourceDataEntry entry) { // If we have an invalid entry, just skip if (entry?.Data == null) @@ -878,19 +878,19 @@ namespace BinaryObjectScanner.Builders int offset = 0; // Create the output object - var fontGroupHeader = new Models.PortableExecutable.FontGroupHeader(); + var fontGroupHeader = new SabreTools.Models.PortableExecutable.FontGroupHeader(); fontGroupHeader.NumberOfFonts = entry.Data.ReadUInt16(ref offset); if (fontGroupHeader.NumberOfFonts > 0) { - fontGroupHeader.DE = new Models.PortableExecutable.DirEntry[fontGroupHeader.NumberOfFonts]; + fontGroupHeader.DE = new SabreTools.Models.PortableExecutable.DirEntry[fontGroupHeader.NumberOfFonts]; for (int i = 0; i < fontGroupHeader.NumberOfFonts; i++) { - var dirEntry = new Models.PortableExecutable.DirEntry(); + var dirEntry = new SabreTools.Models.PortableExecutable.DirEntry(); dirEntry.FontOrdinal = entry.Data.ReadUInt16(ref offset); - dirEntry.Entry = new Models.PortableExecutable.FontDirEntry(); + dirEntry.Entry = new SabreTools.Models.PortableExecutable.FontDirEntry(); dirEntry.Entry.Version = entry.Data.ReadUInt16(ref offset); dirEntry.Entry.Size = entry.Data.ReadUInt32(ref offset); dirEntry.Entry.Copyright = entry.Data.ReadBytes(ref offset, 60); @@ -937,7 +937,7 @@ namespace BinaryObjectScanner.Builders /// /// Resource data entry to parse into a menu /// A filled menu on success, null on error - public static Models.PortableExecutable.MenuResource AsMenu(this Models.PortableExecutable.ResourceDataEntry entry) + public static SabreTools.Models.PortableExecutable.MenuResource AsMenu(this SabreTools.Models.PortableExecutable.ResourceDataEntry entry) { // If we have an invalid entry, just skip if (entry?.Data == null) @@ -947,7 +947,7 @@ namespace BinaryObjectScanner.Builders int offset = 0; // Create the output object - var menuResource = new Models.PortableExecutable.MenuResource(); + var menuResource = new SabreTools.Models.PortableExecutable.MenuResource(); // Try to read the version for an extended header int versionOffset = 0; @@ -956,7 +956,7 @@ namespace BinaryObjectScanner.Builders { #region Extended menu header - var menuHeaderExtended = new Models.PortableExecutable.MenuHeaderExtended(); + var menuHeaderExtended = new SabreTools.Models.PortableExecutable.MenuHeaderExtended(); menuHeaderExtended.Version = entry.Data.ReadUInt16(ref offset); menuHeaderExtended.Offset = entry.Data.ReadUInt16(ref offset); @@ -968,7 +968,7 @@ namespace BinaryObjectScanner.Builders #region Extended dialog item templates - var extendedMenuItems = new List(); + var extendedMenuItems = new List(); if (offset != 0) { @@ -976,12 +976,12 @@ namespace BinaryObjectScanner.Builders while (offset < entry.Data.Length) { - var extendedMenuItem = new Models.PortableExecutable.MenuItemExtended(); + var extendedMenuItem = new SabreTools.Models.PortableExecutable.MenuItemExtended(); - extendedMenuItem.ItemType = (Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt32(ref offset); - extendedMenuItem.State = (Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt32(ref offset); + extendedMenuItem.ItemType = (SabreTools.Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt32(ref offset); + extendedMenuItem.State = (SabreTools.Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt32(ref offset); extendedMenuItem.ID = entry.Data.ReadUInt32(ref offset); - extendedMenuItem.Flags = (Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt32(ref offset); + extendedMenuItem.Flags = (SabreTools.Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt32(ref offset); extendedMenuItem.MenuText = entry.Data.ReadString(ref offset, Encoding.Unicode); // Align to the DWORD boundary if we're not at the end @@ -1003,7 +1003,7 @@ namespace BinaryObjectScanner.Builders { #region Menu header - var menuHeader = new Models.PortableExecutable.MenuHeader(); + var menuHeader = new SabreTools.Models.PortableExecutable.MenuHeader(); menuHeader.Version = entry.Data.ReadUInt16(ref offset); menuHeader.HeaderSize = entry.Data.ReadUInt16(ref offset); @@ -1014,26 +1014,26 @@ namespace BinaryObjectScanner.Builders #region Menu items - var menuItems = new List(); + var menuItems = new List(); while (offset < entry.Data.Length) { - var menuItem = new Models.PortableExecutable.MenuItem(); + var menuItem = new SabreTools.Models.PortableExecutable.MenuItem(); // Determine if this is a popup int flagsOffset = offset; - var initialFlags = (Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt16(ref flagsOffset); - if (initialFlags.HasFlag(Models.PortableExecutable.MenuFlags.MF_POPUP)) + var initialFlags = (SabreTools.Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt16(ref flagsOffset); + if (initialFlags.HasFlag(SabreTools.Models.PortableExecutable.MenuFlags.MF_POPUP)) { - menuItem.PopupItemType = (Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt32(ref offset); - menuItem.PopupState = (Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt32(ref offset); + menuItem.PopupItemType = (SabreTools.Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt32(ref offset); + menuItem.PopupState = (SabreTools.Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt32(ref offset); menuItem.PopupID = entry.Data.ReadUInt32(ref offset); - menuItem.PopupResInfo = (Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt32(ref offset); + menuItem.PopupResInfo = (SabreTools.Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt32(ref offset); menuItem.PopupMenuText = entry.Data.ReadString(ref offset, Encoding.Unicode); } else { - menuItem.NormalResInfo = (Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt16(ref offset); + menuItem.NormalResInfo = (SabreTools.Models.PortableExecutable.MenuFlags)entry.Data.ReadUInt16(ref offset); menuItem.NormalMenuText = entry.Data.ReadString(ref offset, Encoding.Unicode); } @@ -1060,7 +1060,7 @@ namespace BinaryObjectScanner.Builders /// /// Resource data entry to parse into a message table resource /// A filled message table resource on success, null on error - public static Models.PortableExecutable.MessageResourceData AsMessageResourceData(this Models.PortableExecutable.ResourceDataEntry entry) + public static SabreTools.Models.PortableExecutable.MessageResourceData AsMessageResourceData(this SabreTools.Models.PortableExecutable.ResourceDataEntry entry) { // If we have an invalid entry, just skip if (entry?.Data == null) @@ -1070,17 +1070,17 @@ namespace BinaryObjectScanner.Builders int offset = 0; // Create the output object - var messageResourceData = new Models.PortableExecutable.MessageResourceData(); + var messageResourceData = new SabreTools.Models.PortableExecutable.MessageResourceData(); // Message resource blocks messageResourceData.NumberOfBlocks = entry.Data.ReadUInt32(ref offset); if (messageResourceData.NumberOfBlocks > 0) { - var messageResourceBlocks = new List(); + var messageResourceBlocks = new List(); for (int i = 0; i < messageResourceData.NumberOfBlocks; i++) { - var messageResourceBlock = new Models.PortableExecutable.MessageResourceBlock(); + var messageResourceBlock = new SabreTools.Models.PortableExecutable.MessageResourceBlock(); messageResourceBlock.LowId = entry.Data.ReadUInt32(ref offset); messageResourceBlock.HighId = entry.Data.ReadUInt32(ref offset); @@ -1095,7 +1095,7 @@ namespace BinaryObjectScanner.Builders // Message resource entries if (messageResourceData.Blocks != null && messageResourceData.Blocks.Length != 0) { - var messageResourceEntries = new Dictionary(); + var messageResourceEntries = new Dictionary(); for (int i = 0; i < messageResourceData.Blocks.Length; i++) { @@ -1104,7 +1104,7 @@ namespace BinaryObjectScanner.Builders for (uint j = messageResourceBlock.LowId; j <= messageResourceBlock.HighId; j++) { - var messageResourceEntry = new Models.PortableExecutable.MessageResourceEntry(); + var messageResourceEntry = new SabreTools.Models.PortableExecutable.MessageResourceEntry(); messageResourceEntry.Length = entry.Data.ReadUInt16(ref offset); messageResourceEntry.Flags = entry.Data.ReadUInt16(ref offset); @@ -1128,7 +1128,7 @@ namespace BinaryObjectScanner.Builders /// /// Resource data entry to parse into a string table resource /// A filled string table resource on success, null on error - public static Dictionary AsStringTable(this Models.PortableExecutable.ResourceDataEntry entry) + public static Dictionary AsStringTable(this SabreTools.Models.PortableExecutable.ResourceDataEntry entry) { // If we have an invalid entry, just skip if (entry?.Data == null) @@ -1171,7 +1171,7 @@ namespace BinaryObjectScanner.Builders /// /// Resource data entry to parse into a version info resource /// A filled version info resource on success, null on error - public static Models.PortableExecutable.VersionInfo AsVersionInfo(this Models.PortableExecutable.ResourceDataEntry entry) + public static SabreTools.Models.PortableExecutable.VersionInfo AsVersionInfo(this SabreTools.Models.PortableExecutable.ResourceDataEntry entry) { // If we have an invalid entry, just skip if (entry?.Data == null) @@ -1181,11 +1181,11 @@ namespace BinaryObjectScanner.Builders int offset = 0; // Create the output object - var versionInfo = new Models.PortableExecutable.VersionInfo(); + var versionInfo = new SabreTools.Models.PortableExecutable.VersionInfo(); versionInfo.Length = entry.Data.ReadUInt16(ref offset); versionInfo.ValueLength = entry.Data.ReadUInt16(ref offset); - versionInfo.ResourceType = (Models.PortableExecutable.VersionResourceType)entry.Data.ReadUInt16(ref offset); + versionInfo.ResourceType = (SabreTools.Models.PortableExecutable.VersionResourceType)entry.Data.ReadUInt16(ref offset); versionInfo.Key = entry.Data.ReadString(ref offset, Encoding.Unicode); if (versionInfo.Key != "VS_VERSION_INFO") return null; @@ -1196,7 +1196,7 @@ namespace BinaryObjectScanner.Builders // Read fixed file info if (versionInfo.ValueLength > 0) { - var fixedFileInfo = new Models.PortableExecutable.FixedFileInfo(); + var fixedFileInfo = new SabreTools.Models.PortableExecutable.FixedFileInfo(); fixedFileInfo.Signature = entry.Data.ReadUInt32(ref offset); if (fixedFileInfo.Signature != 0xFEEF04BD) return null; @@ -1207,10 +1207,10 @@ namespace BinaryObjectScanner.Builders fixedFileInfo.ProductVersionMS = entry.Data.ReadUInt32(ref offset); fixedFileInfo.ProductVersionLS = entry.Data.ReadUInt32(ref offset); fixedFileInfo.FileFlagsMask = entry.Data.ReadUInt32(ref offset); - fixedFileInfo.FileFlags = (Models.PortableExecutable.FixedFileInfoFlags)(entry.Data.ReadUInt32(ref offset) & fixedFileInfo.FileFlagsMask); - fixedFileInfo.FileOS = (Models.PortableExecutable.FixedFileInfoOS)entry.Data.ReadUInt32(ref offset); - fixedFileInfo.FileType = (Models.PortableExecutable.FixedFileInfoFileType)entry.Data.ReadUInt32(ref offset); - fixedFileInfo.FileSubtype = (Models.PortableExecutable.FixedFileInfoFileSubtype)entry.Data.ReadUInt32(ref offset); + fixedFileInfo.FileFlags = (SabreTools.Models.PortableExecutable.FixedFileInfoFlags)(entry.Data.ReadUInt32(ref offset) & fixedFileInfo.FileFlagsMask); + fixedFileInfo.FileOS = (SabreTools.Models.PortableExecutable.FixedFileInfoOS)entry.Data.ReadUInt32(ref offset); + fixedFileInfo.FileType = (SabreTools.Models.PortableExecutable.FixedFileInfoFileType)entry.Data.ReadUInt32(ref offset); + fixedFileInfo.FileSubtype = (SabreTools.Models.PortableExecutable.FixedFileInfoFileSubtype)entry.Data.ReadUInt32(ref offset); fixedFileInfo.FileDateMS = entry.Data.ReadUInt32(ref offset); fixedFileInfo.FileDateLS = entry.Data.ReadUInt32(ref offset); versionInfo.Value = fixedFileInfo; @@ -1275,16 +1275,16 @@ namespace BinaryObjectScanner.Builders /// Data to parse into a string file info /// Offset into the byte array /// A filled string file info resource on success, null on error - private static Models.PortableExecutable.StringFileInfo AsStringFileInfo(byte[] data, ref int offset) + private static SabreTools.Models.PortableExecutable.StringFileInfo AsStringFileInfo(byte[] data, ref int offset) { - var stringFileInfo = new Models.PortableExecutable.StringFileInfo(); + var stringFileInfo = new SabreTools.Models.PortableExecutable.StringFileInfo(); // Cache the initial offset int currentOffset = offset; stringFileInfo.Length = data.ReadUInt16(ref offset); stringFileInfo.ValueLength = data.ReadUInt16(ref offset); - stringFileInfo.ResourceType = (Models.PortableExecutable.VersionResourceType)data.ReadUInt16(ref offset); + stringFileInfo.ResourceType = (SabreTools.Models.PortableExecutable.VersionResourceType)data.ReadUInt16(ref offset); stringFileInfo.Key = data.ReadString(ref offset, Encoding.Unicode); if (stringFileInfo.Key != "StringFileInfo") { @@ -1299,14 +1299,14 @@ namespace BinaryObjectScanner.Builders stringFileInfo.Padding = data.ReadByte(ref offset); } - var stringFileInfoChildren = new List(); + var stringFileInfoChildren = new List(); while ((offset - currentOffset) < stringFileInfo.Length) { - var stringTable = new Models.PortableExecutable.StringTable(); + var stringTable = new SabreTools.Models.PortableExecutable.StringTable(); stringTable.Length = data.ReadUInt16(ref offset); stringTable.ValueLength = data.ReadUInt16(ref offset); - stringTable.ResourceType = (Models.PortableExecutable.VersionResourceType)data.ReadUInt16(ref offset); + stringTable.ResourceType = (SabreTools.Models.PortableExecutable.VersionResourceType)data.ReadUInt16(ref offset); stringTable.Key = data.ReadString(ref offset, Encoding.Unicode); // Align to the DWORD boundary if we're not at the end @@ -1316,14 +1316,14 @@ namespace BinaryObjectScanner.Builders stringTable.Padding = data.ReadByte(ref offset); } - var stringTableChildren = new List(); + var stringTableChildren = new List(); while ((offset - currentOffset) < stringTable.Length) { - var stringData = new Models.PortableExecutable.StringData(); + var stringData = new SabreTools.Models.PortableExecutable.StringData(); stringData.Length = data.ReadUInt16(ref offset); stringData.ValueLength = data.ReadUInt16(ref offset); - stringData.ResourceType = (Models.PortableExecutable.VersionResourceType)data.ReadUInt16(ref offset); + stringData.ResourceType = (SabreTools.Models.PortableExecutable.VersionResourceType)data.ReadUInt16(ref offset); stringData.Key = data.ReadString(ref offset, Encoding.Unicode); // Align to the DWORD boundary if we're not at the end @@ -1365,16 +1365,16 @@ namespace BinaryObjectScanner.Builders /// Data to parse into a var file info /// Offset into the byte array /// A filled var file info resource on success, null on error - private static Models.PortableExecutable.VarFileInfo AsVarFileInfo(byte[] data, ref int offset) + private static SabreTools.Models.PortableExecutable.VarFileInfo AsVarFileInfo(byte[] data, ref int offset) { - var varFileInfo = new Models.PortableExecutable.VarFileInfo(); + var varFileInfo = new SabreTools.Models.PortableExecutable.VarFileInfo(); // Cache the initial offset int initialOffset = offset; varFileInfo.Length = data.ReadUInt16(ref offset); varFileInfo.ValueLength = data.ReadUInt16(ref offset); - varFileInfo.ResourceType = (Models.PortableExecutable.VersionResourceType)data.ReadUInt16(ref offset); + varFileInfo.ResourceType = (SabreTools.Models.PortableExecutable.VersionResourceType)data.ReadUInt16(ref offset); varFileInfo.Key = data.ReadString(ref offset, Encoding.Unicode); if (varFileInfo.Key != "VarFileInfo") return null; @@ -1386,14 +1386,14 @@ namespace BinaryObjectScanner.Builders varFileInfo.Padding = data.ReadByte(ref offset); } - var varFileInfoChildren = new List(); + var varFileInfoChildren = new List(); while ((offset - initialOffset) < varFileInfo.Length) { - var varData = new Models.PortableExecutable.VarData(); + var varData = new SabreTools.Models.PortableExecutable.VarData(); varData.Length = data.ReadUInt16(ref offset); varData.ValueLength = data.ReadUInt16(ref offset); - varData.ResourceType = (Models.PortableExecutable.VersionResourceType)data.ReadUInt16(ref offset); + varData.ResourceType = (SabreTools.Models.PortableExecutable.VersionResourceType)data.ReadUInt16(ref offset); varData.Key = data.ReadString(ref offset, Encoding.Unicode); if (varData.Key != "Translation") { diff --git a/BinaryObjectScanner.Builders/GCF.cs b/BinaryObjectScanner.Builders/GCF.cs index e8dee2e8..a35c5966 100644 --- a/BinaryObjectScanner.Builders/GCF.cs +++ b/BinaryObjectScanner.Builders/GCF.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; using System.IO; using System.Text; -using BinaryObjectScanner.Models.GCF; using BinaryObjectScanner.Utilities; +using SabreTools.Models.GCF; namespace BinaryObjectScanner.Builders { @@ -16,7 +16,7 @@ namespace BinaryObjectScanner.Builders /// Byte array to parse /// Offset into the byte array /// Filled Half-Life Game Cache on success, null on error - public static Models.GCF.File ParseFile(byte[] data, int offset) + public static SabreTools.Models.GCF.File ParseFile(byte[] data, int offset) { // If the data is invalid if (data == null) @@ -40,7 +40,7 @@ namespace BinaryObjectScanner.Builders /// /// Stream to parse /// Filled Half-Life Game Cache on success, null on error - public static Models.GCF.File ParseFile(Stream data) + public static SabreTools.Models.GCF.File ParseFile(Stream data) { // If the data is invalid if (data == null || data.Length == 0 || !data.CanSeek || !data.CanRead) @@ -54,7 +54,7 @@ namespace BinaryObjectScanner.Builders long initialOffset = data.Position; // Create a new Half-Life Game Cache to fill - var file = new Models.GCF.File(); + var file = new SabreTools.Models.GCF.File(); #region Header diff --git a/BinaryObjectScanner.Builders/InstallShieldCabinet.cs b/BinaryObjectScanner.Builders/InstallShieldCabinet.cs index 6af9f837..f1fb680e 100644 --- a/BinaryObjectScanner.Builders/InstallShieldCabinet.cs +++ b/BinaryObjectScanner.Builders/InstallShieldCabinet.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using System.IO; using System.Text; -using BinaryObjectScanner.Models.InstallShieldCabinet; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.InstallShieldCabinet.Constants; +using SabreTools.Models.InstallShieldCabinet; +using static SabreTools.Models.InstallShieldCabinet.Constants; namespace BinaryObjectScanner.Builders { diff --git a/BinaryObjectScanner.Builders/LinearExecutable.cs b/BinaryObjectScanner.Builders/LinearExecutable.cs index 8c0a556b..8146a887 100644 --- a/BinaryObjectScanner.Builders/LinearExecutable.cs +++ b/BinaryObjectScanner.Builders/LinearExecutable.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using System.IO; using System.Text; -using BinaryObjectScanner.Models.LinearExecutable; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.LinearExecutable.Constants; +using SabreTools.Models.LinearExecutable; +using static SabreTools.Models.LinearExecutable.Constants; namespace BinaryObjectScanner.Builders { diff --git a/BinaryObjectScanner.Builders/MSDOS.cs b/BinaryObjectScanner.Builders/MSDOS.cs index 01499acd..1cc9a902 100644 --- a/BinaryObjectScanner.Builders/MSDOS.cs +++ b/BinaryObjectScanner.Builders/MSDOS.cs @@ -1,8 +1,8 @@ using System.IO; using System.Text; -using BinaryObjectScanner.Models.MSDOS; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.MSDOS.Constants; +using SabreTools.Models.MSDOS; +using static SabreTools.Models.MSDOS.Constants; namespace BinaryObjectScanner.Builders { diff --git a/BinaryObjectScanner.Builders/MicrosoftCabinet.cs b/BinaryObjectScanner.Builders/MicrosoftCabinet.cs index 86ca6c14..debf9f8c 100644 --- a/BinaryObjectScanner.Builders/MicrosoftCabinet.cs +++ b/BinaryObjectScanner.Builders/MicrosoftCabinet.cs @@ -1,8 +1,8 @@ using System.IO; using System.Text; -using BinaryObjectScanner.Models.MicrosoftCabinet; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.MicrosoftCabinet.Constants; +using SabreTools.Models.MicrosoftCabinet; +using static SabreTools.Models.MicrosoftCabinet.Constants; namespace BinaryObjectScanner.Builders { @@ -243,9 +243,9 @@ namespace BinaryObjectScanner.Builders file.FolderIndex = (FolderIndex)data.ReadUInt16(); file.Date = data.ReadUInt16(); file.Time = data.ReadUInt16(); - file.Attributes = (Models.MicrosoftCabinet.FileAttributes)data.ReadUInt16(); + file.Attributes = (SabreTools.Models.MicrosoftCabinet.FileAttributes)data.ReadUInt16(); - if (file.Attributes.HasFlag(Models.MicrosoftCabinet.FileAttributes.NAME_IS_UTF)) + if (file.Attributes.HasFlag(SabreTools.Models.MicrosoftCabinet.FileAttributes.NAME_IS_UTF)) file.Name = data.ReadString(Encoding.Unicode); else file.Name = data.ReadString(Encoding.ASCII); diff --git a/BinaryObjectScanner.Builders/MoPaQ.cs b/BinaryObjectScanner.Builders/MoPaQ.cs index 4ad218ef..7c50ddb6 100644 --- a/BinaryObjectScanner.Builders/MoPaQ.cs +++ b/BinaryObjectScanner.Builders/MoPaQ.cs @@ -2,9 +2,9 @@ using System.Collections.Generic; using System.IO; using System.Text; -using BinaryObjectScanner.Models.MoPaQ; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.MoPaQ.Constants; +using SabreTools.Models.MoPaQ; +using static SabreTools.Models.MoPaQ.Constants; namespace BinaryObjectScanner.Builders { diff --git a/BinaryObjectScanner.Builders/N3DS.cs b/BinaryObjectScanner.Builders/N3DS.cs index 223d0710..207da72b 100644 --- a/BinaryObjectScanner.Builders/N3DS.cs +++ b/BinaryObjectScanner.Builders/N3DS.cs @@ -1,9 +1,9 @@ using System; using System.IO; using System.Text; -using BinaryObjectScanner.Models.N3DS; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.N3DS.Constants; +using SabreTools.Models.N3DS; +using static SabreTools.Models.N3DS.Constants; namespace BinaryObjectScanner.Builders { diff --git a/BinaryObjectScanner.Builders/NCF.cs b/BinaryObjectScanner.Builders/NCF.cs index 0607cd8d..90bfe71d 100644 --- a/BinaryObjectScanner.Builders/NCF.cs +++ b/BinaryObjectScanner.Builders/NCF.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; using System.IO; using System.Text; -using BinaryObjectScanner.Models.NCF; using BinaryObjectScanner.Utilities; +using SabreTools.Models.NCF; namespace BinaryObjectScanner.Builders { @@ -16,7 +16,7 @@ namespace BinaryObjectScanner.Builders /// Byte array to parse /// Offset into the byte array /// Filled Half-Life No Cache on success, null on error - public static Models.NCF.File ParseFile(byte[] data, int offset) + public static SabreTools.Models.NCF.File ParseFile(byte[] data, int offset) { // If the data is invalid if (data == null) @@ -40,7 +40,7 @@ namespace BinaryObjectScanner.Builders /// /// Stream to parse /// Filled Half-Life No Cache on success, null on error - public static Models.NCF.File ParseFile(Stream data) + public static SabreTools.Models.NCF.File ParseFile(Stream data) { // If the data is invalid if (data == null || data.Length == 0 || !data.CanSeek || !data.CanRead) @@ -54,7 +54,7 @@ namespace BinaryObjectScanner.Builders long initialOffset = data.Position; // Create a new Half-Life No Cache to fill - var file = new Models.NCF.File(); + var file = new SabreTools.Models.NCF.File(); #region Header diff --git a/BinaryObjectScanner.Builders/NewExecutable.cs b/BinaryObjectScanner.Builders/NewExecutable.cs index f08b4f49..804d6e71 100644 --- a/BinaryObjectScanner.Builders/NewExecutable.cs +++ b/BinaryObjectScanner.Builders/NewExecutable.cs @@ -2,9 +2,9 @@ using System.IO; using System.Linq; using System.Text; -using BinaryObjectScanner.Models.NewExecutable; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.NewExecutable.Constants; +using SabreTools.Models.NewExecutable; +using static SabreTools.Models.NewExecutable.Constants; namespace BinaryObjectScanner.Builders { diff --git a/BinaryObjectScanner.Builders/Nitro.cs b/BinaryObjectScanner.Builders/Nitro.cs index bd7aa30c..09a1b6a1 100644 --- a/BinaryObjectScanner.Builders/Nitro.cs +++ b/BinaryObjectScanner.Builders/Nitro.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; using System.IO; using System.Text; -using BinaryObjectScanner.Models.Nitro; using BinaryObjectScanner.Utilities; +using SabreTools.Models.Nitro; namespace BinaryObjectScanner.Builders { diff --git a/BinaryObjectScanner.Builders/PAK.cs b/BinaryObjectScanner.Builders/PAK.cs index f82d899b..6bd8fc8f 100644 --- a/BinaryObjectScanner.Builders/PAK.cs +++ b/BinaryObjectScanner.Builders/PAK.cs @@ -1,8 +1,8 @@ using System.IO; using System.Text; -using BinaryObjectScanner.Models.PAK; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.PAK.Constants; +using SabreTools.Models.PAK; +using static SabreTools.Models.PAK.Constants; namespace BinaryObjectScanner.Builders { @@ -16,7 +16,7 @@ namespace BinaryObjectScanner.Builders /// Byte array to parse /// Offset into the byte array /// Filled Half-Life Package on success, null on error - public static Models.PAK.File ParseFile(byte[] data, int offset) + public static SabreTools.Models.PAK.File ParseFile(byte[] data, int offset) { // If the data is invalid if (data == null) @@ -40,7 +40,7 @@ namespace BinaryObjectScanner.Builders /// /// Stream to parse /// Filled Half-Life Package on success, null on error - public static Models.PAK.File ParseFile(Stream data) + public static SabreTools.Models.PAK.File ParseFile(Stream data) { // If the data is invalid if (data == null || data.Length == 0 || !data.CanSeek || !data.CanRead) @@ -54,7 +54,7 @@ namespace BinaryObjectScanner.Builders long initialOffset = data.Position; // Create a new Half-Life Package to fill - var file = new Models.PAK.File(); + var file = new SabreTools.Models.PAK.File(); #region Header diff --git a/BinaryObjectScanner.Builders/PFF.cs b/BinaryObjectScanner.Builders/PFF.cs index 6256db2c..57ed71e0 100644 --- a/BinaryObjectScanner.Builders/PFF.cs +++ b/BinaryObjectScanner.Builders/PFF.cs @@ -1,8 +1,8 @@ using System.IO; using System.Text; -using BinaryObjectScanner.Models.PFF; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.PFF.Constants; +using SabreTools.Models.PFF; +using static SabreTools.Models.PFF.Constants; namespace BinaryObjectScanner.Builders { diff --git a/BinaryObjectScanner.Builders/PlayJ.cs b/BinaryObjectScanner.Builders/PlayJ.cs index b69ee761..402f5c22 100644 --- a/BinaryObjectScanner.Builders/PlayJ.cs +++ b/BinaryObjectScanner.Builders/PlayJ.cs @@ -1,8 +1,8 @@ using System.IO; using System.Text; -using BinaryObjectScanner.Models.PlayJ; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.PlayJ.Constants; +using SabreTools.Models.PlayJ; +using static SabreTools.Models.PlayJ.Constants; namespace BinaryObjectScanner.Builders { diff --git a/BinaryObjectScanner.Builders/PortableExecutable.cs b/BinaryObjectScanner.Builders/PortableExecutable.cs index c2c88b4f..3b3d8bd7 100644 --- a/BinaryObjectScanner.Builders/PortableExecutable.cs +++ b/BinaryObjectScanner.Builders/PortableExecutable.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; -using BinaryObjectScanner.Models.PortableExecutable; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.PortableExecutable.Constants; +using SabreTools.Models.PortableExecutable; +using static SabreTools.Models.PortableExecutable.Constants; namespace BinaryObjectScanner.Builders { @@ -1303,7 +1303,7 @@ namespace BinaryObjectScanner.Builders while (data.Position - initialOffset < size && data.Position % 0x200 != 0 && data.Position < data.Length - 1) { // If we find the start of an MS-DOS header - if (data.ReadUInt16() == Models.MSDOS.Constants.SignatureUInt16) + if (data.ReadUInt16() == SabreTools.Models.MSDOS.Constants.SignatureUInt16) { data.Seek(-2, origin: SeekOrigin.Current); break; diff --git a/BinaryObjectScanner.Builders/Quantum.cs b/BinaryObjectScanner.Builders/Quantum.cs index b596a911..cd10553d 100644 --- a/BinaryObjectScanner.Builders/Quantum.cs +++ b/BinaryObjectScanner.Builders/Quantum.cs @@ -1,8 +1,8 @@ using System.IO; using System.Text; -using BinaryObjectScanner.Models.Quantum; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.Quantum.Constants; +using SabreTools.Models.Quantum; +using static SabreTools.Models.Quantum.Constants; namespace BinaryObjectScanner.Builders { diff --git a/BinaryObjectScanner.Builders/SGA.cs b/BinaryObjectScanner.Builders/SGA.cs index e1919faa..5cc97639 100644 --- a/BinaryObjectScanner.Builders/SGA.cs +++ b/BinaryObjectScanner.Builders/SGA.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using System.IO; using System.Text; -using BinaryObjectScanner.Models.SGA; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.SGA.Constants; +using SabreTools.Models.SGA; +using static SabreTools.Models.SGA.Constants; namespace BinaryObjectScanner.Builders { @@ -17,7 +17,7 @@ namespace BinaryObjectScanner.Builders /// Byte array to parse /// Offset into the byte array /// Filled SGA on success, null on error - public static Models.SGA.File ParseFile(byte[] data, int offset) + public static SabreTools.Models.SGA.File ParseFile(byte[] data, int offset) { // If the data is invalid if (data == null) @@ -41,7 +41,7 @@ namespace BinaryObjectScanner.Builders /// /// Stream to parse /// Filled SGA on success, null on error - public static Models.SGA.File ParseFile(Stream data) + public static SabreTools.Models.SGA.File ParseFile(Stream data) { // If the data is invalid if (data == null || data.Length == 0 || !data.CanSeek || !data.CanRead) @@ -55,7 +55,7 @@ namespace BinaryObjectScanner.Builders long initialOffset = data.Position; // Create a new SGA to fill - var file = new Models.SGA.File(); + var file = new SabreTools.Models.SGA.File(); #region Header @@ -149,12 +149,12 @@ namespace BinaryObjectScanner.Builders /// Stream to parse /// SGA major version /// Filled SGA directory on success, null on error - private static Models.SGA.Directory ParseDirectory(Stream data, ushort majorVersion) + private static SabreTools.Models.SGA.Directory ParseDirectory(Stream data, ushort majorVersion) { #region Directory // Create the appropriate type of directory - Models.SGA.Directory directory; + SabreTools.Models.SGA.Directory directory; switch (majorVersion) { case 4: directory = new Directory4(); break; diff --git a/BinaryObjectScanner.Builders/VBSP.cs b/BinaryObjectScanner.Builders/VBSP.cs index 0a942cb1..3216d938 100644 --- a/BinaryObjectScanner.Builders/VBSP.cs +++ b/BinaryObjectScanner.Builders/VBSP.cs @@ -1,8 +1,8 @@ using System.IO; using System.Text; -using BinaryObjectScanner.Models.VBSP; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.VBSP.Constants; +using SabreTools.Models.VBSP; +using static SabreTools.Models.VBSP.Constants; namespace BinaryObjectScanner.Builders { @@ -16,7 +16,7 @@ namespace BinaryObjectScanner.Builders /// Byte array to parse /// Offset into the byte array /// Filled Half-Life 2 Level on success, null on error - public static Models.VBSP.File ParseFile(byte[] data, int offset) + public static SabreTools.Models.VBSP.File ParseFile(byte[] data, int offset) { // If the data is invalid if (data == null) @@ -40,7 +40,7 @@ namespace BinaryObjectScanner.Builders /// /// Stream to parse /// Filled Half-Life 2 Level on success, null on error - public static Models.VBSP.File ParseFile(Stream data) + public static SabreTools.Models.VBSP.File ParseFile(Stream data) { // If the data is invalid if (data == null || data.Length == 0 || !data.CanSeek || !data.CanRead) @@ -54,7 +54,7 @@ namespace BinaryObjectScanner.Builders long initialOffset = data.Position; // Create a new Half-Life 2 Level to fill - var file = new Models.VBSP.File(); + var file = new SabreTools.Models.VBSP.File(); #region Header diff --git a/BinaryObjectScanner.Builders/VPK.cs b/BinaryObjectScanner.Builders/VPK.cs index d8cd4c7e..0a227932 100644 --- a/BinaryObjectScanner.Builders/VPK.cs +++ b/BinaryObjectScanner.Builders/VPK.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using System.IO; using System.Text; -using BinaryObjectScanner.Models.VPK; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.VPK.Constants; +using SabreTools.Models.VPK; +using static SabreTools.Models.VPK.Constants; namespace BinaryObjectScanner.Builders { @@ -17,7 +17,7 @@ namespace BinaryObjectScanner.Builders /// Byte array to parse /// Offset into the byte array /// Filled Valve Package on success, null on error - public static Models.VPK.File ParseFile(byte[] data, int offset) + public static SabreTools.Models.VPK.File ParseFile(byte[] data, int offset) { // If the data is invalid if (data == null) @@ -41,7 +41,7 @@ namespace BinaryObjectScanner.Builders /// /// Stream to parse /// Filled Valve Package on success, null on error - public static Models.VPK.File ParseFile(Stream data) + public static SabreTools.Models.VPK.File ParseFile(Stream data) { // If the data is invalid if (data == null || data.Length == 0 || !data.CanSeek || !data.CanRead) @@ -55,7 +55,7 @@ namespace BinaryObjectScanner.Builders long initialOffset = data.Position; // Create a new Valve Package to fill - var file = new Models.VPK.File(); + var file = new SabreTools.Models.VPK.File(); #region Header diff --git a/BinaryObjectScanner.Builders/WAD.cs b/BinaryObjectScanner.Builders/WAD.cs index 8b2675cb..91582fa6 100644 --- a/BinaryObjectScanner.Builders/WAD.cs +++ b/BinaryObjectScanner.Builders/WAD.cs @@ -1,8 +1,8 @@ using System.IO; using System.Text; -using BinaryObjectScanner.Models.WAD; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.WAD.Constants; +using SabreTools.Models.WAD; +using static SabreTools.Models.WAD.Constants; namespace BinaryObjectScanner.Builders { @@ -16,7 +16,7 @@ namespace BinaryObjectScanner.Builders /// Byte array to parse /// Offset into the byte array /// Filled Half-Life Texture Package on success, null on error - public static Models.WAD.File ParseFile(byte[] data, int offset) + public static SabreTools.Models.WAD.File ParseFile(byte[] data, int offset) { // If the data is invalid if (data == null) @@ -40,7 +40,7 @@ namespace BinaryObjectScanner.Builders /// /// Stream to parse /// Filled Half-Life Texture Package on success, null on error - public static Models.WAD.File ParseFile(Stream data) + public static SabreTools.Models.WAD.File ParseFile(Stream data) { // If the data is invalid if (data == null || data.Length == 0 || !data.CanSeek || !data.CanRead) @@ -54,7 +54,7 @@ namespace BinaryObjectScanner.Builders long initialOffset = data.Position; // Create a new Half-Life Texture Package to fill - var file = new Models.WAD.File(); + var file = new SabreTools.Models.WAD.File(); #region Header diff --git a/BinaryObjectScanner.Builders/XZP.cs b/BinaryObjectScanner.Builders/XZP.cs index 05bb8a07..71673474 100644 --- a/BinaryObjectScanner.Builders/XZP.cs +++ b/BinaryObjectScanner.Builders/XZP.cs @@ -1,8 +1,8 @@ using System.IO; using System.Text; -using BinaryObjectScanner.Models.XZP; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.XZP.Constants; +using SabreTools.Models.XZP; +using static SabreTools.Models.XZP.Constants; namespace BinaryObjectScanner.Builders { @@ -16,7 +16,7 @@ namespace BinaryObjectScanner.Builders /// Byte array to parse /// Offset into the byte array /// Filled XBox Package File on success, null on error - public static Models.XZP.File ParseFile(byte[] data, int offset) + public static SabreTools.Models.XZP.File ParseFile(byte[] data, int offset) { // If the data is invalid if (data == null) @@ -40,7 +40,7 @@ namespace BinaryObjectScanner.Builders /// /// Stream to parse /// Filled XBox Package File on success, null on error - public static Models.XZP.File ParseFile(Stream data) + public static SabreTools.Models.XZP.File ParseFile(Stream data) { // If the data is invalid if (data == null || data.Length == 0 || !data.CanSeek || !data.CanRead) @@ -54,7 +54,7 @@ namespace BinaryObjectScanner.Builders long initialOffset = data.Position; // Create a new XBox Package File to fill - var file = new Models.XZP.File(); + var file = new SabreTools.Models.XZP.File(); #region Header diff --git a/BinaryObjectScanner.Compression/BinaryObjectScanner.Compression.csproj b/BinaryObjectScanner.Compression/BinaryObjectScanner.Compression.csproj index adc4bb89..2ddd15a6 100644 --- a/BinaryObjectScanner.Compression/BinaryObjectScanner.Compression.csproj +++ b/BinaryObjectScanner.Compression/BinaryObjectScanner.Compression.csproj @@ -31,13 +31,13 @@ + + + + + - - - - - diff --git a/BinaryObjectScanner.Compression/LZ.cs b/BinaryObjectScanner.Compression/LZ.cs index e344a89e..45c51bce 100644 --- a/BinaryObjectScanner.Compression/LZ.cs +++ b/BinaryObjectScanner.Compression/LZ.cs @@ -1,9 +1,9 @@ using System.IO; using System.Linq; using System.Text; -using BinaryObjectScanner.Models.Compression.LZ; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.Compression.LZ.Constants; +using SabreTools.Models.Compression.LZ; +using static SabreTools.Models.Compression.LZ.Constants; namespace BinaryObjectScanner.Compression { diff --git a/BinaryObjectScanner.Compression/LZX/Decompressor.cs b/BinaryObjectScanner.Compression/LZX/Decompressor.cs index 723efceb..7ea33dfe 100644 --- a/BinaryObjectScanner.Compression/LZX/Decompressor.cs +++ b/BinaryObjectScanner.Compression/LZX/Decompressor.cs @@ -1,7 +1,7 @@ using System; using BinaryObjectScanner.Compression.LZX; -using static BinaryObjectScanner.Models.Compression.LZX.Constants; -using static BinaryObjectScanner.Models.MicrosoftCabinet.Constants; +using static SabreTools.Models.Compression.LZX.Constants; +using static SabreTools.Models.MicrosoftCabinet.Constants; namespace BinaryObjectScanner.Compression.LZX { diff --git a/BinaryObjectScanner.Compression/LZX/State.cs b/BinaryObjectScanner.Compression/LZX/State.cs index 86aa19c0..bd11d5fb 100644 --- a/BinaryObjectScanner.Compression/LZX/State.cs +++ b/BinaryObjectScanner.Compression/LZX/State.cs @@ -1,4 +1,4 @@ -using static BinaryObjectScanner.Models.Compression.LZX.Constants; +using static SabreTools.Models.Compression.LZX.Constants; namespace BinaryObjectScanner.Compression.LZX { diff --git a/BinaryObjectScanner.Compression/MSZIP/Decompressor.cs b/BinaryObjectScanner.Compression/MSZIP/Decompressor.cs index 9b580378..cee79f2a 100644 --- a/BinaryObjectScanner.Compression/MSZIP/Decompressor.cs +++ b/BinaryObjectScanner.Compression/MSZIP/Decompressor.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.InteropServices; -using BinaryObjectScanner.Models.Compression.MSZIP; -using static BinaryObjectScanner.Models.Compression.MSZIP.Constants; +using SabreTools.Models.Compression.MSZIP; +using static SabreTools.Models.Compression.MSZIP.Constants; namespace BinaryObjectScanner.Compression.MSZIP { diff --git a/BinaryObjectScanner.Compression/MSZIP/State.cs b/BinaryObjectScanner.Compression/MSZIP/State.cs index 92065821..654572b4 100644 --- a/BinaryObjectScanner.Compression/MSZIP/State.cs +++ b/BinaryObjectScanner.Compression/MSZIP/State.cs @@ -1,4 +1,4 @@ -using static BinaryObjectScanner.Models.Compression.MSZIP.Constants; +using static SabreTools.Models.Compression.MSZIP.Constants; namespace BinaryObjectScanner.Compression.MSZIP { diff --git a/BinaryObjectScanner.Compression/Quantum/Decompressor.cs b/BinaryObjectScanner.Compression/Quantum/Decompressor.cs index 5cc6d40e..fc9ca19f 100644 --- a/BinaryObjectScanner.Compression/Quantum/Decompressor.cs +++ b/BinaryObjectScanner.Compression/Quantum/Decompressor.cs @@ -1,7 +1,7 @@ using System; using System.Linq; -using BinaryObjectScanner.Models.Compression.Quantum; -using BinaryObjectScanner.Models.MicrosoftCabinet; +using SabreTools.Models.Compression.Quantum; +using SabreTools.Models.MicrosoftCabinet; namespace BinaryObjectScanner.Compression.Quantum { diff --git a/BinaryObjectScanner.Compression/Quantum/State.cs b/BinaryObjectScanner.Compression/Quantum/State.cs index 20fbc783..cce845ad 100644 --- a/BinaryObjectScanner.Compression/Quantum/State.cs +++ b/BinaryObjectScanner.Compression/Quantum/State.cs @@ -1,4 +1,4 @@ -using BinaryObjectScanner.Models.Compression.Quantum; +using SabreTools.Models.Compression.Quantum; namespace BinaryObjectScanner.Compression.Quantum { diff --git a/BinaryObjectScanner.FileType/AACSMediaKeyBlock.cs b/BinaryObjectScanner.FileType/AACSMediaKeyBlock.cs index 6f780207..8ff31b02 100644 --- a/BinaryObjectScanner.FileType/AACSMediaKeyBlock.cs +++ b/BinaryObjectScanner.FileType/AACSMediaKeyBlock.cs @@ -34,11 +34,11 @@ namespace BinaryObjectScanner.FileType return null; // Derive the version, if possible - var typeAndVersion = mkb.Records.FirstOrDefault(r => r.RecordType == Models.AACS.RecordType.TypeAndVersion); + var typeAndVersion = mkb.Records.FirstOrDefault(r => r.RecordType == SabreTools.Models.AACS.RecordType.TypeAndVersion); if (typeAndVersion == null) return "AACS (Unknown Version)"; else - return $"AACS {(typeAndVersion as Models.AACS.TypeAndVersionRecord).VersionNumber}"; + return $"AACS {(typeAndVersion as SabreTools.Models.AACS.TypeAndVersionRecord).VersionNumber}"; } catch (Exception ex) { diff --git a/BinaryObjectScanner.Models/AACS/CopyrightRecord.cs b/BinaryObjectScanner.Models/AACS/CopyrightRecord.cs deleted file mode 100644 index 0382f173..00000000 --- a/BinaryObjectScanner.Models/AACS/CopyrightRecord.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - /// This record type is undocumented but found in real media key blocks - /// - public sealed class CopyrightRecord : Record - { - /// - /// Null-terminated ASCII string representing the copyright - /// - public string Copyright; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/DriveRevocationListEntry.cs b/BinaryObjectScanner.Models/AACS/DriveRevocationListEntry.cs deleted file mode 100644 index e6db0c46..00000000 --- a/BinaryObjectScanner.Models/AACS/DriveRevocationListEntry.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - public sealed class DriveRevocationListEntry - { - /// - /// A 2-byte Range value indicates the range of revoked ID’s starting - /// from the ID contained in the record. A value of zero in the Range - /// field indicates that only one ID is being revoked, a value of one - /// in the Range field indicates two ID’s are being revoked, and so on. - /// - public ushort Range; - - /// - /// A 6-byte Drive ID value identifying the Licensed Drive being revoked - /// (or the first in a range of Licensed Drives being revoked, in the - /// case of a non-zero Range value). - /// - public byte[] DriveID; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/DriveRevocationListRecord.cs b/BinaryObjectScanner.Models/AACS/DriveRevocationListRecord.cs deleted file mode 100644 index 390c50cf..00000000 --- a/BinaryObjectScanner.Models/AACS/DriveRevocationListRecord.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - /// A properly formatted type 3 or type 4 Media Key Block contains exactly - /// one Drive Revocation List Record. It follows the Host Revocation List - /// Record, although it may not immediately follow it. - /// - /// The Drive Revocation List Record is identical to the Host Revocation - /// List Record, except it has type 2016, and it contains Drive Revocation - /// List Entries, not Host Revocation List Entries. The Drive Revocation List - /// Entries refer to Drive IDs in the Drive Certificates. - /// - /// - public sealed class DriveRevocationListRecord : Record - { - /// - /// The total number of Drive Revocation List Entry fields that follow. - /// - public uint TotalNumberOfEntries; - - /// - /// Revocation list entries - /// - public DriveRevocationSignatureBlock[] SignatureBlocks; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/DriveRevocationSignatureBlock.cs b/BinaryObjectScanner.Models/AACS/DriveRevocationSignatureBlock.cs deleted file mode 100644 index 71cca1dc..00000000 --- a/BinaryObjectScanner.Models/AACS/DriveRevocationSignatureBlock.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - public sealed class DriveRevocationSignatureBlock - { - /// - /// The number of Drive Revocation List Entry fields in the signature block. - /// - public uint NumberOfEntries; - - /// - /// A list of 8-byte Host Drive List Entry fields, the length of this - /// list being equal to the number in the signature block. - /// - public DriveRevocationListEntry[] EntryFields; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/EndOfMediaKeyBlockRecord.cs b/BinaryObjectScanner.Models/AACS/EndOfMediaKeyBlockRecord.cs deleted file mode 100644 index b16b2c85..00000000 --- a/BinaryObjectScanner.Models/AACS/EndOfMediaKeyBlockRecord.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - /// A properly formatted MKB shall contain an End of Media Key Block Record. - /// When a device encounters this Record it stops processing the MKB, using - /// whatever Km value it has calculated up to that point as the final Km for - /// that MKB (pending possible checks for correctness of the key, as - /// described previously). - /// - /// - public sealed class EndOfMediaKeyBlockRecord : Record - { - /// - /// AACS LA’s signature on the data in the Media Key Block up to, - /// but not including, this record. Devices depending on the Version - /// Number in the Type and Version Record must verify the signature. - /// Other devices may ignore the signature data. If any device - /// determines that the signature does not verify or is omitted, it - /// must refuse to use the Media Key. - /// - public byte[] SignatureData; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/Enums.cs b/BinaryObjectScanner.Models/AACS/Enums.cs deleted file mode 100644 index 72018a19..00000000 --- a/BinaryObjectScanner.Models/AACS/Enums.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - public enum MediaKeyBlockType : uint - { - /// - /// (Type 3). This is a normal Media Key Block suitable for being recorded - /// on a AACS Recordable Media. Both Class I and Class II Licensed Products - /// use it to directly calculate the Media Key. - /// - Type3 = 0x00031003, - - /// - /// (Type 4). This is a Media Key Block that has been designed to use Key - /// Conversion Data (KCD). Thus, it is suitable only for pre-recorded media - /// from which the KCD is derived. Both Class I and Class II Licensed Products - /// use it to directly calculate the Media Key. - /// - Type4 = 0x00041003, - - /// - /// (Type 10). This is a Class II Media Key Block (one that has the functionality - /// of a Sequence Key Block). This can only be processed by Class II Licensed - /// Products; Class I Licensed Products are revoked in Type 10 Media Key Blocks - /// and cannot process them. This type does not contain the Host Revocation List - /// Record, the Drive Revocation List Record, and the Media Key Data Record, as - /// described in the following sections. It does contain the records shown in - /// Section 3.2.5.2, which are only processed by Class II Licensed Products. - /// - Type10 = 0x000A1003, - } - - public enum RecordType : byte - { - EndOfMediaKeyBlock = 0x02, - ExplicitSubsetDifference = 0x04, - MediaKeyData = 0x05, - SubsetDifferenceIndex = 0x07, - TypeAndVersion = 0x10, - DriveRevocationList = 0x20, - HostRevocationList = 0x21, - VerifyMediaKey = 0x81, - - // Not documented - Copyright = 0x7F, - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/ExplicitSubsetDifferenceRecord.cs b/BinaryObjectScanner.Models/AACS/ExplicitSubsetDifferenceRecord.cs deleted file mode 100644 index 807a23dc..00000000 --- a/BinaryObjectScanner.Models/AACS/ExplicitSubsetDifferenceRecord.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - public sealed class ExplicitSubsetDifferenceRecord : Record - { - /// - /// In this record, each subset-difference is encoded with 5 bytes. - /// - public SubsetDifference[] SubsetDifferences; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/HostRevocationListEntry.cs b/BinaryObjectScanner.Models/AACS/HostRevocationListEntry.cs deleted file mode 100644 index 611cc787..00000000 --- a/BinaryObjectScanner.Models/AACS/HostRevocationListEntry.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - public sealed class HostRevocationListEntry - { - /// - /// A 2-byte Range value indicates the range of revoked ID’s starting - /// from the ID contained in the record. A value of zero in the Range - /// field indicates that only one ID is being revoked, a value of one - /// in the Range field indicates two ID’s are being revoked, and so on. - /// - public ushort Range; - - /// - /// A 6-byte Host ID value identifying the host being revoked (or the - /// first in a range of hosts being revoked, in the case of a non-zero - /// Range value). - /// - public byte[] HostID; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/HostRevocationListRecord.cs b/BinaryObjectScanner.Models/AACS/HostRevocationListRecord.cs deleted file mode 100644 index 65dd99bc..00000000 --- a/BinaryObjectScanner.Models/AACS/HostRevocationListRecord.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - /// A properly formatted type 3 or type 4 Media Key Block shall have exactly - /// one Host Revocation List Record as its second record. This record provides - /// a list of hosts that have been revoked by the AACS LA. The AACS specification - /// is applicable to PC-based system where a Licensed Drive and PC Host act - /// together as the Recording Device and/or Playback Device for AACS Content. - /// AACS uses a drive-host authentication protocol for the host to verify the - /// integrity of the data received from the Licensed Drive, and for the Licensed - /// Drive to check the validity of the host application. The Type and Version - /// Record and the Host Revocation List Record are guaranteed to be the first two - /// records of a Media Key Block, to make it easier for Licensed Drives to extract - /// this data from an arbitrary Media Key Block. - /// - /// - public sealed class HostRevocationListRecord : Record - { - /// - /// The total number of Host Revocation List Entry fields that follow. - /// - public uint TotalNumberOfEntries; - - /// - /// Revocation list entries - /// - public HostRevocationSignatureBlock[] SignatureBlocks; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/HostRevocationSignatureBlock.cs b/BinaryObjectScanner.Models/AACS/HostRevocationSignatureBlock.cs deleted file mode 100644 index 0be6c106..00000000 --- a/BinaryObjectScanner.Models/AACS/HostRevocationSignatureBlock.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - public sealed class HostRevocationSignatureBlock - { - /// - /// The number of Host Revocation List Entry fields in the signature block. - /// - public uint NumberOfEntries; - - /// - /// A list of 8-byte Host Revocation List Entry fields, the length of this - /// list being equal to the number in the signature block. - /// - public HostRevocationListEntry[] EntryFields; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/MediaKeyBlock.cs b/BinaryObjectScanner.Models/AACS/MediaKeyBlock.cs deleted file mode 100644 index e224deed..00000000 --- a/BinaryObjectScanner.Models/AACS/MediaKeyBlock.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - /// A Media Key Block is formatted as a sequence of contiguous Records. - /// - /// - public sealed class MediaKeyBlock - { - /// - /// Records - /// - public Record[] Records { get; set; } - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/MediaKeyDataRecord.cs b/BinaryObjectScanner.Models/AACS/MediaKeyDataRecord.cs deleted file mode 100644 index c269e749..00000000 --- a/BinaryObjectScanner.Models/AACS/MediaKeyDataRecord.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - /// This record gives the associated encrypted media key data for the - /// subset-differences identified in the Explicit Subset-Difference Record. - /// - /// - public sealed class MediaKeyDataRecord : Record - { - /// - /// Each subset difference has its associated 16 bytes in this - /// record, in the same order it is encountered in the subset-difference - /// record. This 16 bytes is the ciphertext value C in the media - /// key calculation. - /// - public byte[][] MediaKeyData; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/Record.cs b/BinaryObjectScanner.Models/AACS/Record.cs deleted file mode 100644 index aa13c7e2..00000000 --- a/BinaryObjectScanner.Models/AACS/Record.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - /// Each Record begins with a one-byte Record Type field, followed by a - /// three-byte Record Length field. - /// - /// The following subsections describe the currently defined Record types, - /// and how a device processes each. All multi-byte integers, including - /// the length field, are “Big Endian”; in other words, the most significant - /// byte comes first in the record. - /// - /// - public abstract class Record - { - /// - /// The Record Type field value indicates the type of the Record. - /// - public RecordType RecordType; - - /// - /// The Record Length field value indicates the number of bytes in - /// the Record, including the Record Type and the Record Length - /// fields themselves. Record lengths are always multiples of 4 bytes. - /// - // UInt24 not UInt32 - public uint RecordLength; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/SubsetDifference.cs b/BinaryObjectScanner.Models/AACS/SubsetDifference.cs deleted file mode 100644 index ecf9d811..00000000 --- a/BinaryObjectScanner.Models/AACS/SubsetDifference.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - public sealed class SubsetDifference - { - /// - /// The mask for u is given by the first byte. That byte is - /// treated as a number, the number of low-order 0-bits in - /// the mask. For example, the value 0x01 denotes a mask of - /// 0xFFFFFFFE; value 0x0A denotes a mask of 0xFFFFFC00. - /// - public byte Mask; - - /// - /// The last 4 bytes are the uv number, most significant - /// byte first. - /// - public uint Number; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/SubsetDifferenceIndexRecord.cs b/BinaryObjectScanner.Models/AACS/SubsetDifferenceIndexRecord.cs deleted file mode 100644 index 3158b9ea..00000000 --- a/BinaryObjectScanner.Models/AACS/SubsetDifferenceIndexRecord.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - /// This is a speed-up record which can be ignored by devices not wishing to - /// take advantage of it. It is a lookup table which allows devices to quickly - /// find their subset-difference in the Explicit Subset-Difference record, - /// without processing the entire record. This Subset-Difference Index record - /// is always present, and always precedes the Explicit Subset-Difference record - /// in the MKB, although it does not necessarily immediately precede it. - /// - /// - public sealed class SubsetDifferenceIndexRecord : Record - { - /// - /// The number of devices per index offset. - /// - public uint Span; - - /// - /// These offsets refer to the offset within the following Explicit - /// Subset-Difference record, with 0 being the start of the record. - /// - // UInt24 not UInt32 - public uint[] Offsets; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/TypeAndVersionRecord.cs b/BinaryObjectScanner.Models/AACS/TypeAndVersionRecord.cs deleted file mode 100644 index ecf352be..00000000 --- a/BinaryObjectScanner.Models/AACS/TypeAndVersionRecord.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - /// Devices, except for recording devices which are writing Media Key Block - /// Extensions, may ignore this record. Recording devices shall verify the - /// signature (see End of Media Key Block record) and use the Version Number - /// in this record to determine if a new Media Key BLock Extension is, in - /// fact, more recent than the Media Key Block Extension that is currently - /// on the media. - /// - /// - public sealed class TypeAndVersionRecord : Record - { - /// - /// For AACS applications, the MKBType field is one of three values. - /// It is not an error for a Type 3 Media Key Block to be used for - /// controlling access to AACS Content on pre- recorded media. In - /// this case, the device shall not use the KCD. - /// - public MediaKeyBlockType MediaKeyBlockType; - - /// - /// The Version Number is a 32-bit unsigned integer. Each time the - /// licensing agency changes the revocation, it increments the version - /// number and inserts the new value in subsequent Media Key Blocks. - /// Thus, larger values indicate more recent Media Key Blocks. The - /// Version Numbers begin at 1; 0 is a special value used for test - /// Media Key Blocks. - /// - public uint VersionNumber; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/AACS/VerifyMediaKeyRecord.cs b/BinaryObjectScanner.Models/AACS/VerifyMediaKeyRecord.cs deleted file mode 100644 index 274caef4..00000000 --- a/BinaryObjectScanner.Models/AACS/VerifyMediaKeyRecord.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace BinaryObjectScanner.Models.AACS -{ - /// - /// A properly formatted MKB shall have exactly one Verify Media Key Record - /// as its first record. The presence of the Verify Media Key Record in an MKB - /// is mandatory, but the use of the Record by a device is not mandatory. The - /// device may use the Verify Media Key Record to verify the correctness of a - /// given MKB, or of its processing of it. If everything is correct, the device - /// should observe the condition: - /// [AES_128D(vKm, C]msb_64 == 0x0123456789ABCDEF)] - /// where Km is the Media Key value. - /// - /// - public sealed class VerifyMediaKeyRecord : Record - { - /// - /// Bytes 4 through 19 of the Record contain the ciphertext value - /// Cv = AES-128E (Km, 0x0123456789ABCDEF || 0xXXXXXXXXXXXXXXXX) - /// where 0xXXXXXXXXXXXXXXXX is an arbitrary 8-byte value, and Km is - /// the correct final Media Key value. - /// - public byte[] CiphertextValue; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/BDPlus/Constants.cs b/BinaryObjectScanner.Models/BDPlus/Constants.cs deleted file mode 100644 index 74710b0a..00000000 --- a/BinaryObjectScanner.Models/BDPlus/Constants.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace BinaryObjectScanner.Models.BDPlus -{ - public static class Constants - { - public const string SignatureString = "BDSVM_CC"; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/BDPlus/SVM.cs b/BinaryObjectScanner.Models/BDPlus/SVM.cs deleted file mode 100644 index 7a8d85fa..00000000 --- a/BinaryObjectScanner.Models/BDPlus/SVM.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace BinaryObjectScanner.Models.BDPlus -{ - /// - public sealed class SVM - { - /// - /// "BDSVM_CC" - /// - public string Signature; - - /// - /// 5 bytes of unknown data - /// - public byte[] Unknown1; - - /// - /// Version year - /// - public ushort Year; - - /// - /// Version month - /// - public byte Month; - - /// - /// Version day - /// - public byte Day; - - /// - /// 4 bytes of unknown data - /// - public byte[] Unknown2; - - /// - /// Length - /// - public uint Length; - - /// - /// Length bytes of data - /// - public byte[] Data; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/BFPK/Archive.cs b/BinaryObjectScanner.Models/BFPK/Archive.cs deleted file mode 100644 index 46392de4..00000000 --- a/BinaryObjectScanner.Models/BFPK/Archive.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace BinaryObjectScanner.Models.BFPK -{ - /// - /// BFPK custom archive format - /// - /// - public sealed class Archive - { - /// - /// Header - /// - public Header Header { get; set; } - - /// - /// Files - /// - public FileEntry[] Files { get; set; } - } -} diff --git a/BinaryObjectScanner.Models/BFPK/Constants.cs b/BinaryObjectScanner.Models/BFPK/Constants.cs deleted file mode 100644 index 330df3c9..00000000 --- a/BinaryObjectScanner.Models/BFPK/Constants.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.BFPK -{ - public static class Constants - { - public static readonly byte[] SignatureBytes = new byte[] { 0x42, 0x46, 0x50, 0x4b }; - - public const string SignatureString = "BFPK"; - - public const uint SignatureUInt32 = 0x4b504642; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/BFPK/FileEntry.cs b/BinaryObjectScanner.Models/BFPK/FileEntry.cs deleted file mode 100644 index 6933842b..00000000 --- a/BinaryObjectScanner.Models/BFPK/FileEntry.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace BinaryObjectScanner.Models.BFPK -{ - /// - /// File entry - /// - /// - public sealed class FileEntry - { - /// - /// Name size - /// - public int NameSize; - - /// - /// Name - /// - public string Name; - - /// - /// Uncompressed size - /// - public int UncompressedSize; - - /// - /// Offset - /// - public int Offset; - - /// - /// Compressed size - /// - public int CompressedSize; - } -} diff --git a/BinaryObjectScanner.Models/BFPK/Header.cs b/BinaryObjectScanner.Models/BFPK/Header.cs deleted file mode 100644 index 25f5e998..00000000 --- a/BinaryObjectScanner.Models/BFPK/Header.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.BFPK -{ - /// - /// Header - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class Header - { - /// - /// "BFPK" - /// - public string Magic; - - /// - /// Version - /// - public int Version; - - /// - /// Files - /// - public int Files; - } -} diff --git a/BinaryObjectScanner.Models/BMP/BITMAPFILEHEADER.cs b/BinaryObjectScanner.Models/BMP/BITMAPFILEHEADER.cs deleted file mode 100644 index a6fc8806..00000000 --- a/BinaryObjectScanner.Models/BMP/BITMAPFILEHEADER.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace BinaryObjectScanner.Models.BMP -{ - /// - /// The BITMAPFILEHEADER structure contains information about the type, size, - /// and layout of a file that contains a DIB. - /// - /// - public sealed class BITMAPFILEHEADER - { - /// - /// The file type; must be BM. - /// - public ushort Type; - - /// - /// The size, in bytes, of the bitmap file. - /// - public uint Size; - - /// - /// Reserved; must be zero. - /// - public ushort Reserved1; - - /// - /// Reserved; must be zero. - /// - public ushort Reserved2; - - /// - /// The offset, in bytes, from the beginning of the BITMAPFILEHEADER structure to the bitmap bits. - /// - public uint OffBits; - } -} diff --git a/BinaryObjectScanner.Models/BMP/BITMAPINFOHEADER.cs b/BinaryObjectScanner.Models/BMP/BITMAPINFOHEADER.cs deleted file mode 100644 index e79f1040..00000000 --- a/BinaryObjectScanner.Models/BMP/BITMAPINFOHEADER.cs +++ /dev/null @@ -1,94 +0,0 @@ -namespace BinaryObjectScanner.Models.BMP -{ - /// - /// The BITMAPINFOHEADER structure contains information about the dimensions and - /// color format of a device-independent bitmap (DIB). - /// - public sealed class BITMAPINFOHEADER - { - /// - /// Specifies the number of bytes required by the structure. This value does - /// not include the size of the color table or the size of the color masks, - /// if they are appended to the end of structure. - /// - public uint Size; - - /// - /// Specifies the width of the bitmap, in pixels. - /// - public int Width; - - /// - /// Specifies the height of the bitmap, in pixels. - /// - For uncompressed RGB bitmaps, if biHeight is positive, the bitmap is a - /// bottom-up DIB with the origin at the lower left corner. If biHeight is - /// negative, the bitmap is a top-down DIB with the origin at the upper left - /// corner. - /// - For YUV bitmaps, the bitmap is always top-down, regardless of the sign of - /// biHeight. Decoders should offer YUV formats with positive biHeight, but for - /// backward compatibility they should accept YUV formats with either positive - /// or negative biHeight. - /// - For compressed formats, biHeight must be positive, regardless of image orientation. - /// - public int Height; - - /// - /// Specifies the number of planes for the target device. This value must be set to 1. - /// - public ushort Planes; - - /// - /// Specifies the number of bits per pixel (bpp). For uncompressed formats, this value - /// is the average number of bits per pixel. For compressed formats, this value is the - /// implied bit depth of the uncompressed image, after the image has been decoded. - /// - public ushort BitCount; - - /// - /// For compressed video and YUV formats, this member is a FOURCC code, specified as a - /// DWORD in little-endian order. For example, YUYV video has the FOURCC 'VYUY' or - /// 0x56595559. For more information, see FOURCC Codes. - /// - /// For uncompressed RGB formats, the following values are possible: - /// - BI_RGB: Uncompressed RGB. - /// - BI_BITFIELDS: Uncompressed RGB with color masks. Valid for 16-bpp and 32-bpp bitmaps. - /// - /// Note that BI_JPG and BI_PNG are not valid video formats. - /// - /// For 16-bpp bitmaps, if biCompression equals BI_RGB, the format is always RGB 555. - /// If biCompression equals BI_BITFIELDS, the format is either RGB 555 or RGB 565. Use - /// the subtype GUID in the AM_MEDIA_TYPE structure to determine the specific RGB type. - /// - public uint Compression; - - /// - /// Specifies the size, in bytes, of the image. This can be set to 0 for uncompressed - /// RGB bitmaps. - /// - public uint SizeImage; - - /// - /// Specifies the horizontal resolution, in pixels per meter, of the target device for - /// the bitmap. - /// - public int XPelsPerMeter; - - /// - /// Specifies the vertical resolution, in pixels per meter, of the target device for - /// the bitmap. - /// - public int YPelsPerMeter; - - /// - /// Specifies the number of color indices in the color table that are actually used by - /// the bitmap. - /// - public uint ClrUsed; - - /// - /// Specifies the number of color indices that are considered important for displaying - /// the bitmap. If this value is zero, all colors are important. - /// - public uint ClrImportant; - } -} diff --git a/BinaryObjectScanner.Models/BSP/Constants.cs b/BinaryObjectScanner.Models/BSP/Constants.cs deleted file mode 100644 index db7307d9..00000000 --- a/BinaryObjectScanner.Models/BSP/Constants.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace BinaryObjectScanner.Models.BSP -{ - public static class Constants - { - /// - /// Number of lumps in a BSP - /// - public const int HL_BSP_LUMP_COUNT = 15; - - /// - /// Index for the entities lump - /// - public const int HL_BSP_LUMP_ENTITIES = 0; - - /// - /// Index for the texture data lump - /// - public const int HL_BSP_LUMP_TEXTUREDATA = 2; - - /// - /// Number of valid mipmap levels - /// - public const int HL_BSP_MIPMAP_COUNT = 4; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/BSP/File.cs b/BinaryObjectScanner.Models/BSP/File.cs deleted file mode 100644 index ec290ed4..00000000 --- a/BinaryObjectScanner.Models/BSP/File.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace BinaryObjectScanner.Models.BSP -{ - /// - /// Half-Life Level - /// - /// - public sealed class File - { - /// - /// Header data - /// - public Header Header { get; set; } - - /// - /// Lumps - /// - public Lump[] Lumps { get; set; } - - /// - /// Texture header data - /// - public TextureHeader TextureHeader { get; set; } - - /// - /// Textures - /// - public Texture[] Textures { get; set; } - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/BSP/Header.cs b/BinaryObjectScanner.Models/BSP/Header.cs deleted file mode 100644 index 7cd6c85f..00000000 --- a/BinaryObjectScanner.Models/BSP/Header.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.BSP -{ - /// - public sealed class Header - { - /// - /// Version - /// - public uint Version; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/BSP/Lump.cs b/BinaryObjectScanner.Models/BSP/Lump.cs deleted file mode 100644 index 8b2724dc..00000000 --- a/BinaryObjectScanner.Models/BSP/Lump.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace BinaryObjectScanner.Models.BSP -{ - /// - public sealed class Lump - { - /// - /// Offset - /// - public uint Offset; - - /// - /// Length - /// - public uint Length; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/BSP/Texture.cs b/BinaryObjectScanner.Models/BSP/Texture.cs deleted file mode 100644 index f215aadc..00000000 --- a/BinaryObjectScanner.Models/BSP/Texture.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace BinaryObjectScanner.Models.BSP -{ - /// - public sealed class Texture - { - /// - /// Name - /// - public string Name; - - /// - /// Width - /// - public uint Width; - - /// - /// Height - /// - public uint Height; - - /// - /// Offsets - /// - public uint[] Offsets; - - /// - /// Texture data - /// - public byte[] TextureData; - - /// - /// Palette size - /// - public uint PaletteSize; - - /// - /// Palette data - /// - public byte[] PaletteData; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/BSP/TextureHeader.cs b/BinaryObjectScanner.Models/BSP/TextureHeader.cs deleted file mode 100644 index 8f61ab30..00000000 --- a/BinaryObjectScanner.Models/BSP/TextureHeader.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace BinaryObjectScanner.Models.BSP -{ - /// - public sealed class TextureHeader - { - /// - /// Texture count - /// - public uint TextureCount; - - /// - /// Offsets - /// - public uint[] Offsets; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/BinaryObjectScanner.Models.csproj b/BinaryObjectScanner.Models/BinaryObjectScanner.Models.csproj deleted file mode 100644 index 69d09a30..00000000 --- a/BinaryObjectScanner.Models/BinaryObjectScanner.Models.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - net48;net6.0;net7.0 - win-x86;win-x64;linux-x64;osx-x64 - BinaryObjectScanner.Models - BinaryObjectScanner.Models - Matt Nadareski - BurnOutSharp - Copyright (c)2022 Matt Nadareski - https://github.com/mnadareski/BurnOutSharp - 2.8 - 2.8 - 2.8 - true - true - - - - true - - - diff --git a/BinaryObjectScanner.Models/CFB/Binary.cs b/BinaryObjectScanner.Models/CFB/Binary.cs deleted file mode 100644 index 978684c7..00000000 --- a/BinaryObjectScanner.Models/CFB/Binary.cs +++ /dev/null @@ -1,92 +0,0 @@ -namespace BinaryObjectScanner.Models.CFB -{ - /// - /// Microsoft Compound File Binary (CFB) file format, also known as the - /// Object Linking and Embedding (OLE) or Component Object Model (COM) - /// structured storage compound file implementation binary file format. - /// This structure name can be shortened to compound file. - /// - /// - public sealed class Binary - { - /// - /// Compound file header - /// - public FileHeader Header { get; set; } - - /// - /// The FAT is the main allocator for space within a compound file. - /// Every sector in the file is represented within the FAT in some - /// fashion, including those sectors that are unallocated (free). - /// The FAT is a sector chain that is made up of one or more FAT sectors. - /// - /// - /// If Header Major Version is 3, there MUST be 128 fields specified to fill a 512-byte sector. - /// - /// If Header Major Version is 4, there MUST be 1,024 fields specified to fill a 4,096-byte sector - /// - public SectorNumber[] FATSectorNumbers { get; set; } - - /// - /// The mini FAT is used to allocate space in the mini stream. - /// The mini stream is divided intosmaller, equal-length sectors, - /// and the sector size that is used for the mini stream is specified - /// from the Compound File Header (64 bytes). - /// - /// - /// If Header Major Version is 3, there MUST be 128 fields specified to fill a 512-byte sector. - /// - /// If Header Major Version is 4, there MUST be 1,024 fields specified to fill a 4,096-byte sector - /// - public SectorNumber[] MiniFATSectorNumbers { get; set; } - - /// - /// The DIFAT array is used to represent storage of the FAT sectors. - /// The DIFAT is represented by an array of 32-bit sector numbers. - /// The DIFAT array is stored both in the header and in DIFAT sectors. - /// In the header, the DIFAT array occupies 109 entries, and in each - /// DIFAT sector, the DIFAT array occupies the entire sector minus - /// 4 bytes. (The last field is for chaining the DIFAT sector chain.) - /// - /// - /// If Header Major Version is 3, there MUST be 127 fields specified to - /// fill a 512-byte sector minus the "Next DIFAT Sector Location" field. - /// - /// If Header Major Version is 4, there MUST be 1,023 fields specified - /// to fill a 4,096-byte sector minus the "Next DIFAT Sector Location" field. - /// - public SectorNumber[] DIFATSectorNumbers { get; set; } - - /// - /// The directory entry array is an array of directory entries that - /// are grouped into a directory sector. Each storage object or stream - /// object within a compound file is represented by a single directory - /// entry. The space for the directory sectors that are holding the - /// array is allocated from the FAT. - /// - /// - /// The first entry in the first sector of the directory chain (also - /// referred to as the first element of the directory array, or stream - /// ID #0) is known as the root directory entry, and it is reserved for - /// two purposes. First, it provides a root parent for all objects that - /// are stationed at the root of the compound file. Second, its function - /// is overloaded to store the size and starting sector for the mini stream. - /// - /// The root directory entry behaves as both a stream and a storage object. - /// The root directory entry's Name field MUST contain the null-terminated - /// string "Root Entry" in Unicode UTF-16. - /// - /// The object class GUID (CLSID) that is stored in the root directory - /// entry can be used for COM activation of the document's application. - /// - /// The time stamps for the root storage are not maintained in the root - /// directory entry. Rather, the root storage's creation and modification - /// time stamps are normally stored on the file itself in the file system. - /// - /// The Creation Time field in the root storage directory entry MUST be - /// all zeroes. The Modified Time field in the root storage directory - /// entry MAY be all zeroes. - /// - public DirectoryEntry[] DirectoryEntries { get; set; } - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/CFB/Constants.cs b/BinaryObjectScanner.Models/CFB/Constants.cs deleted file mode 100644 index 3484a846..00000000 --- a/BinaryObjectScanner.Models/CFB/Constants.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.CFB -{ - public static class Constants - { - public static readonly byte[] SignatureBytes = new byte[] { 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1 }; - - public const ulong SignatureUInt64 = 0xE11AB1A1E011CFD0; - - - /// - #region Class IDs - - /// - /// Installer Package (msi), Merge Module (msm), Patch Creation Properties (pcp) - /// - public static readonly Guid InstallerPackage = new Guid("000c1084-0000-0000-c000-000000000046"); - - /// - /// Patch Package (msp) - /// - public static readonly Guid PatchPackage = new Guid("000C1086-0000-0000-C000-000000000046"); - - /// - /// Transform (mst) - /// - public static readonly Guid Transform = new Guid("000C1082-0000-0000-C000-000000000046"); - - #endregion - - /// - #region Property Set Format IDs - - /// - /// The Summary Information Property Set - /// - public static readonly Guid FMTID_SummaryInformation = new Guid("F29F85E0-4FF9-1068-AB91-08002B27B3D9"); - - /// - /// The DocumentSummaryInformation and UserDefined Property Sets - /// - public static readonly Guid FMTID_DocSummaryInformation = new Guid("D5CDD502-2E9C-101B-9397-08002B2CF9AE"); - - /// - /// The DocumentSummaryInformation and UserDefined Property Sets - /// - public static readonly Guid FMTID_UserDefinedProperties = new Guid("D5CDD505-2E9C-101B-9397-08002B2CF9AE"); - - #endregion - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/CFB/DirectoryEntry.cs b/BinaryObjectScanner.Models/CFB/DirectoryEntry.cs deleted file mode 100644 index 16f00194..00000000 --- a/BinaryObjectScanner.Models/CFB/DirectoryEntry.cs +++ /dev/null @@ -1,133 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.CFB -{ - /// - public sealed class DirectoryEntry - { - /// - /// This field MUST contain a Unicode string for the storage or stream - /// name encoded in UTF-16. The name MUST be terminated with a UTF-16 - /// terminating null character. Thus, storage and stream names are limited - /// to 32 UTF-16 code points, including the terminating null character. - /// When locating an object in the compound file except for the root - /// storage, the directory entry name is compared by using a special - /// case-insensitive uppercase mapping, described in Red-Black Tree. - /// The following characters are illegal and MUST NOT be part of the - /// name: '/', '\', ':', '!'. - /// - public string Name; - - /// - /// This field MUST be 0x00, 0x01, 0x02, or 0x05, depending on the - /// actual type of object. All other values are not valid. - /// - public ushort NameLength; - - /// - /// This field MUST match the length of the Directory Entry Name Unicode - /// string in bytes. The length MUST be a multiple of 2 and include the - /// terminating null character in the count. This length MUST NOT exceed 64, - /// the maximum size of the Directory Entry Name field. - /// - public ObjectType ObjectType; - - /// - /// This field MUST be 0x00 (red) or 0x01 (black). All other values are not valid. - /// - public ColorFlag ColorFlag; - - /// - /// This field contains the stream ID of the left sibling. If there - /// is no left sibling, the field MUST be set to NOSTREAM (0xFFFFFFFF). - /// - public StreamID LeftSiblingID; - - /// - /// This field contains the stream ID of the right sibling. If there - /// is no right sibling, the field MUST be set to NOSTREAM (0xFFFFFFFF). - /// - public StreamID RightSiblingID; - - /// - /// This field contains the stream ID of a child object. If there is no - /// child object, including all entries for stream objects, the field - /// MUST be set to NOSTREAM (0xFFFFFFFF). - /// - public StreamID ChildID; - - /// - /// This field contains an object class GUID, if this entry is for a - /// storage object or root storage object. For a stream object, this field - /// MUST be set to all zeroes. A value containing all zeroes in a storage - /// or root storage directory entry is valid, and indicates that no object - /// class is associated with the storage. If an implementation of the file - /// format enables applications to create storage objects without explicitly - /// setting an object class GUID, it MUST write all zeroes by default. If - /// this value is not all zeroes, the object class GUID can be used as a - /// parameter to start applications. - /// - public Guid CLSID; - - /// - /// This field contains the user-defined flags if this entry is for a storage - /// object or root storage object. For a stream object, this field SHOULD be - /// set to all zeroes because many implementations provide no way for - /// applications to retrieve state bits from a stream object. If an - /// implementation of the file format enables applications to create storage - /// objects without explicitly setting state bits, it MUST write all zeroes - /// by default. - /// - public uint StateBits; - - /// - /// This field contains the creation time for a storage object, or all zeroes - /// to indicate that the creation time of the storage object was not recorded. - /// The Windows FILETIME structure is used to represent this field in UTC. - /// For a stream object, this field MUST be all zeroes. For a root storage - /// object, this field MUST be all zeroes, and the creation time is retrieved - /// or set on the compound file itself. - /// - public ulong CreationTime; - - /// - /// This field contains the modification time for a storage object, or all - /// zeroes to indicate that the modified time of the storage object was not - /// recorded. The Windows FILETIME structure is used to represent this field - /// in UTC. For a stream object, this field MUST be all zeroes. For a root - /// storage object, this field MAY<2> be set to all zeroes, and the modified - /// time is retrieved or set on the compound file itself. - /// - public ulong ModifiedTime; - - /// - /// This field contains the first sector location if this is a stream object. - /// For a root storage object, this field MUST contain the first sector of the - /// mini stream, if the mini stream exists. For a storage object, this field MUST - /// be set to all zeroes. - /// - public uint StartingSectorLocation; - - /// - /// This 64-bit integer field contains the size of the user-defined data if this - /// is a stream object. For a root storage object, this field contains the size - /// of the mini stream. For a storage object, this field MUST be set to all zeroes. - /// - /// - /// For a version 3 compound file 512-byte sector size, the value of this field MUST - /// be less than or equal to 0x80000000. (Equivalently, this requirement can be stated: - /// the size of a stream or of the mini stream in a version 3 compound file MUST be - /// less than or equal to 2 gigabytes (GB).) Note that as a consequence of this - /// requirement, the most significant 32 bits of this field MUST be zero in a version - /// 3 compound file. However, implementers should be aware that some older - /// implementations did not initialize the most significant 32 bits of this field, - /// and these bits might therefore be nonzero in files that are otherwise valid - /// version 3 compound files. Although this document does not normatively specify - /// parser behavior, it is recommended that parsers ignore the most significant 32 bits - /// of this field in version 3 compound files, treating it as if its value were zero, - /// unless there is a specific reason to do otherwise (for example, a parser whose - /// purpose is to verify the correctness of a compound file). - /// - public ulong StreamSize; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/CFB/Enums.cs b/BinaryObjectScanner.Models/CFB/Enums.cs deleted file mode 100644 index 14e4e065..00000000 --- a/BinaryObjectScanner.Models/CFB/Enums.cs +++ /dev/null @@ -1,474 +0,0 @@ -namespace BinaryObjectScanner.Models.CFB -{ - public enum ColorFlag : byte - { - Red = 0x00, - Black = 0x01, - } - - public enum ObjectType : byte - { - Unknown = 0x00, - StorageObject = 0x01, - StreamObject = 0x02, - RootStorageObject = 0x05, - } - - public enum SectorNumber : uint - { - /// - /// Regular sector number. - /// - REGSECT = 0x00000000, // 0x00000000 - 0xFFFFFFF9 - - /// - /// Maximum regular sector number. - /// - MAXREGSECT = 0xFFFFFFFA, - - /// - /// Reserved for future use. - /// - NotApplicable = 0xFFFFFFFB, - - /// - /// Specifies a DIFAT sector in the FAT. - /// - DIFSECT = 0xFFFFFFFC, - - /// - /// Specifies a FAT sector in the FAT. - /// - FATSECT = 0xFFFFFFFD, - - /// - /// End of a linked chain of sectors. - /// - ENDOFCHAIN = 0xFFFFFFFE, - - /// - /// Specifies an unallocated sector in the FAT, Mini FAT, or DIFAT. - /// - FREESECT = 0xFFFFFFFF, - } - - public enum StreamID : uint - { - /// - /// Regular stream ID to identify the directory entry. - /// - REGSID = 0x00000000, // 0x00000000 - 0xFFFFFFF9 - - /// - /// Maximum regular stream ID. - /// - MAXREGSID = 0xFFFFFFFA, - - /// - /// Terminator or empty pointer. - /// - NOSTREAM = 0xFFFFFFFF, - } - - /// - public enum SummaryInformationProperty : uint - { - /// - /// Title - /// - PIDSI_TITLE = 0x00000002, - - /// - /// Subject - /// - PIDSI_SUBJECT = 0x00000003, - - /// - /// Author - /// - PIDSI_AUTHOR = 0x00000004, - - /// - /// Keywords - /// - PIDSI_KEYWORDS = 0x00000005, - - /// - /// Comments - /// - PIDSI_COMMENTS = 0x00000006, - - /// - /// Template - /// - PIDSI_TEMPLATE = 0x00000007, - - /// - /// Last Saved By - /// - PIDSI_LASTAUTHOR = 0x00000008, - - /// - /// Revision Number - /// - PIDSI_REVNUMBER = 0x00000009, - - /// - /// Total Editing Time - /// - PIDSI_EDITTIME = 0x0000000A, - - /// - /// Last Printed - /// - PIDSI_LASTPRINTED = 0x0000000B, - - /// - /// Create Time/Date - /// - PIDSI_CREATE_DTM = 0x0000000C, - - /// - /// Last saved Time/Date - /// - PIDSI_LASTSAVE_DTM = 0x0000000D, - - /// - /// Number of Pages - /// - PIDSI_PAGECOUNT = 0x0000000E, - - /// - /// Number of Words - /// - PIDSI_WORDCOUNT = 0x0000000F, - - /// - /// Number of Characters - /// - PIDSI_CHARCOUNT = 0x00000010, - - /// - /// Thumbnail - /// - PIDSI_THUMBNAIL = 0x00000011, - - /// - /// Name of Creating Application - /// - PIDSI_APPNAME = 0x00000012, - - /// - /// Security - /// - PIDSI_SECURITY = 0x00000013, - } - - /// Also includes the DocumentSummaryInformation set - /// - public enum UserDefinedProperty : uint - { - /// - /// Category - A text string typed by the user that indicates what - /// category the file belongs to (memo, proposal, and so on). It - /// is useful for finding files of same type. - /// - PIDDSI_CATEGORY = 0x00000002, - - /// - /// PresentationTarget - Target format for presentation (35mm, - /// printer, video, and so on). - /// - PIDDSI_PRESFORMAT = 0x00000003, - - /// - /// Bytes - Number of bytes. - /// - PIDDSI_BYTECOUNT = 0x00000004, - - /// - /// Lines - Number of lines. - /// - PIDDSI_LINECOUNT = 0x00000005, - - /// - /// Paragraphs - Number of paragraphs. - /// - PIDDSI_PARCOUNT = 0x00000006, - - /// - /// Slides - Number of slides. - /// - PIDDSI_SLIDECOUNT = 0x00000007, - - /// - /// Notes - Number of pages that contain notes. - /// - PIDDSI_NOTECOUNT = 0x00000008, - - /// - /// HiddenSlides - Number of slides that are hidden. - /// - PIDDSI_HIDDENCOUNT = 0x00000009, - - /// - /// MMClips - Number of sound or video clips. - /// - PIDDSI_MMCLIPCOUNT = 0x0000000A, - - /// - /// ScaleCrop - Set to True (-1) when scaling of the thumbnail - - /// is desired. If not set, cropping is desired. - /// - PIDDSI_SCALE = 0x0000000B, - - /// - /// HeadingPairs - Internally used property indicating the - /// grouping of different document parts and the number of - /// items in each group. The titles of the document parts are - /// stored in the TitlesofParts property. The HeadingPairs - /// property is stored as a vector of variants, in repeating - /// pairs of VT_LPSTR (or VT_LPWSTR) and VT_I4 values. The - /// VT_LPSTR value represents a heading name, and the VT_I4 - /// value indicates the count of document parts under that heading. - /// - PIDDSI_HEADINGPAIR = 0x0000000C, - - /// - /// TitlesofParts - Names of document parts. - /// - PIDDSI_DOCPARTS = 0x0000000D, - - /// - /// Manager - Manager of the project. - /// - PIDDSI_MANAGER = 0x0000000E, - - /// - /// Company - Company name. - /// - PIDDSI_COMPANY = 0x0000000F, - - /// - /// LinksUpToDate - Boolean value to indicate whether the custom - /// links are hampered by excessive noise, for all applications. - /// - PIDDSI_LINKSDIRTY = 0x00000010, - } - - /// - public enum VariantType : ushort - { - /// - /// The type of the contained field is undefined. When this flag is - /// specified, the VARIANT MUST NOT contain a data field. - /// - VT_EMPTY = 0x0000, - - /// - /// The type of the contained field is NULL. When this flag is - /// specified, the VARIANT MUST NOT contain a data field. - /// - VT_NULL = 0x0001, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be a 2-byte signed integer. - /// - VT_I2 = 0x0002, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be a 4-byte signed integer. - /// - VT_I4 = 0x0003, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be a 4-byte IEEE floating-point number. - /// - VT_R4 = 0x0004, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be an 8-byte IEEE floating-point number. - /// - VT_R8 = 0x0005, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be CURRENCY. - /// - VT_CY = 0x0006, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be DATE. - /// - VT_DATE = 0x0007, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be BSTR. - /// - VT_BSTR = 0x0008, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be a pointer to IDispatch. - /// - VT_DISPATCH = 0x0009, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be HRESULT. - /// - VT_ERROR = 0x000A, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be VARIANT_BOOL. - /// - VT_BOOL = 0x000B, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be VARIANT. It MUST appear with the bit flag VT_BYREF. - /// - VT_VARIANT = 0x000C, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be a pointer to IUnknown. - /// - VT_UNKNOWN = 0x000D, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be DECIMAL. - /// - VT_DECIMAL = 0x000E, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be a 1-byte integer. - /// - VT_I1 = 0x0010, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be a 1-byte unsigned integer. - /// - VT_UI1 = 0x0011, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be a 2-byte unsigned integer. - /// - VT_UI2 = 0x0012, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be a 4-byte unsigned integer. - /// - VT_UI4 = 0x0013, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be an 8-byte signed integer. - /// - VT_I8 = 0x0014, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be an 8-byte unsigned integer. - /// - VT_UI8 = 0x0015, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be a 4-byte signed integer. - /// - VT_INT = 0x0016, - - /// - /// Either the specified type, or the type of the element or contained - /// field MUST be a 4-byte unsigned integer. - /// - VT_UINT = 0x0017, - - /// - /// The specified type MUST be void. - /// - VT_VOID = 0x0018, - - /// - /// The specified type MUST be HRESULT. - /// - VT_HRESULT = 0x0019, - - /// - /// The specified type MUST be a unique pointer. - /// - VT_PTR = 0x001A, - - /// - /// The specified type MUST be SAFEARRAY. - /// - VT_SAFEARRAY = 0x001B, - - /// - /// The specified type MUST be a fixed-size array. - /// - VT_CARRAY = 0x001C, - - /// - /// The specified type MUST be user defined. - /// - VT_USERDEFINED = 0x001D, - - /// - /// The specified type MUST be a NULL-terminated string. - /// - VT_LPSTR = 0x001E, - - /// - /// The specified type MUST be a zero-terminated string of - /// UNICODE characters. - /// - VT_LPWSTR = 0x001F, - - /// - /// The type of the element or contained field MUST be a BRECORD. - /// - VT_RECORD = 0x0024, - - /// - /// The specified type MUST be either a 4-byte or an 8-byte signed - /// integer. The size of the integer is platform specific and - /// determines the system pointer size value. - /// - VT_INT_PTR = 0x0025, - - /// - /// The specified type MUST be either a 4 byte or an 8 byte unsigned - /// integer. The size of the integer is platform specific and - /// determines the system pointer size value - /// - VT_UINT_PTR = 0x0026, - - /// - /// The type of the element or contained field MUST be a SAFEARRAY. - /// - VT_ARRAY = 0x2000, - - /// - /// The type of the element or contained field MUST be a pointer to - /// one of the types listed in the previous rows of this table. If - /// present, this bit flag MUST appear in a VARIANT discriminant - /// with one of the previous flags. - /// - VT_BYREF = 0x4000 - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/CFB/FileHeader.cs b/BinaryObjectScanner.Models/CFB/FileHeader.cs deleted file mode 100644 index ea473111..00000000 --- a/BinaryObjectScanner.Models/CFB/FileHeader.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.CFB -{ - /// - public sealed class FileHeader - { - /// - /// Iddentification signature for the compound file structure, and MUST be - /// set to the value 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1. - /// - public ulong Signature; - - /// - /// Reserved and unused class ID that MUST be set to all zeroes (CLSID_NULL) - /// - public Guid CLSID; - - /// - /// Version number for nonbreaking changes. This field SHOULD be set to - /// 0x003E if the major version field is either 0x0003 or 0x0004. - /// - public ushort MinorVersion; - - /// - /// Version number for breaking changes. This field MUST be set to either - /// 0x0003 (version 3) or 0x0004 (version 4). - /// - public ushort MajorVersion; - - /// - /// This field MUST be set to 0xFFFE. This field is a byte order mark for - /// all integer fields, specifying little-endian byte order. - /// - public ushort ByteOrder; - - /// - /// This field MUST be set to 0x0009, or 0x000c, depending on the Major - /// Version field. This field specifies the sector size of the compound file - /// as a power of 2. - /// - /// If Major Version is 3, the Sector Shift MUST be 0x0009, specifying a - /// sector size of 512 bytes. - /// - /// If Major Version is 4, the Sector Shift MUST be 0x000C, specifying a - /// sector size of 4096 bytes. - /// - public ushort SectorShift; - - /// - /// This field MUST be set to 0x0006. This field specifies the sector size - /// of the Mini Stream as a power of 2. The sector size of the Mini Stream - /// MUST be 64 bytes. - /// - public ushort MiniSectorShift; - - /// - /// This field MUST be set to all zeroes. - /// - public byte[] Reserved; - - /// - /// This integer field contains the count of the number of directory sectors - /// in the compound file. - /// - /// If Major Version is 3, the Number of Directory Sectors MUST be zero. This - /// field is not supported for version 3 compound files. - /// - public uint NumberOfDirectorySectors; - - /// - /// This integer field contains the count of the number of FAT sectors in the - /// compound file. - /// - public uint NumberOfFATSectors; - - /// - /// This integer field contains the starting sector number for the directory stream. - /// - public uint FirstDirectorySectorLocation; - - /// - /// This integer field MAY contain a sequence number that is incremented every time - /// the compound file is saved by an implementation that supports file transactions. - /// This is the field that MUST be set to all zeroes if file transactions are not - /// implemented. - /// - public uint TransactionSignatureNumber; - - /// - /// This integer field MUST be set to 0x00001000. This field specifies the maximum - /// size of a user-defined data stream that is allocated from the mini FAT and mini - /// stream, and that cutoff is 4,096 bytes. Any user-defined data stream that is - /// greater than or equal to this cutoff size must be allocated as normal sectors from - /// the FAT. - /// - public uint MiniStreamCutoffSize; - - /// - /// This integer field contains the starting sector number for the mini FAT. - /// - public uint FirstMiniFATSectorLocation; - - /// - /// This integer field contains the count of the number of mini FAT sectors in the - /// compound file. - /// - public uint NumberOfMiniFATSectors; - - /// - /// This integer field contains the starting sector number for the DIFAT. - /// - public uint FirstDIFATSectorLocation; - - /// - /// This integer field contains the count of the number of DIFAT sectors in the - /// compound file. - /// - public uint NumberOfDIFATSectors; - - /// - /// This array of 32-bit integer fields contains the first 109 FAT sector - /// locations of the compound file - /// - public SectorNumber[] DIFAT; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/CFB/SummaryInformation.cs b/BinaryObjectScanner.Models/CFB/SummaryInformation.cs deleted file mode 100644 index 23dbd6e7..00000000 --- a/BinaryObjectScanner.Models/CFB/SummaryInformation.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.CFB -{ - /// - public sealed class SummaryInformation - { - #region Set Header - - /// - /// This field MUST be set to 0xFFFE. This field is a byte order mark for - /// all integer fields, specifying little-endian byte order. - /// - public ushort ByteOrder; - - /// - /// Format - /// - public ushort Format; - - /// - /// Build - /// - public ushort Build; - - /// - /// Platform ID - /// - public ushort PlatformID; - - /// - /// CLSID - /// - public Guid CLSID; - - /// - /// 4 bytes of reserved data - /// - public byte[] Reserved; - - #endregion - - #region Format Header - - /// - /// Format ID, should be - /// - public Guid FormatID; - - /// - /// 16 bytes of unknown data - /// - public byte[] Unknown; - - #endregion - - #region Section Header - - /// - /// Location of the section - /// - public uint Offset; - - /// - /// Section count(?) - /// - public uint SectionCount; - - /// - /// Property count - /// - public uint PropertyCount; - - /// - /// Properties - /// - /// Each Variant might be followed by an index and offset value - public Variant[] Properties; - - #endregion - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/CFB/Variant.cs b/BinaryObjectScanner.Models/CFB/Variant.cs deleted file mode 100644 index f3b428be..00000000 --- a/BinaryObjectScanner.Models/CFB/Variant.cs +++ /dev/null @@ -1,45 +0,0 @@ -namespace BinaryObjectScanner.Models.CFB -{ - /// - /// VARIANT is a container for a union that can hold many types of data. - /// - /// - public sealed class Variant - { - /// - /// MUST be set to the size, in quad words (64 bits), of the structure. - /// - public uint Size; - - /// - /// MUST be set to 0 and MUST be ignored by the recipient. - /// - public uint RpcReserved; - - /// - /// MUST be set to one of the values specified with a "V". - /// - public VariantType VariantType; - - /// - /// MAY be set to 0 and MUST be ignored by the recipient. - /// - public ushort Reserved1; - - /// - /// MAY be set to 0 and MUST be ignored by the recipient. - /// - public ushort Reserved2; - - /// - /// MAY be set to 0 and MUST be ignored by the recipient. - /// - public ushort Reserved3; - - /// - /// MUST contain an instance of the type, according to the value - /// in the field. - /// - public object Union; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/LZ/Constants.cs b/BinaryObjectScanner.Models/Compression/LZ/Constants.cs deleted file mode 100644 index 7c56209b..00000000 --- a/BinaryObjectScanner.Models/Compression/LZ/Constants.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.LZ -{ - public static class Constants - { - public const int GETLEN = 2048; - - public const int LZ_MAGIC_LEN = 8; - - public const int LZ_HEADER_LEN = 14; - - public static readonly byte[] MagicBytes = new byte[] { 0x53, 0x5a, 0x44, 0x44, 0x88, 0xf0, 0x27, 0x33 }; - - public static readonly string MagicString = System.Text.Encoding.ASCII.GetString(MagicBytes); - - public const ulong MagicUInt64 = 0x3327f08844445a53; - - public const int LZ_TABLE_SIZE = 0x1000; - - public const int MAX_LZSTATES = 16; - - public const int LZ_MIN_HANDLE = 0x400; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/LZ/Enums.cs b/BinaryObjectScanner.Models/Compression/LZ/Enums.cs deleted file mode 100644 index ce5ad280..00000000 --- a/BinaryObjectScanner.Models/Compression/LZ/Enums.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.LZ -{ - /// - public enum LZERROR - { - LZERROR_OK = 1, - LZERROR_NOT_LZ = 0, - LZERROR_BADINHANDLE = -1, - LZERROR_BADOUTHANDLE = -2, - LZERROR_READ = -3, - LZERROR_WRITE = -4, - LZERROR_GLOBALLOC = -5, - LZERROR_GLOBLOCK = -6, - LZERROR_BADVALUE = -7, - LZERROR_UNKNOWNALG = -8, - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/LZ/FileHeader.cs b/BinaryObjectScanner.Models/Compression/LZ/FileHeader.cs deleted file mode 100644 index dee28e21..00000000 --- a/BinaryObjectScanner.Models/Compression/LZ/FileHeader.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.LZ -{ - /// - /// Format of first 14 byte of LZ compressed file - /// - /// - public sealed class FileHeaader - { - public string Magic; - - public byte CompressionType; - - public char LastChar; - - public uint RealLength; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/LZ/State.cs b/BinaryObjectScanner.Models/Compression/LZ/State.cs deleted file mode 100644 index 0cdc640c..00000000 --- a/BinaryObjectScanner.Models/Compression/LZ/State.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.IO; - -namespace BinaryObjectScanner.Models.Compression.LZ -{ - public sealed class State - { - /// - /// Internal backing stream - /// - public Stream Source { get; set; } - - /// - /// The last char of the filename for replacement - /// - public char LastChar { get; set; } - - /// - /// Decompressed length of the file - /// - public uint RealLength { get; set; } - - /// - /// Position the decompressor currently is - /// - public uint RealCurrent { get; set; } - - /// - /// Position the user wants to read from - /// - public uint RealWanted { get; set; } - - /// - /// The rotating LZ table - /// - public byte[] Table { get; set; } - - /// - /// CURrent TABle ENTry - /// - public uint CurrentTableEntry { get; set; } - - /// - /// Length and position of current string - /// - public byte StringLength { get; set; } - - /// - /// From stringtable - /// - public uint StringPosition { get; set; } - - /// - /// Bitmask within blocks - /// - public ushort ByteType { get; set; } - - /// - /// GETLEN bytes - /// - public byte[] Window { get; set; } - - /// - /// Current read - /// - public uint WindowCurrent { get; set; } - - /// - /// Length last got - /// - public uint WindowLength { get; set; } - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/LZX/AlignedOffsetBlock.cs b/BinaryObjectScanner.Models/Compression/LZX/AlignedOffsetBlock.cs deleted file mode 100644 index 316778f6..00000000 --- a/BinaryObjectScanner.Models/Compression/LZX/AlignedOffsetBlock.cs +++ /dev/null @@ -1,61 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.LZX -{ - /// - /// An aligned offset block is identical to the verbatim block except for the presence of the aligned offset - /// tree preceding the other trees. - /// - /// - public class AlignedOffsetBlock - { - /// - /// Generic block header - /// - public BlockHeader Header; - - /// - /// Aligned offset tree - /// - /// 8 elements, 3 bits each - public byte[] AlignedOffsetTree; - - /// - /// Pretree for first 256 elements of main tree - /// - /// 20 elements, 4 bits each - public byte[] PretreeFirst256; - - /// - /// Path lengths of first 256 elements of main tree - /// - /// Encoded using pretree - public int[] PathLengthsFirst256; - - /// - /// Pretree for remainder of main tree - /// - /// 20 elements, 4 bits each - public byte[] PretreeRemainder; - - /// - /// Path lengths of remaining elements of main tree - /// - /// Encoded using pretree - public int[] PathLengthsRemainder; - - /// - /// Pretree for length tree - /// - /// 20 elements, 4 bits each - public byte[] PretreeLengthTree; - - /// - /// Path lengths of elements in length tree - /// - /// Encoded using pretree - public int[] PathLengthsLengthTree; - - // Entry Comments Size - // --------------------------------------------------------------------------------------- - // Token sequence (matches and literals) Specified in section 2.6 Variable - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/LZX/BlockHeader.cs b/BinaryObjectScanner.Models/Compression/LZX/BlockHeader.cs deleted file mode 100644 index d9a79900..00000000 --- a/BinaryObjectScanner.Models/Compression/LZX/BlockHeader.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.LZX -{ - /// - /// An LZXD block represents a sequence of compressed data that is encoded with the same set of - /// Huffman trees, or a sequence of uncompressed data. There can be one or more LZXD blocks in a - /// compressed stream, each with its own set of Huffman trees. Blocks do not have to start or end on a - /// chunk boundary; blocks can span multiple chunks, or a single chunk can contain multiple blocks. The - /// number of chunks is related to the size of the data being compressed, while the number of blocks is - /// related to how well the data is compressed. The Block Type field, as specified in section 2.3.1.1, - /// indicates which type of block follows, and the Block Size field, as specified in section 2.3.1.2, - /// indicates the number of uncompressed bytes represented by the block. Following the generic block - /// header is a type-specific header that describes the remainder of the block. - /// - /// - public class BlockHeader - { - /// 3 bits - public BlockType BlockType; - - /// - /// Block size is the high 8 bits of 24 - /// - /// 8 bits - public byte BlockSizeMSB; - - /// - /// Block size is the middle 8 bits of 24 - /// - /// 8 bits - public byte BlockSizeByte2; - - /// - /// Block size is the low 8 bits of 24 - /// - /// 8 bits - public byte BlocksizeLSB; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/LZX/Constants.cs b/BinaryObjectScanner.Models/Compression/LZX/Constants.cs deleted file mode 100644 index 275b9106..00000000 --- a/BinaryObjectScanner.Models/Compression/LZX/Constants.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.LZX -{ - public static class Constants - { - /* some constants defined by the LZX specification */ - public const int LZX_MIN_MATCH = (2); - public const int LZX_MAX_MATCH = (257); - public const int LZX_NUM_CHARS = (256); - - /// - /// also blocktypes 4-7 invalid - /// - public const int LZX_BLOCKTYPE_INVALID = (0); - public const int LZX_BLOCKTYPE_VERBATIM = (1); - public const int LZX_BLOCKTYPE_ALIGNED = (2); - public const int LZX_BLOCKTYPE_UNCOMPRESSED = (3); - public const int LZX_PRETREE_NUM_ELEMENTS = (20); - - /// - /// aligned offset tree #elements - /// - public const int LZX_ALIGNED_NUM_ELEMENTS = (8); - - /// - /// this one missing from spec! - /// - public const int LZX_NUM_PRIMARY_LENGTHS = (7); - - /// - /// length tree #elements - /// - public const int LZX_NUM_SECONDARY_LENGTHS = (249); - - /* LZX huffman defines: tweak tablebits as desired */ - public const int LZX_PRETREE_MAXSYMBOLS = (LZX_PRETREE_NUM_ELEMENTS); - public const int LZX_PRETREE_TABLEBITS = (6); - public const int LZX_MAINTREE_MAXSYMBOLS = (LZX_NUM_CHARS + 50 * 8); - public const int LZX_MAINTREE_TABLEBITS = (12); - public const int LZX_LENGTH_MAXSYMBOLS = (LZX_NUM_SECONDARY_LENGTHS + 1); - public const int LZX_LENGTH_TABLEBITS = (12); - public const int LZX_ALIGNED_MAXSYMBOLS = (LZX_ALIGNED_NUM_ELEMENTS); - public const int LZX_ALIGNED_TABLEBITS = (7); - - public const int LZX_LENTABLE_SAFETY = (64); /* we allow length table decoding overruns */ - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/LZX/Enums.cs b/BinaryObjectScanner.Models/Compression/LZX/Enums.cs deleted file mode 100644 index 02becb24..00000000 --- a/BinaryObjectScanner.Models/Compression/LZX/Enums.cs +++ /dev/null @@ -1,48 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.LZX -{ - /// - /// 3-bit block type - /// - public enum BlockType : byte - { - /// - /// Not valid - /// - INVALID_0 = 0b000, - - /// - /// Verbatim block - /// - Verbatim = 0b001, - - /// - /// Aligned offset block - /// - AlignedOffset = 0b010, - - /// - /// Uncompressed block - /// - Uncompressed = 0b011, - - /// - /// Not valid - /// - INVALID_4 = 0b100, - - /// - /// Not valid - /// - INVALID_5 = 0b101, - - /// - /// Not valid - /// - INVALID_6 = 0b110, - - /// - /// Not valid - /// - INVALID_7 = 0b111, - } -} diff --git a/BinaryObjectScanner.Models/Compression/LZX/Header.cs b/BinaryObjectScanner.Models/Compression/LZX/Header.cs deleted file mode 100644 index 6dcbe5a4..00000000 --- a/BinaryObjectScanner.Models/Compression/LZX/Header.cs +++ /dev/null @@ -1,102 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.LZX -{ - public class Header - { - /* - 2.2 Header - - 2.2.1 Chunk Size - - The LZXD compressor emits chunks of compressed data. A chunk represents exactly 32 KB of - uncompressed data until the last chunk in the stream, which can represent less than 32 KB. To - ensure that an exact number of input bytes represent an exact number of output bytes for each - chunk, after each 32 KB of uncompressed data is represented in the output compressed bitstream, the - output bitstream is padded with up to 15 bits of zeros to realign the bitstream on a 16-bit boundary - (even byte boundary) for the next 32 KB of data. This results in a compressed chunk of a byte-aligned - size. The compressed chunk could be smaller than 32 KB or larger than 32 KB if the data is - incompressible when the chunk is not the last one. - - The LZXD engine encodes a compressed, chunk-size prefix field preceding each compressed chunk in - the compressed byte stream. The compressed, chunk-size prefix field is a byte aligned, little-endian, - 16-bit field. The chunk prefix chain could be followed in the compressed stream without - decompressing any data. The next chunk prefix is at a location computed by the absolute byte offset - location of this chunk prefix plus 2 (for the size of the chunk-size prefix field) plus the current chunk - size. - - 2.2.2 E8 Call Translation - - E8 call translation is an optional feature that can be used when the data to compress contains x86 - instruction sequences. E8 translation operates as a preprocessing stage before compressing each - chunk, and the compressed stream header contains a bit that indicates whether the decoder shall - reverse the translation as a postprocessing step after decompressing each chunk. - - The x86 instruction beginning with a byte value of 0xE8 is followed by a 32-bit, little-endian relative - displacement to the call target. When E8 call translation is enabled, the following preprocessing steps - are performed on the uncompressed input before compression (assuming little-endian byte ordering): - - Let chunk_offset refer to the total number of uncompressed bytes preceding this chunk. - - Let E8_file_size refer to the caller-specified value given to the compressor or decoded from the header - of the compressed stream during decompression. - - The following example shows how E8 translation is performed for each 32-KB chunk of uncompressed - data (or less than 32 KB if last chunk to compress). - - if (( chunk_offset < 0x40000000 ) && ( chunk_size > 10 )) - for ( i = 0; i < (chunk_size – 10); i++ ) - if ( chunk_byte[ i ] == 0xE8 ) - long current_pointer = chunk_offset + i; - long displacement = chunk_byte[ i+1 ] | - chunk_byte[ i+2 ] << 8 | - chunk_byte[ i+3 ] << 16 | - chunk_byte[ i+4 ] << 24; - long target = current_pointer + displacement; - if (( target >= 0 ) && ( target < E8_file_size+current_pointer)) - if ( target >= E8_file_size ) - target = displacement – E8_file_size; - endif - chunk_byte[ i+1 ] = (byte)( target ); - chunk_byte[ i+2 ] = (byte)( target >> 8 ); - chunk_byte[ i+3 ] = (byte)( target >> 16 ); - chunk_byte[ i+4 ] = (byte)( target >> 24 ); - endif - i += 4; - endif - endfor - endif - - After decompression, the E8 scanning algorithm is the same. The following example shows how E8 - translation reversal is performed. - - long value = chunk_byte[ i+1 ] | - chunk_byte[ i+2 ] << 8 | - chunk_byte[ i+3 ] << 16 | - chunk_byte[ i+4 ] << 24; - if (( value >= -current_pointer ) && ( value < E8_file_size )) - if ( value >= 0 ) - displacement = value – current_pointer; - else - displacement = value + E8_file_size; - endif - chunk_byte[ i+1 ] = (byte)( displacement ); - chunk_byte[ i+2 ] = (byte)( displacement >> 8 ); - chunk_byte[ i+3 ] = (byte)( displacement >> 16 ); - chunk_byte[ i+4 ] = (byte)( displacement >> 24 ); - endif - - The first bit in the first chunk in the LZXD bitstream (following the 2-byte, chunk-size prefix described - in section 2.2.1) indicates the presence or absence of two 16-bit fields immediately following the - single bit. If the bit is set, E8 translation is enabled for all the following chunks in the stream using the - 32-bit value derived from the two 16-bit fields as the E8_file_size provided to the compressor when E8 - translation was enabled. Note that E8_file_size is completely independent of the length of the - uncompressed data. E8 call translation is disabled after the 32,768th chunk (after 1 gigabyte (GB) of - uncompressed data). - - Field Comments Size - ---------------------------------------------------------------- - E8 translation 0-disabled, 1-enabled 1 bit - Translation size high word Only present if enabled 0 or 16 bits - Translation size low word Only present if enabled 0 or 16 bits - */ - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/LZX/UncompressedBlock.cs b/BinaryObjectScanner.Models/Compression/LZX/UncompressedBlock.cs deleted file mode 100644 index 3e277297..00000000 --- a/BinaryObjectScanner.Models/Compression/LZX/UncompressedBlock.cs +++ /dev/null @@ -1,59 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.LZX -{ - /// - /// Following the generic block header, an uncompressed block begins with 1 to 16 bits of zero padding - /// to align the bit buffer on a 16-bit boundary. At this point, the bitstream ends and a byte stream - /// begins. Following the zero padding, new 32-bit values for R0, R1, and R2 are output in little-endian - /// form, followed by the uncompressed data bytes themselves. Finally, if the uncompressed data length - /// is odd, one extra byte of zero padding is encoded to realign the following bitstream. - /// - /// Then the bitstream of byte-swapped 16-bit integers resumes for the next Block Type field (if there - /// are subsequent blocks). - /// - /// The decoded R0, R1, and R2 values are used as initial repeated offset values to decode the - /// subsequent compressed block if present. - /// - /// - public class UncompressedBlock - { - /// - /// Generic block header - /// - public BlockHeader Header; - - /// - /// Padding to align following field on 16-bit boundary - /// - /// Bits have a value of zero - public ushort PaddingBits; - - /// - /// Least significant to most significant byte (little-endian DWORD ([MS-DTYP])) - /// - /// Encoded directly in the byte stream, not in the bitstream of byte-swapped 16-bit words - public uint R0; - - /// - /// Least significant to most significant byte (little-endian DWORD) - /// - /// Encoded directly in the byte stream, not in the bitstream of byte-swapped 16-bit words - public uint R1; - - /// - /// Least significant to most significant byte (little-endian DWORD) - /// - /// Encoded directly in the byte stream, not in the bitstream of byte-swapped 16-bit words - public uint R2; - - /// - /// Can use the direct memcpy function, as specified in [IEEE1003.1] - /// - /// Encoded directly in the byte stream, not in the bitstream of byte-swapped 16-bit words - public byte[] RawDataBytes; - - /// - /// Only if uncompressed size is odd - /// - public byte AlignmentByte; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/LZX/VerbatimBlock.cs b/BinaryObjectScanner.Models/Compression/LZX/VerbatimBlock.cs deleted file mode 100644 index 6f6d6d67..00000000 --- a/BinaryObjectScanner.Models/Compression/LZX/VerbatimBlock.cs +++ /dev/null @@ -1,54 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.LZX -{ - /// - /// The fields of a verbatim block that follow the generic block header - /// - /// - public class VerbatimBlock - { - /// - /// Generic block header - /// - public BlockHeader Header; - - /// - /// Pretree for first 256 elements of main tree - /// - /// 20 elements, 4 bits each - public byte[] PretreeFirst256; - - /// - /// Path lengths of first 256 elements of main tree - /// - /// Encoded using pretree - public int[] PathLengthsFirst256; - - /// - /// Pretree for remainder of main tree - /// - /// 20 elements, 4 bits each - public byte[] PretreeRemainder; - - /// - /// Path lengths of remaining elements of main tree - /// - /// Encoded using pretree - public int[] PathLengthsRemainder; - - /// - /// Pretree for length tree - /// - /// 20 elements, 4 bits each - public byte[] PretreeLengthTree; - - /// - /// Path lengths of elements in length tree - /// - /// Encoded using pretree - public int[] PathLengthsLengthTree; - - // Entry Comments Size - // --------------------------------------------------------------------------------------- - // Token sequence (matches and literals) Specified in section 2.6 Variable - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/MSZIP/BlockHeader.cs b/BinaryObjectScanner.Models/Compression/MSZIP/BlockHeader.cs deleted file mode 100644 index 7af9275f..00000000 --- a/BinaryObjectScanner.Models/Compression/MSZIP/BlockHeader.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.MSZIP -{ - /// - /// Each MSZIP block MUST consist of a 2-byte MSZIP signature and one or more RFC 1951 blocks. The - /// 2-byte MSZIP signature MUST consist of the bytes 0x43 and 0x4B. The MSZIP signature MUST be - /// the first 2 bytes in the MSZIP block. The MSZIP signature is shown in the following packet diagram. - /// - /// Each MSZIP block is the result of a single deflate compression operation, as defined in [RFC1951]. - /// The compressor that performs the compression operation MUST generate one or more RFC 1951 - /// blocks, as defined in [RFC1951]. The number, deflation mode, and type of RFC 1951 blocks in each - /// MSZIP block is determined by the compressor, as defined in [RFC1951]. The last RFC 1951 block in - /// each MSZIP block MUST be marked as the "end" of the stream(1), as defined by [RFC1951] - /// section 3.2.3. Decoding trees MUST be discarded after each RFC 1951 block, but the history buffer - /// MUST be maintained.Each MSZIP block MUST represent no more than 32 KB of uncompressed data. - /// - /// The maximum compressed size of each MSZIP block is 32 KB + 12 bytes. This enables the MSZIP - /// block to contain 32 KB of data split between two noncompressed RFC 1951 blocks, each of which - /// has a value of BTYPE = 00. - /// - /// - public class BlockHeader - { - /// - /// 'CK' - /// - public ushort Signature; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/MSZIP/Constants.cs b/BinaryObjectScanner.Models/Compression/MSZIP/Constants.cs deleted file mode 100644 index d4410b8c..00000000 --- a/BinaryObjectScanner.Models/Compression/MSZIP/Constants.cs +++ /dev/null @@ -1,89 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.MSZIP -{ - /// - public static class Constants - { - /// - /// Window size - /// - public const ushort ZIPWSIZE = 0x8000; - - /// - /// Bits in base literal/length lookup table - /// - public const int ZIPLBITS = 9; - - /// - /// Bits in base distance lookup table - /// - public const int ZIPDBITS = 6; - - /// - /// Maximum bit length of any code - /// - public const int ZIPBMAX = 16; - - /// - /// Maximum number of codes in any set - /// - public const int ZIPN_MAX = 288; - - #region THOSE_ZIP_CONSTS - - /// - /// Order of the bit length code lengths - /// - public static readonly byte[] BitLengthOrder = new byte[] - { - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 - }; - - /// - /// Copy lengths for literal codes 257..285 - /// - public static readonly ushort[] CopyLengths = new ushort[] - { - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, - 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 - }; - - /// - /// Extra bits for literal codes 257..285 - /// - /// 99 == invalid - public static readonly ushort[] LiteralExtraBits = new ushort[] - { - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, - 4, 5, 5, 5, 5, 0, 99, 99 - }; - - /// - /// Copy offsets for distance codes 0..29 - /// - public static readonly ushort[] CopyOffsets = new ushort[] - { - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, - 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 - }; - - /// - /// Extra bits for distance codes - /// - public static readonly ushort[] DistanceExtraBits = new ushort[] - { - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, - 10, 11, 11, 12, 12, 13, 13 - }; - - /// - /// And'ing with Zipmask[n] masks the lower n bits - /// - public static readonly ushort[] BitMasks = new ushort[17] - { - 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, - 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff - }; - - #endregion - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/MSZIP/DeflateBlockHeader.cs b/BinaryObjectScanner.Models/Compression/MSZIP/DeflateBlockHeader.cs deleted file mode 100644 index 12fa5605..00000000 --- a/BinaryObjectScanner.Models/Compression/MSZIP/DeflateBlockHeader.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.MSZIP -{ - /// - public class DeflateBlockHeader - { - /// - /// Set if and only if this is the last block of the data set. - /// - /// Bit 0 - public bool BFINAL { get; set; } - - /// - /// Specifies how the data are compressed - /// - /// Bits 1-2 - public CompressionType BTYPE { get; set; } - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/MSZIP/DynamicHuffmanCompressedBlockHeader.cs b/BinaryObjectScanner.Models/Compression/MSZIP/DynamicHuffmanCompressedBlockHeader.cs deleted file mode 100644 index 8ec27056..00000000 --- a/BinaryObjectScanner.Models/Compression/MSZIP/DynamicHuffmanCompressedBlockHeader.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.MSZIP -{ - /// - /// Compression with dynamic Huffman codes (BTYPE=10) - /// - /// - public class DynamicHuffmanCompressedBlockHeader - { - /// - /// Huffman code lengths for the literal / length alphabet - /// - public int[] LiteralLengths; - - /// - /// Huffman distance codes for the literal / length alphabet - /// - public int[] DistanceCodes; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/MSZIP/Enums.cs b/BinaryObjectScanner.Models/Compression/MSZIP/Enums.cs deleted file mode 100644 index 9e520e8b..00000000 --- a/BinaryObjectScanner.Models/Compression/MSZIP/Enums.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.MSZIP -{ - public enum CompressionType : byte - { - /// - /// no compression - /// - NoCompression = 0b00, - - /// - /// Compressed with fixed Huffman codes - /// - FixedHuffman = 0b01, - - /// - /// Compressed with dynamic Huffman codes - /// - DynamicHuffman = 0b10, - - /// - /// Reserved (error) - /// - Reserved = 0b11, - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/MSZIP/FixedHuffmanCompressedBlockHeader.cs b/BinaryObjectScanner.Models/Compression/MSZIP/FixedHuffmanCompressedBlockHeader.cs deleted file mode 100644 index 9078559e..00000000 --- a/BinaryObjectScanner.Models/Compression/MSZIP/FixedHuffmanCompressedBlockHeader.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.Compression.MSZIP -{ - /// - /// Compression with fixed Huffman codes (BTYPE=01) - /// - /// - /// - public class FixedHuffmanCompressedBlockHeader - { - #region Properties - - /// - /// Huffman code lengths for the literal / length alphabet - /// - public uint[] LiteralLengths - { - get - { - // If we have cached lengths, use those - if (_literalLengths != null) - return _literalLengths; - - // Otherwise, build it from scratch - _literalLengths = new uint[288]; - - // Literal Value 0 - 143, 8 bits - for (int i = 0; i < 144; i++) - _literalLengths[i] = 8; - - // Literal Value 144 - 255, 9 bits - for (int i = 144; i < 256; i++) - _literalLengths[i] = 9; - - // Literal Value 256 - 279, 7 bits - for (int i = 256; i < 280; i++) - _literalLengths[i] = 7; - - // Literal Value 280 - 287, 8 bits - for (int i = 280; i < 288; i++) - _literalLengths[i] = 8; - - return _literalLengths; - } - set - { - throw new FieldAccessException(); - } - } - - /// - /// Huffman distance codes for the literal / length alphabet - /// - public uint[] DistanceCodes - { - get - { - // If we have cached distances, use those - if (_distanceCodes != null) - return _distanceCodes; - - // Otherwise, build it from scratch - _distanceCodes = new uint[30]; - - // Fixed length, 5 bits - for (int i = 0; i < 30; i++) - _distanceCodes[i] = 5; - - return _distanceCodes; - } - set - { - throw new FieldAccessException(); - } - } - - #endregion - - #region Instance Variables - - /// - /// Huffman code lengths for the literal / length alphabet - /// - private uint[] _literalLengths = null; - - /// - /// Huffman distance codes for the literal / length alphabet - /// - private uint[] _distanceCodes = null; - - #endregion - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/MSZIP/NonCompressedBlockHeader.cs b/BinaryObjectScanner.Models/Compression/MSZIP/NonCompressedBlockHeader.cs deleted file mode 100644 index f7bb7381..00000000 --- a/BinaryObjectScanner.Models/Compression/MSZIP/NonCompressedBlockHeader.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.MSZIP -{ - /// - /// Non-compressed blocks (BTYPE=00) - /// - /// - public class NonCompressedBlockHeader - { - /// - /// The number of data bytes in the block - /// - /// Bytes 0-1 - public ushort LEN; - - /// - /// The one's complement of LEN - /// - /// Bytes 2-3 - public ushort NLEN; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/Quantum/Constants.cs b/BinaryObjectScanner.Models/Compression/Quantum/Constants.cs deleted file mode 100644 index 2469bc71..00000000 --- a/BinaryObjectScanner.Models/Compression/Quantum/Constants.cs +++ /dev/null @@ -1,45 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.Quantum -{ - public static class Constants - { - /// - /// Mask for Quantum Compression Level - /// - public const ushort MASK_QUANTUM_LEVEL = 0x00F0; - - /// - /// Lowest Quantum Level (1) - /// - public const ushort QUANTUM_LEVEL_LO = 0x0010; - - /// - /// Highest Quantum Level (7) - /// - public const ushort QUANTUM_LEVEL_HI = 0x0070; - - /// - /// Amount to shift over to get int - /// - public const ushort SHIFT_QUANTUM_LEVEL = 4; - - /// - /// Mask for Quantum Compression Memory - /// - public const ushort MASK_QUANTUM_MEM = 0x1F00; - - /// - /// Lowest Quantum Memory (10) - /// - public const ushort QUANTUM_MEM_LO = 0x0A00; - - /// - /// Highest Quantum Memory (21) - /// - public const ushort QUANTUM_MEM_HI = 0x1500; - - /// - /// Amount to shift over to get int - /// - public const ushort SHIFT_QUANTUM_MEM = 8; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/Quantum/Enums.cs b/BinaryObjectScanner.Models/Compression/Quantum/Enums.cs deleted file mode 100644 index e6152bb4..00000000 --- a/BinaryObjectScanner.Models/Compression/Quantum/Enums.cs +++ /dev/null @@ -1,45 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.Quantum -{ - public enum SelectorModel - { - /// - /// Literal model, 64 entries, start at symbol 0 - /// - SELECTOR_0 = 0, - - /// - /// Literal model, 64 entries, start at symbol 64 - /// - SELECTOR_1 = 1, - - /// - /// Literal model, 64 entries, start at symbol 128 - /// - SELECTOR_2 = 2, - - /// - /// Literal model, 64 entries, start at symbol 192 - /// - SELECTOR_3 = 3, - - /// - /// LZ model, 3 character matches, max 24 entries, start at symbol 0 - /// - SELECTOR_4 = 4, - - /// - /// LZ model, 4 character matches, max 36 entries, start at symbol 0 - /// - SELECTOR_5 = 5, - - /// - /// LZ model, 5+ character matches, max 42 entries, start at symbol 0 - /// - SELECTOR_6_POSITION = 6, - - /// - /// LZ model, 5+ character matches, 27 entries, start at symbol 0 - /// - SELECTOR_6_LENGTH = 7, - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/Quantum/Model.cs b/BinaryObjectScanner.Models/Compression/Quantum/Model.cs deleted file mode 100644 index b0bf6d51..00000000 --- a/BinaryObjectScanner.Models/Compression/Quantum/Model.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.Quantum -{ - /// - /// - public sealed class Model - { - public int TimeToReorder; - - public int Entries; - - public ModelSymbol[] Symbols; - - public ushort[] LookupTable = new ushort[256]; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Compression/Quantum/ModelSymbol.cs b/BinaryObjectScanner.Models/Compression/Quantum/ModelSymbol.cs deleted file mode 100644 index 01708674..00000000 --- a/BinaryObjectScanner.Models/Compression/Quantum/ModelSymbol.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.Compression.Quantum -{ - /// - /// - public sealed class ModelSymbol - { - public ushort Symbol; - - public ushort CumulativeFrequency; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/AudioSubPictureAttributesTable.cs b/BinaryObjectScanner.Models/DVD/AudioSubPictureAttributesTable.cs deleted file mode 100644 index 845f9ef4..00000000 --- a/BinaryObjectScanner.Models/DVD/AudioSubPictureAttributesTable.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - /// - public sealed class AudioSubPictureAttributesTable - { - /// - /// Number of title sets - /// - public ushort NumberOfTitleSets; - - /// - /// Reserved - /// - public byte[] Reserved; - - /// - /// End address (last byte of last VTS_ATRT) - /// - public uint EndAddress; - - /// - /// Offset to VTS_ATRT n - /// - public uint[] Offsets; - - /// - /// Entries - /// - public AudioSubPictureAttributesTableEntry[] Entries; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/AudioSubPictureAttributesTableEntry.cs b/BinaryObjectScanner.Models/DVD/AudioSubPictureAttributesTableEntry.cs deleted file mode 100644 index 8fbfabeb..00000000 --- a/BinaryObjectScanner.Models/DVD/AudioSubPictureAttributesTableEntry.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - /// - public sealed class AudioSubPictureAttributesTableEntry - { - /// - /// End address (EA) - /// - public uint EndAddress; - - /// - /// VTS_CAT (copy of offset 022-025 of the VTS IFO file) - /// 0=unspecified, 1=Karaoke - /// - public uint Category; - - /// - /// Copy of VTS attributes (offset 100 and on from the VTS IFO - /// file, usually 0x300 bytes long) - /// - public byte[] AttributesCopy; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/CellAddressTable.cs b/BinaryObjectScanner.Models/DVD/CellAddressTable.cs deleted file mode 100644 index 710e5b3b..00000000 --- a/BinaryObjectScanner.Models/DVD/CellAddressTable.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - /// - public sealed class CellAddressTable - { - /// - /// Number of VOB IDs - /// - public ushort NumberOfVOBIDs; - - /// - /// Reserved - /// - public byte[] Reserved; - - /// - /// End address (last byte of last entry) - /// - public uint EndAddress; - - /// - /// 12-byte entries - /// - public CellAddressTableEntry[] Entries; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/CellAddressTableEntry.cs b/BinaryObjectScanner.Models/DVD/CellAddressTableEntry.cs deleted file mode 100644 index cb40662a..00000000 --- a/BinaryObjectScanner.Models/DVD/CellAddressTableEntry.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - /// - public sealed class CellAddressTableEntry - { - /// - /// VOBidn - /// - public ushort VOBIdentity; - - /// - /// CELLidn - /// - public byte CellIdentity; - - /// - /// Reserved - /// - public byte Reserved; - - /// - /// Starting sector within VOB - /// - public uint StartingSectorWithinVOB; - - /// - /// Ending sector within VOB - /// - public uint EndingSectorWithinVOB; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/Constants.cs b/BinaryObjectScanner.Models/DVD/Constants.cs deleted file mode 100644 index 8652fd9d..00000000 --- a/BinaryObjectScanner.Models/DVD/Constants.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - public static class Constants - { - public const string VideoManagerIFOSignature = "DVDVIDEO-VMG"; - - public const string VideoTitleSetIFOSignature = "DVDVIDEO-VTS"; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/Enums.cs b/BinaryObjectScanner.Models/DVD/Enums.cs deleted file mode 100644 index 8745afc6..00000000 --- a/BinaryObjectScanner.Models/DVD/Enums.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.DVD -{ - [Flags] - public enum ProgramChainCategory : byte - { - MenuTypeTitle = 0x02, - Entry = 0x80, - } - - [Flags] - public enum TitleType : byte - { - /// - /// Uop0 Time play or search - /// - Uop0TimePlayOrSearch = 0x01, - - /// - /// Uop1 PTT play or search - /// - Uop1PTTPlayOrSearch = 0x02, - - /// - /// Jump/Link/Call commands - exist - /// - JumpLinkCallExist = 0x04, - - /// - /// Jump/Link/Call commands - button - /// - JumpLinkCallButton = 0x08, - - /// - /// Jump/Link/Call commands - pre/post - /// - JumpLinkCallPrePost = 0x10, - - /// - /// Jump/Link/Call commands - cell - /// - JumpLinkCallCell = 0x20, - - /// - /// 0=one_sequential_pgc - /// 1=not one_sequential (random, shuffle, stills, loops, or more than one pgc) - /// - ComplexPGC = 0x40, - - /// - /// Reserved - /// - Reserved = 0x80, - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/LanguageUnitTable.cs b/BinaryObjectScanner.Models/DVD/LanguageUnitTable.cs deleted file mode 100644 index bb111119..00000000 --- a/BinaryObjectScanner.Models/DVD/LanguageUnitTable.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - /// - public sealed class LanguageUnitTable - { - /// - /// Number of Language Units - /// - public ushort NumberOfLanguageUnits; - - /// - /// Reserved - /// - public byte[] Reserved; - - /// - /// End address (last byte of last PGC in last LU) - /// relative to VMGM_PGCI_UT - /// - public uint EndAddress; - - /// - /// Language Units - /// - public LanguageUnitTableEntry[] Entries; - - /// - /// Program Chains - /// - public ProgramChainTable[] ProgramChains; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/LanguageUnitTableEntry.cs b/BinaryObjectScanner.Models/DVD/LanguageUnitTableEntry.cs deleted file mode 100644 index 10b72aed..00000000 --- a/BinaryObjectScanner.Models/DVD/LanguageUnitTableEntry.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - /// - public sealed class LanguageUnitTableEntry - { - /// - /// ISO639 language code - /// - public ushort ISO639LanguageCode; - - /// - /// Reserved for language code extension - /// - public byte Reserved; - - /// - /// Menu existence flag [80 = title] - /// - public byte MenuExistenceFlag; - - /// - /// Offset to VMGM_LU, relative to VMGM_PGCI_UT - /// - public uint LanguageUnitOffset; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/ParentalManagementMasksTable.cs b/BinaryObjectScanner.Models/DVD/ParentalManagementMasksTable.cs deleted file mode 100644 index 394337ea..00000000 --- a/BinaryObjectScanner.Models/DVD/ParentalManagementMasksTable.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - /// - /// The VMG_PTL_MAIT is searched by country, and points to - /// the table for each country. - /// - /// - public sealed class ParentalManagementMasksTable - { - /// - /// Number of countries - /// - public ushort NumberOfCountries; - - /// - /// Number of title sets (NTs) - /// - public ushort NumberOfTitleSets; - - /// - /// End address (last byte of last PTL_MAIT) - /// - public uint EndAddress; - - /// - /// Entries - /// - public ParentalManagementMasksTableEntry[] Entries; - - /// - /// The PTL_MAIT contains the 16-bit masks for the VMG and - /// all title sets for parental management level 8 followed - /// by the masks for level 7, and so on to level 1. - /// - public byte[][] BitMasks; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/ParentalManagementMasksTableEntry.cs b/BinaryObjectScanner.Models/DVD/ParentalManagementMasksTableEntry.cs deleted file mode 100644 index c39d8bc5..00000000 --- a/BinaryObjectScanner.Models/DVD/ParentalManagementMasksTableEntry.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - /// - public sealed class ParentalManagementMasksTableEntry - { - /// - /// Country code - /// - public ushort CountryCode; - - /// - /// Reserved - /// - public byte[] Reserved; - - /// - /// Offset to PTL_MAIT - /// - public uint Offset; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/ProgramChainTable.cs b/BinaryObjectScanner.Models/DVD/ProgramChainTable.cs deleted file mode 100644 index 5076785f..00000000 --- a/BinaryObjectScanner.Models/DVD/ProgramChainTable.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - /// - public sealed class ProgramChainTable - { - /// - /// Number of Program Chains - /// - public ushort NumberOfProgramChains; - - /// - /// Reserved - /// - public byte[] Reserved; - - /// - /// End address (last byte of last PGC in this LU) - /// relative to VMGM_LU - /// - public uint EndAddress; - - /// - /// Program Chains - /// - public ProgramChainTableEntry[] Entries; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/ProgramChainTableEntry.cs b/BinaryObjectScanner.Models/DVD/ProgramChainTableEntry.cs deleted file mode 100644 index b3e0d51a..00000000 --- a/BinaryObjectScanner.Models/DVD/ProgramChainTableEntry.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - /// - public sealed class ProgramChainTableEntry - { - /// - /// PGC category - /// - public ProgramChainCategory Category; - - /// - /// Unknown - /// - public byte Unknown; - - /// - /// Parental management mask - /// - public ushort ParentalManagementMask; - - /// - /// Offset to VMGM_PGC, relative to VMGM_LU - /// - public uint Offset; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/TitlesTable.cs b/BinaryObjectScanner.Models/DVD/TitlesTable.cs deleted file mode 100644 index 22c4fb25..00000000 --- a/BinaryObjectScanner.Models/DVD/TitlesTable.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - /// - public sealed class TitlesTable - { - /// - /// Number of titles - /// - public ushort NumberOfTitles; - - /// - /// Reserved - /// - public byte[] Reserved; - - /// - /// End address (last byte of last entry) - /// - public uint EndAddress; - - /// - /// 12-byte entries - /// - public TitlesTableEntry[] Entries; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/TitlesTableEntry.cs b/BinaryObjectScanner.Models/DVD/TitlesTableEntry.cs deleted file mode 100644 index f44e0fd2..00000000 --- a/BinaryObjectScanner.Models/DVD/TitlesTableEntry.cs +++ /dev/null @@ -1,42 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - /// - public sealed class TitlesTableEntry - { - /// - /// Title type - /// - public TitleType TitleType; - - /// - /// Number of angles - /// - public byte NumberOfAngles; - - /// - /// Number of chapters (PTTs) - /// - public ushort NumberOfChapters; - - /// - /// Parental management mask - /// - public ushort ParentalManagementMask; - - /// - /// Video Title Set number (VTSN) - /// - public byte VideoTitleSetNumber; - - /// - /// Title number within VTS (VTS_TTN) - /// - public byte TitleNumberWithinVTS; - - /// - /// Start sector for VTS, referenced to whole disk - /// (video_ts.ifo starts at sector 00000000) - /// - public uint VTSStartSector; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/VOBUAddressMap.cs b/BinaryObjectScanner.Models/DVD/VOBUAddressMap.cs deleted file mode 100644 index d363914c..00000000 --- a/BinaryObjectScanner.Models/DVD/VOBUAddressMap.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - /// - public sealed class VOBUAddressMap - { - /// - /// End address (last byte of last entry) - /// - public uint EndAddress; - - /// - /// Starting sector within VOB of nth VOBU - /// - public uint[] StartingSectors; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/VideoManagerIFO.cs b/BinaryObjectScanner.Models/DVD/VideoManagerIFO.cs deleted file mode 100644 index 77120a51..00000000 --- a/BinaryObjectScanner.Models/DVD/VideoManagerIFO.cs +++ /dev/null @@ -1,150 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - /// - public sealed class VideoManagerIFO - { - /// - /// "DVDVIDEO-VMG" - /// - public string Signature; - - /// - /// Last sector of VMG set (last sector of BUP) - /// - public uint LastVMGSetSector; - - /// - /// Last sector of IFO - /// - public uint LastIFOSector; - - /// - /// Version number - /// - Byte 0 - Reserved, should be 0 - /// - Byte 1, Bits 7-4 - Major version number - /// - Byte 1, Bits 3-0 - Minor version number - /// - public ushort VersionNumber; - - /// - /// VMG category - /// - /// byte1=prohibited region mask - public uint VMGCategory; - - /// - /// Number of volumes - /// - public ushort NumberOfVolumes; - - /// - /// Volume number - /// - public ushort VolumeNumber; - - /// - /// Side ID - /// - public byte SideID; - - /// - /// Number of title sets - /// - public ushort NumberOfTitleSets; - - /// - /// Provider ID - /// - public byte[] ProviderID; - - /// - /// VMG POS - /// - public ulong VMGPOS; - - /// - /// End byte address of VMGI_MAT - /// - public uint InformationManagementTableEndByteAddress; - - /// - /// Start address of FP_PGC (First Play program chain) - /// - public uint FirstPlayProgramChainStartAddress; - - /// - /// Start sector of Menu VOB - /// - public uint MenuVOBStartSector; - - /// - /// Sector pointer to TT_SRPT (table of titles) - /// - public uint TableOfTitlesSectorPointer; - - /// - /// Sector pointer to VMGM_PGCI_UT (Menu Program Chain table) - /// - public uint MenuProgramChainTableSectorPointer; - - /// - /// Sector pointer to VMG_PTL_MAIT (Parental Management masks) - /// - public uint ParentalManagementMasksSectorPointer; - - /// - /// Sector pointer to VMG_VTS_ATRT (copies of VTS audio/sub-picture attributes) - /// - public uint AudioSubPictureAttributesSectorPointer; - - /// - /// Sector pointer to VMG_TXTDT_MG (text data) - /// - public uint TextDataSectorPointer; - - /// - /// Sector pointer to VMGM_C_ADT (menu cell address table) - /// - public uint MenuCellAddressTableSectorPointer; - - /// - /// Sector pointer to VMGM_VOBU_ADMAP (menu VOBU address map) - /// - public uint MenuVOBUAddressMapSectorPointer; - - /// - /// Video attributes of VMGM_VOBS - /// - public byte[] VideoAttributes; - - /// - /// Number of audio streams in VMGM_VOBS - /// - public ushort NumberOfAudioStreams; - - /// - /// Audio attributes of VMGM_VOBS - /// - public byte[][] AudioAttributes; - - /// - /// Unknown - /// - public byte[] Unknown; - - /// - /// Number of subpicture streams in VMGM_VOBS (0 or 1) - /// - public ushort NumberOfSubpictureStreams; - - /// - /// Subpicture attributes of VMGM_VOBS - /// - public byte[] SubpictureAttributes; - - /// - /// Reserved - /// - public byte[] Reserved; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/DVD/VideoTitleSetIFO.cs b/BinaryObjectScanner.Models/DVD/VideoTitleSetIFO.cs deleted file mode 100644 index f2e3b7b2..00000000 --- a/BinaryObjectScanner.Models/DVD/VideoTitleSetIFO.cs +++ /dev/null @@ -1,160 +0,0 @@ -namespace BinaryObjectScanner.Models.DVD -{ - /// - public sealed class VideoTitleSetIFO - { - /// - /// "DVDVIDEO-VTS" - /// - public string Signature; - - /// - /// Last sector of title set (last sector of BUP) - /// - public uint LastTitleSetSector; - - /// - /// Last sector of IFO - /// - public uint LastIFOSector; - - /// - /// Version number - /// - Byte 0 - Reserved, should be 0 - /// - Byte 1, Bits 7-4 - Major version number - /// - Byte 1, Bits 3-0 - Minor version number - /// - public ushort VersionNumber; - - /// - /// VTS category - /// - /// 0=unspecified, 1=Karaoke - public uint VMGCategory; - - /// - /// Number of volumes - /// - public ushort NumberOfVolumes; - - /// - /// Volume number - /// - public ushort VolumeNumber; - - /// - /// Side ID - /// - public byte SideID; - - /// - /// Number of title sets - /// - public ushort NumberOfTitleSets; - - /// - /// Provider ID - /// - public byte[] ProviderID; - - /// - /// VMG POS - /// - public ulong VMGPOS; - - /// - /// End byte address of VTS_MAT - /// - public uint InformationManagementTableEndByteAddress; - - /// - /// Start address of FP_PGC (First Play program chain) - /// - public uint FirstPlayProgramChainStartAddress; - - /// - /// Start sector of Menu VOB - /// - public uint MenuVOBStartSector; - - /// - /// Start sector of Title VOB - /// - public uint TitleVOBStartSector; - - /// - /// Sector pointer to VTS_PTT_SRPT (table of Titles and Chapters) - /// - public uint TableOfTitlesAndChaptersSectorPointer; - - /// - /// Sector pointer to VTS_PGCI (Title Program Chain table) - /// - public uint TitleProgramChainTableSectorPointer; - - /// - /// Sector pointer to VTSM_PGCI_UT (Menu Program Chain table) - /// - public uint MenuProgramChainTableSectorPointer; - - /// - /// Sector pointer to VTS_TMAPTI (time map) - /// - public uint TimeMapSectorPointer; - - /// - /// Sector pointer to VTSM_C_ADT (menu cell address table) - /// - public uint MenuCellAddressTableSectorPointer; - - /// - /// Sector pointer to VTSM_VOBU_ADMAP (menu VOBU address map) - /// - public uint MenuVOBUAddressMapSectorPointer; - - /// - /// Sector pointer to VTS_C_ADT (title set cell address table) - /// - public uint TitleSetCellAddressTableSectorPointer; - - /// - /// Sector pointer to VTS_VOBU_ADMAP (title set VOBU address map) - /// - public uint TitleSetVOBUAddressMapSectorPointer; - - /// - /// Video attributes of VTSM_VOBS - /// - public byte[] VideoAttributes; - - /// - /// Number of audio streams in VTSM_VOBS - /// - public ushort NumberOfAudioStreams; - - /// - /// Audio attributes of VTSM_VOBS - /// - public byte[][] AudioAttributes; - - /// - /// Unknown - /// - public byte[] Unknown; - - /// - /// Number of subpicture streams in VTSM_VOBS (0 or 1) - /// - public ushort NumberOfSubpictureStreams; - - /// - /// Subpicture attributes of VTSM_VOBS - /// - public byte[] SubpictureAttributes; - - /// - /// Reserved - /// - public byte[] Reserved; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/BlockEntry.cs b/BinaryObjectScanner.Models/GCF/BlockEntry.cs deleted file mode 100644 index bc8e6e81..00000000 --- a/BinaryObjectScanner.Models/GCF/BlockEntry.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class BlockEntry - { - /// - /// Flags for the block entry. 0x200F0000 == Not used. - /// - public uint EntryFlags; - - /// - /// The offset for the data contained in this block entry in the file. - /// - public uint FileDataOffset; - - /// - /// The length of the data in this block entry. - /// - public uint FileDataSize; - - /// - /// The offset to the first data block of this block entry's data. - /// - public uint FirstDataBlockIndex; - - /// - /// The next block entry in the series. (N/A if == BlockCount.) - /// - public uint NextBlockEntryIndex; - - /// - /// The previous block entry in the series. (N/A if == BlockCount.) - /// - public uint PreviousBlockEntryIndex; - - /// - /// The offset of the block entry in the directory. - /// - public uint DirectoryIndex; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/BlockEntryHeader.cs b/BinaryObjectScanner.Models/GCF/BlockEntryHeader.cs deleted file mode 100644 index d493685a..00000000 --- a/BinaryObjectScanner.Models/GCF/BlockEntryHeader.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class BlockEntryHeader - { - /// - /// Number of data blocks. - /// - public uint BlockCount; - - /// - /// Number of data blocks that point to data. - /// - public uint BlocksUsed; - - /// - /// Reserved - /// - public uint Dummy0; - - /// - /// Reserved - /// - public uint Dummy1; - - /// - /// Reserved - /// - public uint Dummy2; - - /// - /// Reserved - /// - public uint Dummy3; - - /// - /// Reserved - /// - public uint Dummy4; - - /// - /// Header checksum. - /// - public uint Checksum; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/BlockEntryMap.cs b/BinaryObjectScanner.Models/GCF/BlockEntryMap.cs deleted file mode 100644 index f57ec928..00000000 --- a/BinaryObjectScanner.Models/GCF/BlockEntryMap.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - /// Part of version 5 but not version 6. - /// - /// - public sealed class BlockEntryMap - { - /// - /// The previous block entry. (N/A if == BlockCount.) - /// - public uint PreviousBlockEntryIndex; - - /// - /// The next block entry. (N/A if == BlockCount.) - /// - public uint NextBlockEntryIndex; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/BlockEntryMapHeader.cs b/BinaryObjectScanner.Models/GCF/BlockEntryMapHeader.cs deleted file mode 100644 index ca47f6c5..00000000 --- a/BinaryObjectScanner.Models/GCF/BlockEntryMapHeader.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - /// Part of version 5 but not version 6. - /// - /// - public sealed class BlockEntryMapHeader - { - /// - /// Number of data blocks. - /// - public uint BlockCount; - - /// - /// Index of the first block entry. - /// - public uint FirstBlockEntryIndex; - - /// - /// Index of the last block entry. - /// - public uint LastBlockEntryIndex; - - /// - /// Reserved - /// - public uint Dummy0; - - /// - /// Header checksum. - /// - public uint Checksum; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/ChecksumEntry.cs b/BinaryObjectScanner.Models/GCF/ChecksumEntry.cs deleted file mode 100644 index d570ed2b..00000000 --- a/BinaryObjectScanner.Models/GCF/ChecksumEntry.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class ChecksumEntry - { - /// - /// Checksum. - /// - public uint Checksum; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/ChecksumHeader.cs b/BinaryObjectScanner.Models/GCF/ChecksumHeader.cs deleted file mode 100644 index 81bb016c..00000000 --- a/BinaryObjectScanner.Models/GCF/ChecksumHeader.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class ChecksumHeader - { - /// - /// Always 0x00000001 - /// - public uint Dummy0; - - /// - /// Size of LPGCFCHECKSUMHEADER & LPGCFCHECKSUMMAPHEADER & in bytes. - /// - public uint ChecksumSize; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/ChecksumMapEntry.cs b/BinaryObjectScanner.Models/GCF/ChecksumMapEntry.cs deleted file mode 100644 index b1f52310..00000000 --- a/BinaryObjectScanner.Models/GCF/ChecksumMapEntry.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class ChecksumMapEntry - { - /// - /// Number of checksums. - /// - public uint ChecksumCount; - - /// - /// Index of first checksum. - /// - public uint FirstChecksumIndex; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/ChecksumMapHeader.cs b/BinaryObjectScanner.Models/GCF/ChecksumMapHeader.cs deleted file mode 100644 index 013ce66b..00000000 --- a/BinaryObjectScanner.Models/GCF/ChecksumMapHeader.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class ChecksumMapHeader - { - /// - /// Always 0x14893721 - /// - public uint Dummy0; - - /// - /// Always 0x00000001 - /// - public uint Dummy1; - - /// - /// Number of items. - /// - public uint ItemCount; - - /// - /// Number of checksums. - /// - public uint ChecksumCount; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/Constants.cs b/BinaryObjectScanner.Models/GCF/Constants.cs deleted file mode 100644 index d64f6cf4..00000000 --- a/BinaryObjectScanner.Models/GCF/Constants.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - public static class Constants - { - /// - /// The maximum data allowed in a 32 bit checksum. - /// - public const int HL_GCF_CHECKSUM_LENGTH = 0x00008000; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/DataBlockHeader.cs b/BinaryObjectScanner.Models/GCF/DataBlockHeader.cs deleted file mode 100644 index b2ccc0b7..00000000 --- a/BinaryObjectScanner.Models/GCF/DataBlockHeader.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class DataBlockHeader - { - /// - /// GCF file version. This field is not part of all file versions. - /// - public uint LastVersionPlayed; - - /// - /// Number of data blocks. - /// - public uint BlockCount; - - /// - /// Size of each data block in bytes. - /// - public uint BlockSize; - - /// - /// Offset to first data block. - /// - public uint FirstBlockOffset; - - /// - /// Number of data blocks that contain data. - /// - public uint BlocksUsed; - - /// - /// Header checksum. - /// - public uint Checksum; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/DirectoryCopyEntry.cs b/BinaryObjectScanner.Models/GCF/DirectoryCopyEntry.cs deleted file mode 100644 index 1b1b79e8..00000000 --- a/BinaryObjectScanner.Models/GCF/DirectoryCopyEntry.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class DirectoryCopyEntry - { - /// - /// Index of the directory item. - /// - public uint DirectoryIndex; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/DirectoryEntry.cs b/BinaryObjectScanner.Models/GCF/DirectoryEntry.cs deleted file mode 100644 index 365907e4..00000000 --- a/BinaryObjectScanner.Models/GCF/DirectoryEntry.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class DirectoryEntry - { - /// - /// Offset to the directory item name from the end of the directory items. - /// - public uint NameOffset; - - /// - /// Directory item name from the end of the directory items. - /// - public string Name; - - /// - /// Size of the item. (If file, file size. If folder, num items.) - /// - public uint ItemSize; - - /// - /// Checksome index. (0xFFFFFFFF == None). - /// - public uint ChecksumIndex; - - /// - /// Flags for the directory item. (0x00000000 == Folder). - /// - public HL_GCF_FLAG DirectoryFlags; - - /// - /// Index of the parent directory item. (0xFFFFFFFF == None). - /// - public uint ParentIndex; - - /// - /// Index of the next directory item. (0x00000000 == None). - /// - public uint NextIndex; - - /// - /// Index of the first directory item. (0x00000000 == None). - /// - public uint FirstIndex; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/DirectoryHeader.cs b/BinaryObjectScanner.Models/GCF/DirectoryHeader.cs deleted file mode 100644 index a7856c00..00000000 --- a/BinaryObjectScanner.Models/GCF/DirectoryHeader.cs +++ /dev/null @@ -1,76 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class DirectoryHeader - { - /// - /// Always 0x00000004 - /// - public uint Dummy0; - - /// - /// Cache ID. - /// - public uint CacheID; - - /// - /// GCF file version. - /// - public uint LastVersionPlayed; - - /// - /// Number of items in the directory. - /// - public uint ItemCount; - - /// - /// Number of files in the directory. - /// - public uint FileCount; - - /// - /// Always 0x00008000. Data per checksum? - /// - public uint Dummy1; - - /// - /// Size of lpGCFDirectoryEntries & lpGCFDirectoryNames & lpGCFDirectoryInfo1Entries & lpGCFDirectoryInfo2Entries & lpGCFDirectoryCopyEntries & lpGCFDirectoryLocalEntries in bytes. - /// - public uint DirectorySize; - - /// - /// Size of the directory names in bytes. - /// - public uint NameSize; - - /// - /// Number of Info1 entires. - /// - public uint Info1Count; - - /// - /// Number of files to copy. - /// - public uint CopyCount; - - /// - /// Number of files to keep local. - /// - public uint LocalCount; - - /// - /// Reserved - /// - public uint Dummy2; - - /// - /// Reserved - /// - public uint Dummy3; - - /// - /// Header checksum. - /// - public uint Checksum; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/DirectoryInfo1Entry.cs b/BinaryObjectScanner.Models/GCF/DirectoryInfo1Entry.cs deleted file mode 100644 index d3cb1b22..00000000 --- a/BinaryObjectScanner.Models/GCF/DirectoryInfo1Entry.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class DirectoryInfo1Entry - { - /// - /// Reserved - /// - public uint Dummy0; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/DirectoryInfo2Entry.cs b/BinaryObjectScanner.Models/GCF/DirectoryInfo2Entry.cs deleted file mode 100644 index 6a63c6e4..00000000 --- a/BinaryObjectScanner.Models/GCF/DirectoryInfo2Entry.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class DirectoryInfo2Entry - { - /// - /// Reserved - /// - public uint Dummy0; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/DirectoryLocalEntry.cs b/BinaryObjectScanner.Models/GCF/DirectoryLocalEntry.cs deleted file mode 100644 index 7f0c4e6f..00000000 --- a/BinaryObjectScanner.Models/GCF/DirectoryLocalEntry.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class DirectoryLocalEntry - { - /// - /// Index of the directory item. - /// - public uint DirectoryIndex; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/DirectoryMapEntry.cs b/BinaryObjectScanner.Models/GCF/DirectoryMapEntry.cs deleted file mode 100644 index db7d611f..00000000 --- a/BinaryObjectScanner.Models/GCF/DirectoryMapEntry.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class DirectoryMapEntry - { - /// - /// Index of the first data block. (N/A if == BlockCount.) - /// - public uint FirstBlockIndex; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/DirectoryMapHeader.cs b/BinaryObjectScanner.Models/GCF/DirectoryMapHeader.cs deleted file mode 100644 index 7a3f3331..00000000 --- a/BinaryObjectScanner.Models/GCF/DirectoryMapHeader.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - /// Added in version 4 or version 5. - /// - /// - public sealed class DirectoryMapHeader - { - /// - /// Always 0x00000001 - /// - public uint Dummy0; - - /// - /// Always 0x00000000 - /// - public uint Dummy1; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/Enums.cs b/BinaryObjectScanner.Models/GCF/Enums.cs deleted file mode 100644 index d44d5f73..00000000 --- a/BinaryObjectScanner.Models/GCF/Enums.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.GCF -{ - [Flags] - public enum HL_GCF_FLAG : uint - { - /// - /// Folder - /// - HL_GCF_FLAG_FOLDER = 0x00000000, - - /// - /// Don't overwrite the item if copying it to the disk and the item already exists. - /// - HL_GCF_FLAG_COPY_LOCAL_NO_OVERWRITE = 0x00000001, - - /// - /// The item is to be copied to the disk. - /// - HL_GCF_FLAG_COPY_LOCAL = 0x0000000A, - - /// - /// Backup the item before overwriting it. - /// - HL_GCF_FLAG_BACKUP_LOCAL = 0x00000040, - - /// - /// The item is encrypted. - /// - HL_GCF_FLAG_ENCRYPTED = 0x00000100, - - /// - /// The item is a file. - /// - HL_GCF_FLAG_FILE = 0x00004000, - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/File.cs b/BinaryObjectScanner.Models/GCF/File.cs deleted file mode 100644 index 25db8823..00000000 --- a/BinaryObjectScanner.Models/GCF/File.cs +++ /dev/null @@ -1,118 +0,0 @@ -using System.Collections.Generic; - -namespace BinaryObjectScanner.Models.GCF -{ - /// - /// Half-Life Game Cache File - /// - /// - public sealed class File - { - /// - /// Header data - /// - public Header Header { get; set; } - - /// - /// Block entry header data - /// - public BlockEntryHeader BlockEntryHeader { get; set; } - - /// - /// Block entries data - /// - public BlockEntry[] BlockEntries { get; set; } - - /// - /// Fragmentation map header data - /// - public FragmentationMapHeader FragmentationMapHeader { get; set; } - - /// - /// Fragmentation map data - /// - public FragmentationMap[] FragmentationMaps { get; set; } - - /// - /// Block entry map header data - /// - /// Part of version 5 but not version 6. - public BlockEntryMapHeader BlockEntryMapHeader { get; set; } - - /// - /// Block entry map data - /// - /// Part of version 5 but not version 6. - public BlockEntryMap[] BlockEntryMaps { get; set; } - - /// - /// Directory header data - /// - public DirectoryHeader DirectoryHeader { get; set; } - - /// - /// Directory entries data - /// - public DirectoryEntry[] DirectoryEntries { get; set; } - - /// - /// Directory names data - /// - public Dictionary DirectoryNames { get; set; } - - /// - /// Directory info 1 entries data - /// - public DirectoryInfo1Entry[] DirectoryInfo1Entries { get; set; } - - /// - /// Directory info 2 entries data - /// - public DirectoryInfo2Entry[] DirectoryInfo2Entries { get; set; } - - /// - /// Directory copy entries data - /// - public DirectoryCopyEntry[] DirectoryCopyEntries { get; set; } - - /// - /// Directory local entries data - /// - public DirectoryLocalEntry[] DirectoryLocalEntries { get; set; } - - /// - /// Directory map header data - /// - public DirectoryMapHeader DirectoryMapHeader { get; set; } - - /// - /// Directory map entries data - /// - public DirectoryMapEntry[] DirectoryMapEntries { get; set; } - - /// - /// Checksum header data - /// - public ChecksumHeader ChecksumHeader { get; set; } - - /// - /// Checksum map header data - /// - public ChecksumMapHeader ChecksumMapHeader { get; set; } - - /// - /// Checksum map entries data - /// - public ChecksumMapEntry[] ChecksumMapEntries { get; set; } - - /// - /// Checksum entries data - /// - public ChecksumEntry[] ChecksumEntries { get; set; } - - /// - /// Data block header data - /// - public DataBlockHeader DataBlockHeader { get; set; } - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/FragmentationMap.cs b/BinaryObjectScanner.Models/GCF/FragmentationMap.cs deleted file mode 100644 index b0e1c57b..00000000 --- a/BinaryObjectScanner.Models/GCF/FragmentationMap.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class FragmentationMap - { - /// - /// The index of the next data block. - /// - public uint NextDataBlockIndex; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/FragmentationMapHeader.cs b/BinaryObjectScanner.Models/GCF/FragmentationMapHeader.cs deleted file mode 100644 index ac8a7442..00000000 --- a/BinaryObjectScanner.Models/GCF/FragmentationMapHeader.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class FragmentationMapHeader - { - /// - /// Number of data blocks. - /// - public uint BlockCount; - - /// - /// The index of the first unused fragmentation map entry. - /// - public uint FirstUnusedEntry; - - /// - /// The block entry terminator; 0 = 0x0000ffff or 1 = 0xffffffff. - /// - public uint Terminator; - - /// - /// Header checksum. - /// - public uint Checksum; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/GCF/Header.cs b/BinaryObjectScanner.Models/GCF/Header.cs deleted file mode 100644 index 387d65de..00000000 --- a/BinaryObjectScanner.Models/GCF/Header.cs +++ /dev/null @@ -1,61 +0,0 @@ -namespace BinaryObjectScanner.Models.GCF -{ - /// - public sealed class Header - { - /// - /// Always 0x00000001 - /// - public uint Dummy0; - - /// - /// Always 0x00000001 - /// - public uint MajorVersion; - - /// - /// GCF version number. - /// - public uint MinorVersion; - - /// - /// Cache ID - /// - public uint CacheID; - - /// - /// Last version played - /// - public uint LastVersionPlayed; - - /// - /// Reserved - /// - public uint Dummy1; - - /// - /// Reserved - /// - public uint Dummy2; - - /// - /// Total size of GCF file in bytes. - /// - public uint FileSize; - - /// - /// Size of each data block in bytes. - /// - public uint BlockSize; - - /// - /// Number of data blocks. - /// - public uint BlockCount; - - /// - /// Reserved - /// - public uint Dummy3; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/InstallShieldCabinet/Cabinet.cs b/BinaryObjectScanner.Models/InstallShieldCabinet/Cabinet.cs deleted file mode 100644 index 87a45b4f..00000000 --- a/BinaryObjectScanner.Models/InstallShieldCabinet/Cabinet.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System.Collections.Generic; - -namespace BinaryObjectScanner.Models.InstallShieldCabinet -{ - /// - /// - public sealed class Cabinet - { - #region Headers - - /// - /// Common header - /// - public CommonHeader CommonHeader { get; set; } - - /// - /// Volume header - /// - public VolumeHeader VolumeHeader { get; set; } - - /// - /// Descriptor - /// - public Descriptor Descriptor { get; set; } - - #endregion - - #region File Descriptors - - /// - /// Offsets to all file descriptors - /// - public uint[] FileDescriptorOffsets { get; set; } - - /// - /// Directory names - /// - public string[] DirectoryNames { get; set; } - - /// - /// Standard file descriptors - /// - public FileDescriptor[] FileDescriptors { get; set; } - - #endregion - - #region File Groups - - /// - /// File group offset to offset list mapping - /// - public Dictionary FileGroupOffsets { get; set; } - - /// - /// File groups - /// - public FileGroup[] FileGroups { get; set; } - - #endregion - - #region Components - - /// - /// Component offset to offset list mapping - /// - public Dictionary ComponentOffsets { get; set; } - - /// - /// Components - /// - public Component[] Components { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/InstallShieldCabinet/CommonHeader.cs b/BinaryObjectScanner.Models/InstallShieldCabinet/CommonHeader.cs deleted file mode 100644 index d60063ff..00000000 --- a/BinaryObjectScanner.Models/InstallShieldCabinet/CommonHeader.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace BinaryObjectScanner.Models.InstallShieldCabinet -{ - /// - public sealed class CommonHeader - { - /// - /// "ISc(" - /// - public string Signature; - - /// - /// Encoded version - /// - public uint Version; - - /// - /// Volume information - /// - public uint VolumeInfo; - - /// - /// Offset to cabinet descriptor - /// - public uint DescriptorOffset; - - /// - /// Cabinet descriptor size - /// - public uint DescriptorSize; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/InstallShieldCabinet/Component.cs b/BinaryObjectScanner.Models/InstallShieldCabinet/Component.cs deleted file mode 100644 index 8b393775..00000000 --- a/BinaryObjectScanner.Models/InstallShieldCabinet/Component.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.InstallShieldCabinet -{ - /// - public sealed class Component - { - /// - /// Offset to the component identifier - /// - public uint IdentifierOffset; - - /// - /// Component identifier - /// - public string Identifier; - - /// - /// Offset to the component descriptor - /// - public uint DescriptorOffset; - - /// - /// Offset to the display name - /// - public uint DisplayNameOffset; - - /// - /// Display name - /// - public string DisplayName; - - /// - /// Reserved - /// - public byte[] Reserved0; - - /// - /// Reserved offset - /// - public uint ReservedOffset0; - - /// - /// Reserved offset - /// - public uint ReservedOffset1; - - /// - /// Component index - /// - public ushort ComponentIndex; - - /// - /// Offset to the component name - /// - public uint NameOffset; - - /// - /// Component name - /// - public string Name; - - /// - /// Reserved offset - /// - public uint ReservedOffset2; - - /// - /// Reserved offset - /// - public uint ReservedOffset3; - - /// - /// Reserved offset - /// - public uint ReservedOffset4; - - /// - /// Reserved - /// - public byte[] Reserved1; - - /// - /// Offset to the component CLSID - /// - public uint CLSIDOffset; - - /// - /// Component CLSID - /// - public Guid CLSID; - - /// - /// Reserved - /// - public byte[] Reserved2; - - /// - /// Reserved - /// - public byte[] Reserved3; - - /// - /// Number of depends(?) - /// - public ushort DependsCount; - - /// - /// Offset to depends(?) - /// - public uint DependsOffset; - - /// - /// Number of file groups - /// - public uint FileGroupCount; - - /// - /// Offset to the file group names - /// - public uint FileGroupNamesOffset; - - /// - /// File group names - /// - public string[] FileGroupNames; - - /// - /// Number of X3(?) - /// - public ushort X3Count; - - /// - /// Offset to X3(?) - /// - public uint X3Offset; - - /// - /// Number of sub-components - /// - public ushort SubComponentsCount; - - /// - /// Offset to the sub-components - /// - public uint SubComponentsOffset; - - /// - /// Offset to the next component - /// - public uint NextComponentOffset; - - /// - /// Reserved offset - /// - public uint ReservedOffset5; - - /// - /// Reserved offset - /// - public uint ReservedOffset6; - - /// - /// Reserved offset - /// - public uint ReservedOffset7; - - /// - /// Reserved offset - /// - public uint ReservedOffset8; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/InstallShieldCabinet/Constants.cs b/BinaryObjectScanner.Models/InstallShieldCabinet/Constants.cs deleted file mode 100644 index 50bc4943..00000000 --- a/BinaryObjectScanner.Models/InstallShieldCabinet/Constants.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace BinaryObjectScanner.Models.InstallShieldCabinet -{ - public static class Constants - { - public static readonly byte[] SignatureBytes = new byte[] { 0x49, 0x53, 0x63, 0x28 }; - - public const string SignatureString = "ISc("; - - public const uint SignatureUInt32 = 0x28635349; - - public const int COMMON_HEADER_SIZE = 20; - - public const int VOLUME_HEADER_SIZE_V5 = 40; - - public const int VOLUME_HEADER_SIZE_V6 = 64; - - // TODO: Determine how the value "71" was chosen here - public const int MAX_FILE_GROUP_COUNT = 71; - - // TODO: Determine how the value "71" was chosen here - public const int MAX_COMPONENT_COUNT = 71; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/InstallShieldCabinet/Descriptor.cs b/BinaryObjectScanner.Models/InstallShieldCabinet/Descriptor.cs deleted file mode 100644 index cb49d8ef..00000000 --- a/BinaryObjectScanner.Models/InstallShieldCabinet/Descriptor.cs +++ /dev/null @@ -1,121 +0,0 @@ -namespace BinaryObjectScanner.Models.InstallShieldCabinet -{ - /// - public sealed class Descriptor - { - /// - /// Offset to the descriptor strings - /// - public uint StringsOffset; - - /// - /// Reserved - /// - public byte[] Reserved0; - - /// - /// Offset to the component list - /// - public uint ComponentListOffset; - - /// - /// Offset to the file table - /// - public uint FileTableOffset; - - /// - /// Reserved - /// - public byte[] Reserved1; - - /// - /// Size of the file table - /// - public uint FileTableSize; - - /// - /// Redundant size of the file table - /// - public uint FileTableSize2; - - /// - /// Number of directories - /// - public ushort DirectoryCount; - - /// - /// Reserved - /// - public byte[] Reserved2; - - /// - /// Reserved - /// - public byte[] Reserved3; - - /// - /// Reserved - /// - public byte[] Reserved4; - - /// - /// Number of files - /// - public uint FileCount; - - /// - /// Redundant offset to the file table - /// - public uint FileTableOffset2; - - /// - /// Number of component table infos - /// - public ushort ComponentTableInfoCount; - - /// - /// Offset to the component table - /// - public uint ComponentTableOffset; - - /// - /// Reserved - /// - public byte[] Reserved5; - - /// - /// Reserved - /// - public byte[] Reserved6; - - /// - /// Offsets to the file groups - /// - public uint[] FileGroupOffsets; - - /// - /// Offsets to the components - /// - public uint[] ComponentOffsets; - - /// - /// Offset to the setup types - /// - public uint SetupTypesOffset; - - /// - /// Offset to the setup table - /// - public uint SetupTableOffset; - - /// - /// Reserved - /// - public byte[] Reserved7; - - /// - /// Reserved - /// - public byte[] Reserved8; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/InstallShieldCabinet/Enums.cs b/BinaryObjectScanner.Models/InstallShieldCabinet/Enums.cs deleted file mode 100644 index de45cd1d..00000000 --- a/BinaryObjectScanner.Models/InstallShieldCabinet/Enums.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.InstallShieldCabinet -{ - /// - [Flags] - public enum FileFlags : ushort - { - FILE_SPLIT = 1, - FILE_OBFUSCATED = 2, - FILE_COMPRESSED = 4, - FILE_INVALID = 8, - } - - /// - public enum LinkFlags : byte - { - LINK_NONE = 0, - LINK_PREV = 1, - LINK_NEXT = 2, - LINK_BOTH = 3, - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/InstallShieldCabinet/FileDescriptor.cs b/BinaryObjectScanner.Models/InstallShieldCabinet/FileDescriptor.cs deleted file mode 100644 index 3a1dc2f0..00000000 --- a/BinaryObjectScanner.Models/InstallShieldCabinet/FileDescriptor.cs +++ /dev/null @@ -1,66 +0,0 @@ -namespace BinaryObjectScanner.Models.InstallShieldCabinet -{ - /// - public sealed class FileDescriptor - { - /// - /// Offset to the file descriptor name - /// - public uint NameOffset; - - /// - /// File descriptor name - /// - public string Name; - - /// - /// Directory index - /// - public uint DirectoryIndex; - - /// - /// File flags - /// - public FileFlags Flags; - - /// - /// Size of the entry when expanded - /// - public ulong ExpandedSize; - - /// - /// Size of the entry when compressed - /// - public ulong CompressedSize; - - /// - /// Offset to the entry data - /// - public ulong DataOffset; - - /// - /// MD5 of the entry data - /// - public byte[] MD5; - - /// - /// Volume number - /// - public ushort Volume; - - /// - /// Link previous - /// - public uint LinkPrevious; - - /// - /// Link next - /// - public uint LinkNext; - - /// - /// Link flags - /// - public LinkFlags LinkFlags; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/InstallShieldCabinet/FileGroup.cs b/BinaryObjectScanner.Models/InstallShieldCabinet/FileGroup.cs deleted file mode 100644 index b2574d36..00000000 --- a/BinaryObjectScanner.Models/InstallShieldCabinet/FileGroup.cs +++ /dev/null @@ -1,126 +0,0 @@ -namespace BinaryObjectScanner.Models.InstallShieldCabinet -{ - /// - public sealed class FileGroup - { - /// - /// Offset to the file group name - /// - public uint NameOffset; - - /// - /// File group name - /// - public string Name; - - /// - /// Size of the expanded data - /// - public uint ExpandedSize; - - /// - /// Reserved - /// - public byte[] Reserved0; - - /// - /// Size of the compressed data - /// - public uint CompressedSize; - - /// - /// Reserved - /// - public byte[] Reserved1; - - /// - /// Reserved - /// - public byte[] Reserved2; - - /// - /// Attribute(?) - /// - public ushort Attribute1; - - /// - /// Attribute(?) - /// - public ushort Attribute2; - - /// - /// Index of the first file - /// - public uint FirstFile; - - /// - /// Index of the last file - /// - public uint LastFile; - - /// - /// Unknown offset(?) - /// - public uint UnknownOffset; - - /// - /// Var 4 offset(?) - /// - public uint Var4Offset; - - /// - /// Var 1 offset(?) - /// - public uint Var1Offset; - - /// - /// Offset to the HTTP location - /// - public uint HTTPLocationOffset; - - /// - /// Offset to the FTP location - /// - public uint FTPLocationOffset; - - /// - /// Misc offset(?) - /// - public uint MiscOffset; - - /// - /// Var 2 offset(?) - /// - public uint Var2Offset; - - /// - /// Offset to the target directory - /// - public uint TargetDirectoryOffset; - - /// - /// Reserved - /// - public byte[] Reserved3; - - /// - /// Reserved - /// - public byte[] Reserved4; - - /// - /// Reserved - /// - public byte[] Reserved5; - - /// - /// Reserved - /// - public byte[] Reserved6; - - /// - /// Reserved - /// - public byte[] Reserved7; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/InstallShieldCabinet/OffsetList.cs b/BinaryObjectScanner.Models/InstallShieldCabinet/OffsetList.cs deleted file mode 100644 index 3dc7f800..00000000 --- a/BinaryObjectScanner.Models/InstallShieldCabinet/OffsetList.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace BinaryObjectScanner.Models.InstallShieldCabinet -{ - /// - public sealed class OffsetList - { - public uint NameOffset; - - public string Name; - - public uint DescriptorOffset; - - public uint NextOffset; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/InstallShieldCabinet/VolumeHeader.cs b/BinaryObjectScanner.Models/InstallShieldCabinet/VolumeHeader.cs deleted file mode 100644 index f787fd8d..00000000 --- a/BinaryObjectScanner.Models/InstallShieldCabinet/VolumeHeader.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace BinaryObjectScanner.Models.InstallShieldCabinet -{ - /// - /// TODO: Should standard and high values be combined? - public sealed class VolumeHeader - { - public uint DataOffset; - - public uint DataOffsetHigh; - - public uint FirstFileIndex; - - public uint LastFileIndex; - - public uint FirstFileOffset; - - public uint FirstFileOffsetHigh; - - public uint FirstFileSizeExpanded; - - public uint FirstFileSizeExpandedHigh; - - public uint FirstFileSizeCompressed; - - public uint FirstFileSizeCompressedHigh; - - public uint LastFileOffset; - - public uint LastFileOffsetHigh; - - public uint LastFileSizeExpanded; - - public uint LastFileSizeExpandedHigh; - - public uint LastFileSizeCompressed; - - public uint LastFileSizeCompressedHigh; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/LinearExecutable/Constants.cs b/BinaryObjectScanner.Models/LinearExecutable/Constants.cs deleted file mode 100644 index 41e95333..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/Constants.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace BinaryObjectScanner.Models.LinearExecutable -{ - public static class Constants - { - public static readonly byte[] DebugInformationSignatureBytes = new byte[] { 0x4e, 0x42, 0x30 }; - - public const string DebugInformationSignatureString = "NB0"; - - public static readonly byte[] LESignatureBytes = new byte[] { 0x4c, 0x45 }; - - public const string LESignatureString = "LE"; - - public const ushort LESignatureUInt16 = 0x454c; - - public static readonly byte[] LXSignatureBytes = new byte[] { 0x4c, 0x58 }; - - public const string LXSignatureString = "LX"; - - public const ushort LXSignatureUInt16 = 0x584c; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/LinearExecutable/DebugInformation.cs b/BinaryObjectScanner.Models/LinearExecutable/DebugInformation.cs deleted file mode 100644 index 89a736c7..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/DebugInformation.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The debug information is defined by the debugger and is not controlled by - /// the linear EXE format or linker. The only data defined by the linear EXE - /// format relative to the debug information is it's offset in the EXE file and - /// length in bytes as defined in the linear EXE header. - /// - /// To support multiple debuggers the first word of the debug information is a - /// type field which determines the format of the debug information. - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class DebugInformation - { - /// - /// The signature consists of a string of three (3) ASCII characters: "NB0" - /// - public string Signature; - - /// - /// This defines the type of debugger data that exists in the remainder of the - /// debug information. - /// - public DebugFormatType FormatType; - - /// - /// The format of the debugger data is defined by the debugger that is being used. - /// The values defined for the type field are not enforced by the system. It is - /// the responsibility of the linker or debugging tools to follow the convention - /// for the type field that is defined here. - /// - public byte[] DebuggerData; - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/EntryTableBundle.cs b/BinaryObjectScanner.Models/LinearExecutable/EntryTableBundle.cs deleted file mode 100644 index a04eef6b..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/EntryTableBundle.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The entry table contains object and offset information that is used to resolve - /// fixup references to the entry points within this module. Not all entry points - /// in the entry table will be exported, some entry points will only be used - /// within the module. An ordinal number is used to index into the entry table. - /// The entry table entries are numbered starting from one. - /// - /// The list of entries are compressed into 'bundles', where possible. The entries - /// within each bundle are all the same size. A bundle starts with a count field - /// which indicates the number of entries in the bundle. The count is followed by - /// a type field which identifies the bundle format. This provides both a means - /// for saving space as well as a mechanism for extending the bundle types. - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class EntryTableBundle - { - /// - /// Number of entries. - /// - /// - /// This is the number of entries in this bundle. - /// - /// A zero value for the number of entries identifies the end of the - /// entry table. There is no further bundle information when the number - /// of entries is zero. In other words the entry table is terminated by - /// a single zero byte. - /// - /// For , this is the number of unused - /// entries to skip. - /// For , this is the number of 16-bit - /// entries in this bundle. The flags and offset value are repeated this - /// number of times. - /// For , this is the number - /// of 286 call gate entries in this bundle. The flags, callgate, and offset - /// value are repeated this number of times. - /// For , this is the number - /// of 32-bit entries in this bundle. The flags and offset value are repeated - /// this number of times. - /// For , this field is reserved for future use. - /// - public byte Entries; - - /// - /// This defines the bundle type which determines the contents of the BUNDLE INFO. - /// - public BundleType BundleType; - - /// - /// Table entries in the bundle - /// - public EntryTableEntry[] TableEntries; - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/EntryTableEntry.cs b/BinaryObjectScanner.Models/LinearExecutable/EntryTableEntry.cs deleted file mode 100644 index d3c146d5..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/EntryTableEntry.cs +++ /dev/null @@ -1,190 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// - [StructLayout(LayoutKind.Explicit)] - public sealed class EntryTableEntry - { - #region 16-bit Entry - - /// - /// Object number. - /// - /// - /// This is the object number for the entries in this bundle. - /// - [FieldOffset(0)] public ushort SixteenBitObjectNumber; - - /// - /// Entry flags. - /// - /// - /// These are the flags for this entry point. - /// - [FieldOffset(2)] public EntryFlags SixteenBitEntryFlags; - - /// - /// Offset in object. - /// - /// - /// This is the offset in the object for the entry point defined at this ordinal number. - /// - [FieldOffset(3)] public ushort SixteenBitOffset; - - #endregion - - #region 286 Call Gate Entry - - /// - /// Object number. - /// - /// - /// This is the object number for the entries in this bundle. - /// - [FieldOffset(0)] public ushort TwoEightySixObjectNumber; - - /// - /// Entry flags. - /// - /// - /// These are the flags for this entry point. - /// - [FieldOffset(2)] public EntryFlags TwoEightySixEntryFlags; - - /// - /// Offset in object. - /// - /// - /// This is the offset in the object for the entry point defined at this ordinal number. - /// - [FieldOffset(3)] public ushort TwoEightySixOffset; - - /// - /// Callgate selector. - /// - /// - /// The callgate selector is a reserved field used by the loader to store a call - /// gate selector value for references to ring 2 entry points. When a ring 3 - /// reference to a ring 2 entry point is made, the callgate selector with a zero - /// offset is place in the relocation fixup address. The segment number and offset - /// in segment is placed in the LDT callgate. - /// - [FieldOffset(5)] public ushort TwoEightySixCallgate; - - #endregion - - #region 32-bit Entry - - /// - /// Object number. - /// - /// - /// This is the object number for the entries in this bundle. - /// - [FieldOffset(0)] public ushort ThirtyTwoBitObjectNumber; - - /// - /// Entry flags. - /// - /// - /// These are the flags for this entry point. - /// - [FieldOffset(2)] public EntryFlags ThirtyTwoBitEntryFlags; - - /// - /// Offset in object. - /// - /// - /// This is the offset in the object for the entry point defined at this ordinal number. - /// - [FieldOffset(3)] public uint ThirtyTwoBitOffset; - - #endregion - - #region Forwarder Entry - - /// - /// 0 - /// - /// - /// This field is reserved for future use. - /// - [FieldOffset(0)] public ushort ForwarderReserved; - - /// - /// Forwarder flags. - /// - /// - /// These are the flags for this entry point. - /// - [FieldOffset(2)] public ForwarderFlags ForwarderFlags; - - /// - /// Module Ordinal Number - /// - /// - /// This is the index into the Import Module Name Table for this forwarder. - /// - [FieldOffset(3)] public ushort ForwarderModuleOrdinalNumber; - - /// - /// Procedure Name Offset - /// - /// - /// If the FLAGS field indicates import by ordinal, then this field is the - /// ordinal number into the Entry Table of the target module, otherwise this - /// field is the offset into the Procedure Names Table of the target module. - /// - /// A Forwarder entry (type = 4) is an entry point whose value is an imported - /// reference. When a load time fixup occurs whose target is a forwarder, the - /// loader obtains the address imported by the forwarder and uses that imported - /// address to resolve the fixup. - /// - /// A forwarder may refer to an entry point in another module which is itself a - /// forwarder, so there can be a chain of forwarders. The loader will traverse - /// the chain until it finds a non-forwarded entry point which terminates the - /// chain, and use this to resolve the original fixup. Circular chains are - /// detected by the loader and result in a load time error. A maximum of 1024 - /// forwarders is allowed in a chain; more than this results in a load time error. - /// - /// Forwarders are useful for merging and recombining API calls into different - /// sets of libraries, while maintaining compatibility with applications. For - /// example, if one wanted to combine MONCALLS, MOUCALLS, and VIOCALLS into a - /// single libraries, one could provide entry points for the three libraries - /// that are forwarders pointing to the common implementation. - /// - [FieldOffset(5)] public uint ProcedureNameOffset; - - /// - /// Import Ordinal Number - /// - /// - /// If the FLAGS field indicates import by ordinal, then this field is the - /// ordinal number into the Entry Table of the target module, otherwise this - /// field is the offset into the Procedure Names Table of the target module. - /// - /// A Forwarder entry (type = 4) is an entry point whose value is an imported - /// reference. When a load time fixup occurs whose target is a forwarder, the - /// loader obtains the address imported by the forwarder and uses that imported - /// address to resolve the fixup. - /// - /// A forwarder may refer to an entry point in another module which is itself a - /// forwarder, so there can be a chain of forwarders. The loader will traverse - /// the chain until it finds a non-forwarded entry point which terminates the - /// chain, and use this to resolve the original fixup. Circular chains are - /// detected by the loader and result in a load time error. A maximum of 1024 - /// forwarders is allowed in a chain; more than this results in a load time error. - /// - /// Forwarders are useful for merging and recombining API calls into different - /// sets of libraries, while maintaining compatibility with applications. For - /// example, if one wanted to combine MONCALLS, MOUCALLS, and VIOCALLS into a - /// single libraries, one could provide entry points for the three libraries - /// that are forwarders pointing to the common implementation. - /// - [FieldOffset(5)] public uint ImportOrdinalNumber; - - #endregion - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/LinearExecutable/Enums.cs b/BinaryObjectScanner.Models/LinearExecutable/Enums.cs deleted file mode 100644 index 1683000c..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/Enums.cs +++ /dev/null @@ -1,680 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - [Flags] - public enum BundleType : byte - { - /// - /// Unused Entry. - /// - UnusedEntry = 0x00, - - /// - /// 16-bit Entry. - /// - SixteenBitEntry = 0x01, - - /// - /// 286 Call Gate Entry. - /// - TwoEightySixCallGateEntry = 0x02, - - /// - /// 32-bit Entry. - /// - ThirtyTwoBitEntry = 0x03, - - /// - /// Forwarder Entry. - /// - ForwarderEntry = 0x04, - - /// - /// Parameter Typing Information Present. - /// - /// - /// This bit signifies that additional information is contained in the - /// linear EXE module and will be used in the future for parameter type checking. - /// - ParameterTypingInformationPresent = 0x80, - } - - public enum ByteOrder : byte - { - /// - /// little-endian - /// - LE = 0x00, - - /// - /// big-endian - /// - /// non-zero - BE = 0x01, - } - - public enum CPUType : ushort - { - /// - /// Intel 80286 or upwardly compatible - /// - Intel80286 = 0x01, - - /// - /// Intel 80386 or upwardly compatible - /// - Intel80386 = 0x02, - - /// - /// Intel 80486 or upwardly compatible - /// - Intel80486 = 0x03, - - /// - /// Intel 80586 or upwardly compatible - /// - Intel80586 = 0x04, - - /// - /// Intel i860 (N10) or compatible - /// - Inteli860 = 0x20, - - /// - /// Intel "N11" or compatible - /// - IntelN11 = 0x21, - - /// - /// MIPS Mark I (R2000, R3000) or compatible - /// - MIPSMarkI = 0x40, - - /// - /// MIPS Mark II ( R6000 ) or compatible - /// - MIPSMarkII = 0x41, - - /// - /// MIPS Mark III ( R4000 ) or compatible - /// - MIPSMarkIII = 0x42, - } - - public enum DebugFormatType : byte - { - /// - /// 32-bit CodeView debugger format. - /// - CodeView32Bit = 0x00, - - /// - /// AIX debugger format. - /// - AIXDebugger = 0x01, - - /// - /// 16-bit CodeView debugger format. - /// - CodeView16Bit = 0x02, - - /// - /// 32-bit OS/2 PM debugger (IBM) format. - /// - OS2PM32Bit = 0x04, - } - - public enum DirectiveNumber : ushort - { - /// - /// Resident Flag Mask. - /// - /// - /// Directive numbers with this bit set indicate that the directive data - /// is in the resident area and will be kept resident in memory when the - /// module is loaded. - /// - ResidentFlagMask = 0x8000, - - /// - /// Verify Record Directive. (Verify record is a resident table.) - /// - VerifyRecordDirective = 0x8001, - - /// - /// Language Information Directive. (This is a non-resident table.) - /// - LanguageInformationDirective = 0x0002, - - /// - /// Co-Processor Required Support Table. - /// - CoProcessorRequiredSupportTable = 0x0003, - - /// - /// Thread State Initialization Directive. - /// - ThreadStateInitializationDirective = 0x0004, - - // Additional directives can be added as needed in the future, as long as - // they do not overlap previously defined directive numbers. - } - - [Flags] - public enum EntryFlags : byte - { - /// - /// Exported entry flag. - /// - ExportedEntry = 0x01, - - /// - /// Parameter word count mask. - /// - ParameterWordCountMask = 0xF8, - } - - [Flags] - public enum FixupRecordSourceType : byte - { - /// - /// Source mask. - /// - SourceMask = 0x0F, - - /// - /// Byte fixup (8-bits). - /// - ByteFixup = 0x00, - - /// - /// (undefined). - /// - Undefined1 = 0x01, - - /// - /// 16-bit Selector fixup (16-bits). - /// - SixteenBitSelectorFixup = 0x02, - - /// - /// 16:16 Pointer fixup (32-bits). - /// - SixteenSixteenPointerFixup = 0x03, - - /// - /// (undefined). - /// - Undefined4 = 0x04, - - /// - /// 16-bit Offset fixup (16-bits). - /// - SixteenBitOffsetFixup = 0x05, - - /// - /// 16:32 Pointer fixup (48-bits). - /// - SixteenThirtyTwoPointerFixup = 0x06, - - /// - /// 32-bit Offset fixup (32-bits). - /// - ThirtyTwoBitOffsetFixup = 0x07, - - /// - /// 32-bit Self-relative offset fixup (32-bits). - /// - ThirtyTwoBitSelfRelativeOffsetFixup = 0x08, - - /// - /// Fixup to Alias Flag. - /// - /// - /// When the 'Fixup to Alias' Flag is set, the source fixup refers to - /// the 16:16 alias for the object. This is only valid for source types - /// of 2, 3, and 6. For fixups such as this, the linker and loader will - /// be required to perform additional checks such as ensuring that the - /// target offset for this fixup is less than 64K. - /// - FixupToAliasFlag = 0x10, - - /// - /// Source List Flag. - /// - /// - /// When the 'Source List' Flag is set, the SRCOFF field is compressed - /// to a byte and contains the number of source offsets, and a list of source - /// offsets follows the end of fixup record (after the optional additive value). - /// - SourceListFlag = 0x20, - } - - [Flags] - public enum FixupRecordTargetFlags : byte - { - /// - /// Fixup target type mask. - /// - FixupTargetTypeMask = 0x03, - - /// - /// Internal reference. - /// - InternalReference = 0x00, - - /// - /// Imported reference by ordinal. - /// - ImportedReferenceByOrdinal = 0x01, - - /// - /// Imported reference by name. - /// - ImportedReferenceByName = 0x02, - - /// - /// Internal reference via entry table. - /// - InternalReferenceViaEntryTable = 0x03, - - /// - /// Additive Fixup Flag. - /// - /// - /// When set, an additive value trails the fixup record (before the optional - /// source offset list). - /// - AdditiveFixupFlag = 0x04, - - /// - /// Reserved. Must be zero. - /// - Reserved = 0x08, - - /// - /// 32-bit Target Offset Flag. - /// - /// - /// When set, the target offset is 32-bits, otherwise it is 16-bits. - /// - ThirtyTwoBitTargetOffsetFlag = 0x10, - - /// - /// 32-bit Additive Fixup Flag. - /// - /// When set, the additive value is 32-bits, otherwise it is 16-bits. - /// - ThirtyTwoBitAdditiveFixupFlag = 0x20, - - /// - /// 16-bit Object Number/Module Ordinal Flag. - /// - /// - /// When set, the object number or module ordinal number is 16-bits, - /// otherwise it is 8-bits. - /// - SixteenBitObjectNumberModuleOrdinalFlag = 0x40, - - /// - /// 8-bit Ordinal Flag. - /// - /// - /// When set, the ordinal number is 8-bits, otherwise it is 16-bits. - /// - EightBitOrdinalFlag = 0x80, - } - - [Flags] - public enum ForwarderFlags : byte - { - /// - /// Import by ordinal. - /// - ImportByOrdinal = 0x01, - - /// - /// Reserved for future use; should be zero. - /// - Reserved = 0xF7, - } - - [Flags] - public enum ModuleFlags : uint - { - /// - /// Reserved for system use. - /// - Reserved0 = 0x00000001, - - /// - /// Reserved for system use. - /// - Reserved1 = 0x00000002, - - /// - /// Per-Process Library Initialization. - /// - /// - /// The setting of this bit requires the EIP Object # and EIP fields - /// to have valid values. If the EIP Object # and EIP fields are - /// valid and this bit is NOT set, then Global Library Initialization - /// is assumed. Setting this bit for an EXE file is invalid. - /// - Initialization = 0x00000004, - - /// - /// Reserved for system use. - /// - Reserved3 = 0x00000008, - - /// - /// Internal fixups for the module have been applied. - /// - /// - /// The setting of this bit in a Linear Executable Module indicates that - /// each object of the module has a preferred load address specified in - /// the Object Table Reloc Base Addr. If the module's objects can not be - /// loaded at these preferred addresses, then the relocation records that - /// have been retained in the file data will be applied. - /// - InternalFixupsApplied = 0x00000010, - - /// - /// External fixups for the module have been applied. - /// - ExternalFixupsApplied = 0x00000020, - - /// - /// Reserved for system use. - /// - Reserved6 = 0x00000040, - - /// - /// Reserved for system use. - /// - Reserved7 = 0x00000080, - - /// - /// Incompatible with PM windowing. - /// - IncompatibleWithPMWindowing = 0x00000100, - - /// - /// Incompatible with PM windowing. - /// - CompatibleWithPMWindowing = 0x00000200, - - /// - /// Uses PM windowing API. - /// - UsesPMWindowing = 0x00000300, - - /// - /// Reserved for system use. - /// - Reserved10 = 0x00000400, - - /// - /// Reserved for system use. - /// - Reserved11 = 0x00000800, - - /// - /// Reserved for system use. - /// - Reserved12 = 0x00001000, - - /// - /// Module is not loadable. - /// - /// - /// When the 'Module is not loadable' flag is set, it indicates that - /// either errors were detected at link time or that the module is - /// being incrementally linked and therefore can't be loaded. - /// - ModuleNotLoadable = 0x00002000, - - /// - /// Reserved for system use. - /// - Reserved14 = 0x00004000, - - /// - /// Module type mask. - /// - ModuleTypeMask = 0x00038000, - - /// - /// Program module. - /// - /// - /// A module can not contain dynamic links to other modules that have - /// the 'program module' type. - /// - ProgramModule = 0x00000000, - - /// - /// Library module. - /// - LibraryModule = 0x00008000, - - /// - /// Protected Memory Library module. - /// - ProtectedMemoryLibraryModule = 0x00018000, - - /// - /// Physical Device Driver module. - /// - PhysicalDeviceDriverModule = 0x00020000, - - /// - /// Virtual Device Driver module. - /// - VirtualDeviceDriverModule = 0x00028000, - - /// - /// Per-process Library Termination. - /// - /// - /// The setting of this bit requires the EIP Object # and EIP fields - /// to have valid values. If the EIP Object # and EIP fields are - /// valid and this bit is NOT set, then Global Library Termination - /// is assumed. Setting this bit for an EXE file is invalid. - /// - PerProcessLibraryTermination = 0x40000000, - } - - [Flags] - public enum ObjectFlags : ushort - { - /// - /// Readable Object. - /// - ReadableObject = 0x0001, - - /// - /// Writable Object. - /// - WritableObject = 0x0002, - - /// - /// Executable Object. - /// - ExecutableObject = 0x0004, - - // The readable, writable and executable flags provide support for all possible - // protections. In systems where all of these protections are not supported, - // the loader will be responsible for making the appropriate protection match - // for the system. - - /// - /// Resource Object. - /// - ResourceObject = 0x0008, - - /// - /// Discardable Object. - /// - DiscardableObject = 0x0010, - - /// - /// Object is Shared. - /// - Shared = 0x0020, - - /// - /// Object has Preload Pages. - /// - HasPreloadPages = 0x0040, - - /// - /// Object has Invalid Pages. - /// - HasInvalidPages = 0x0080, - - /// - /// Object has Zero Filled Pages. - /// - HasZeroFilledPages = 0x0100, - - /// - /// Object is Resident (valid for VDDs, PDDs only). - /// - Resident = 0x0200, - - /// - /// Object is Resident & Contiguous (VDDs, PDDs only). - /// - ResidentAndContiguous = 0x0300, - - /// - /// Object is Resident & 'long-lockable' (VDDs, PDDs only). - /// - ResidentAndLongLockable = 0x0400, - - /// - /// Reserved for system use. - /// - Reserved = 0x0800, - - /// - /// 16:16 Alias Required (80x86 Specific). - /// - AliasRequired = 0x1000, - - /// - /// Big/Default Bit Setting (80x86 Specific). - /// - BitSetting = 0x2000, - - // The 'big/default' bit, for data segments, controls the setting of the - // Big bit in the segment descriptor. (The Big bit, or B-bit, determines - // whether ESP or SP is used as the stack pointer.) For code segments, - // this bit controls the setting of the Default bit in the segment - // descriptor. (The Default bit, or D-bit, determines whether the default - // word size is 32-bits or 16-bits. It also affects the interpretation of - // the instruction stream.) - - /// - /// Object is conforming for code (80x86 Specific). - /// - Conforming = 0x4000, - - /// - /// Object I/O privilege level (80x86 Specific). Only used for 16:16 Alias Objects. - /// - PrivilegeLevel = 0x8000, - } - - [Flags] - public enum ObjectPageFlags : ushort - { - /// - /// Legal Physical Page in the module (Offset from Preload Page Section). - /// - LegalPhysicalPage = 0x0000, - - /// - /// Iterated Data Page (Offset from Iterated Data Pages Section). - /// - IteratedDataPage = 0x0001, - - /// - /// Invalid Page (zero). - /// - InvalidPage = 0x0002, - - /// - /// Zero Filled Page (zero). - /// - ZeroFilledPage = 0x0003, - - /// - /// Range of Pages. - /// - RangeOfPages = 0x0004, - } - - public enum OperatingSystem : ushort - { - /// - /// Unknown (any "new-format" OS) - /// - Unknown = 0x00, - - /// - /// OS/2 (default) - /// - OS2 = 0x01, - - /// - /// Windows - /// - Windows = 0x02, - - /// - /// DOS 4.x - /// - DOS4x = 0x03, - - /// - /// Windows 386 - /// - Windows386 = 0x04, - } - - public enum ResourceTableEntryType : uint - { - /// - /// "BTMP" - Bitmap - /// - BTMP = 0x504d5442, - - /// - /// "EMSG" - Error message string - /// - EMSG = 0x47534d45, - - /// - /// "FONT" - Fonts - /// - FONT = 0x544e4f46, - } - - public enum WordOrder : byte - { - /// - /// little-endian - /// - LE = 0x00, - - /// - /// big-endian - /// - /// non-zero - BE = 0x01, - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/Executable.cs b/BinaryObjectScanner.Models/LinearExecutable/Executable.cs deleted file mode 100644 index cf210e78..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/Executable.cs +++ /dev/null @@ -1,97 +0,0 @@ -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The `LINEAR` executable-file header contains information that the loader requires for - /// segmented executable files. This information includes the linker version number, data - /// specified by linker, data specified by resource compiler, tables of segment data, tables - /// of resource data, and so on. The following illustrations shows the LE file header: - /// - /// - /// - public sealed class Executable - { - /// - /// MS-DOS executable stub - /// - public MSDOS.Executable Stub { get; set; } - - /// - /// Information block - /// - public InformationBlock InformationBlock { get; set; } - - /// - /// Object table - /// - public ObjectTableEntry[] ObjectTable { get; set; } - - /// - /// Object page map - /// - public ObjectPageMapEntry[] ObjectPageMap { get; set; } - - // TODO: Object iterate data map table (Undefined) - - /// - /// Resource table - /// - public ResourceTableEntry[] ResourceTable { get; set; } - - /// - /// Resident Name table - /// - public ResidentNamesTableEntry[] ResidentNamesTable { get; set; } - - /// - /// Entry table - /// - public EntryTableBundle[] EntryTable { get; set; } - - /// - /// Module format directives table (optional) - /// - public ModuleFormatDirectivesTableEntry[] ModuleFormatDirectivesTable { get; set; } - - /// - /// Verify record directive table (optional) - /// - public VerifyRecordDirectiveTableEntry[] VerifyRecordDirectiveTable { get; set; } - - /// - /// Fix-up page table - /// - public FixupPageTableEntry[] FixupPageTable { get; set; } - - /// - /// Fix-up record table - /// - public FixupRecordTableEntry[] FixupRecordTable { get; set; } - - /// - /// Import module name table - /// - public ImportModuleNameTableEntry[] ImportModuleNameTable { get; set; } - - /// - /// Import procedure name table - /// - public ImportModuleProcedureNameTableEntry[] ImportModuleProcedureNameTable { get; set; } - - /// - /// Per-Page checksum table - /// - public PerPageChecksumTableEntry[] PerPageChecksumTable { get; set; } - - /// - /// Non-Resident Name table - /// - public NonResidentNamesTableEntry[] NonResidentNamesTable { get; set; } - - // TODO: Non-resident directives data (Undefined) - - /// - /// Debug information - /// - public DebugInformation DebugInformation { get; set; } - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/FixupPageTableEntry.cs b/BinaryObjectScanner.Models/LinearExecutable/FixupPageTableEntry.cs deleted file mode 100644 index 32d9803b..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/FixupPageTableEntry.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The Fixup Page Table provides a simple mapping of a logical page number - /// to an offset into the Fixup Record Table for that page. - /// - /// This table is parallel to the Object Page Table, except that there is - /// one additional entry in this table to indicate the end of the Fixup - /// Record Table. - /// - /// The fixup records are kept in order by logical page in the fixup record - /// table. This allows the end of each page's fixup records is defined by the - /// offset for the next logical page's fixup records. This last entry provides - /// support of this mechanism for the last page in the fixup page table. - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class FixupPageTableEntry - { - /// - /// Offset for fixup record for this page. (1 to n) - /// Offset to the end of the fixup records. (n + 1) - /// - /// - /// This field specifies the offset, from the beginning of the fixup record - /// table, to the first fixup record for this page. (1 to n) - /// - /// This field specifies the offset following the last fixup record in the - /// fixup record table. This is the last entry in the fixup page table. (n + 1) - /// - public uint Offset; - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/FixupRecordTableEntry.cs b/BinaryObjectScanner.Models/LinearExecutable/FixupRecordTableEntry.cs deleted file mode 100644 index 2adcbf7f..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/FixupRecordTableEntry.cs +++ /dev/null @@ -1,363 +0,0 @@ -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The Fixup Record Table contains entries for all fixups in the linear EXE module. - /// The fixup records for a logical page are grouped together and kept in sorted - /// order by logical page number. The fixups for each page are further sorted such - /// that all external fixups and internal selector/pointer fixups come before - /// internal non-selector/non-pointer fixups. This allows the loader to ignore - /// internal fixups if the loader is able to load all objects at the addresses - /// specified in the object table. - /// - /// - /// - public sealed class FixupRecordTableEntry - { - /// - /// Source type. - /// - /// - /// The source type specifies the size and type of the fixup to be performed - /// on the fixup source. - /// - public FixupRecordSourceType SourceType; - - /// - /// Target Flags. - /// - /// - /// The target flags specify how the target information is interpreted. - /// - public FixupRecordTargetFlags TargetFlags; - - #region Source List Flag - - #region Set - - /// - /// Source offset. - /// - /// - /// This field contains either an offset or a count depending on the Source - /// List Flag. If the Source List Flag is set, a list of source offsets - /// follows the additive field and this field contains the count of the - /// entries in the source offset list. Otherwise, this is the single source - /// offset for the fixup. Source offsets are relative to the beginning of - /// the page where the fixup is to be made. - /// - /// Note that for fixups that cross page boundaries, a separate fixup record - /// is specified for each page. An offset is still used for the 2nd page but - /// it now becomes a negative offset since the fixup originated on the - /// preceding page. (For example, if only the last one byte of a 32-bit - /// address is on the page to be fixed up, then the offset would have a value - /// of -3.) - /// - public ushort SourceOffset; - - #endregion - - #region Unset - - /// - /// Source offset list count. - /// - /// - /// This field contains either an offset or a count depending on the Source - /// List Flag. If the Source List Flag is set, a list of source offsets - /// follows the additive field and this field contains the count of the - /// entries in the source offset list. Otherwise, this is the single source - /// offset for the fixup. Source offsets are relative to the beginning of - /// the page where the fixup is to be made. - /// - /// Note that for fixups that cross page boundaries, a separate fixup record - /// is specified for each page. An offset is still used for the 2nd page but - /// it now becomes a negative offset since the fixup originated on the - /// preceding page. (For example, if only the last one byte of a 32-bit - /// address is on the page to be fixed up, then the offset would have a value - /// of -3.) - /// - public byte SourceOffsetListCount; - - #endregion - - #endregion - - #region OBJECT / TRGOFF - - #region 16-bit Object Number/Module Ordinal Flag - - #region Set - - /// - /// Target object number. - /// - /// - /// This field is an index into the current module's Object Table to specify - /// the target Object. It is a Byte value when the '16-bit Object Number/Module - /// Ordinal Flag' bit in the target flags field is clear and a Word value when - /// the bit is set. - /// - public ushort TargetObjectNumberWORD; - - #endregion - - #region Unset - - /// - /// Target object number. - /// - /// - /// This field is an index into the current module's Object Table to specify - /// the target Object. It is a Byte value when the '16-bit Object Number/Module - /// Ordinal Flag' bit in the target flags field is clear and a Word value when - /// the bit is set. - /// - public byte TargetObjectNumberByte; - - #endregion - - #endregion - - #region 32-bit Target Offset Flag - - #region Set - - /// - /// Target offset. - /// - /// - /// This field is an offset into the specified target Object. It is not - /// present when the Source Type specifies a 16-bit Selector fixup. It - /// is a Word value when the '32-bit Target Offset Flag' bit in the target - /// flags field is clear and a Dword value when the bit is set. - /// - public uint TargetOffsetDWORD; - - #endregion - - #region Unset - - /// - /// Target offset. - /// - /// - /// This field is an offset into the specified target Object. It is not - /// present when the Source Type specifies a 16-bit Selector fixup. It - /// is a Word value when the '32-bit Target Offset Flag' bit in the target - /// flags field is clear and a Dword value when the bit is set. - /// - public ushort TargetOffsetWORD; - - #endregion - - #endregion - - #endregion - - #region 16-bit Object Number/Module Ordinal Flag [Incompatible with OBJECT / TRGOFF] - - #region Set - - /// - /// Ordinal index into the Import Module Name Table. - /// - /// - /// This value is an ordered index in to the Import Module Name Table for - /// the module containing the procedure entry point. It is a Byte value - /// when the '16-bit Object Number/Module Ordinal' Flag bit in the target - /// flags field is clear and a Word value when the bit is set. The loader - /// creates a table of pointers with each pointer in the table corresponds - /// to the modules named in the Import Module Name Table. This value is used - /// by the loader to index into this table created by the loader to locate - /// the referenced module. - /// - public ushort OrdinalIndexImportModuleNameTableWORD; - - #endregion - - #region Unset - - /// - /// Ordinal index into the Import Module Name Table. - /// - /// - /// This value is an ordered index in to the Import Module Name Table for - /// the module containing the procedure entry point. It is a Byte value - /// when the '16-bit Object Number/Module Ordinal' Flag bit in the target - /// flags field is clear and a Word value when the bit is set. The loader - /// creates a table of pointers with each pointer in the table corresponds - /// to the modules named in the Import Module Name Table. This value is used - /// by the loader to index into this table created by the loader to locate - /// the referenced module. - /// - public byte OrdinalIndexImportModuleNameTableByte; - - #endregion - - #endregion - - #region MOD ORD# / PROCEDURE NAME OFFSET / ADDITIVE - - #region 32-bit Target Offset Flag - - #region Set - - /// - /// Offset into the Import Procedure Name Table. - /// - /// - /// This field is an offset into the Import Procedure Name Table. It is - /// a Word value when the '32-bit Target Offset Flag' bit in the target - /// flags field is clear and a Dword value when the bit is set. - /// - public uint OffsetImportProcedureNameTableDWORD; - - #endregion - - #region Unset - - /// - /// Offset into the Import Procedure Name Table. - /// - /// - /// This field is an offset into the Import Procedure Name Table. It is - /// a Word value when the '32-bit Target Offset Flag' bit in the target - /// flags field is clear and a Dword value when the bit is set. - /// - public ushort OffsetImportProcedureNameTableWORD; - - #endregion - - #endregion - - #endregion - - #region MOD ORD# / IMPORT ORD / ADDITIVE - - #region 8-bit Ordinal Flag - - #region Set - - /// - /// Imported ordinal number. - /// - /// - /// This is the imported procedure's ordinal number. It is a Byte value when the - /// '8-bit Ordinal' bit in the target flags field is set. Otherwise it is a Word value - /// when the '32-bit Target Offset Flag' bit in the target flags field is clear and a - /// Dword value when the bit is set. - /// - public byte ImportedOrdinalNumberByte; - - #endregion - - #region Unset - - #region 32-bit Target Offset Flag - - #region Set - - /// - /// Imported ordinal number. - /// - /// - /// This is the imported procedure's ordinal number. It is a Byte value when the - /// '8-bit Ordinal' bit in the target flags field is set. Otherwise it is a Word value - /// when the '32-bit Target Offset Flag' bit in the target flags field is clear and a - /// Dword value when the bit is set. - /// - public uint ImportedOrdinalNumberDWORD; - - #endregion - - #region Unset - - /// - /// Imported ordinal number. - /// - /// - /// This is the imported procedure's ordinal number. It is a Byte value when the - /// '8-bit Ordinal' bit in the target flags field is set. Otherwise it is a Word value - /// when the '32-bit Target Offset Flag' bit in the target flags field is clear and a - /// Dword value when the bit is set. - /// - public uint ImportedOrdinalNumberWORD; - - #endregion - - #endregion - - #endregion - - #endregion - - #endregion - - #region Additive Fixup Flag [Incompatible with OBJECT / TRGOFF] - - #region Set - - #region 32-bit Additive Fixup Flag - - #region Set - - /// - /// Additive fixup value. - /// - /// - /// This field exists in the fixup record only when the 'Additive Fixup Flag' - /// bit in the target flags field is set. When the 'Additive Fixup Flag' is - /// clear the fixup record does not contain this field and is immediately - /// followed by the next fixup record (or by the source offset list for this - /// fixup record). - /// - /// This value is added to the address derived from the target entry point. - /// This field is a Word value when the '32-bit Additive Flag' bit in the - /// target flags field is clear and a Dword value when the bit is set. - /// - public uint AdditiveFixupValueDWORD; - - #endregion - - #region Unset - - /// - /// Additive fixup value. - /// - /// - /// This field exists in the fixup record only when the 'Additive Fixup Flag' - /// bit in the target flags field is set. When the 'Additive Fixup Flag' is - /// clear the fixup record does not contain this field and is immediately - /// followed by the next fixup record (or by the source offset list for this - /// fixup record). - /// - /// This value is added to the address derived from the target entry point. - /// This field is a Word value when the '32-bit Additive Flag' bit in the - /// target flags field is clear and a Dword value when the bit is set. - /// - public ushort AdditiveFixupValueWORD; - - #endregion - - #endregion - - #endregion - - #endregion - - #region SCROFFn - - /// - /// Source offset list. - /// - /// - /// This list is present if the Source List Flag is set in the Target Flags field. - /// The number of entries in the source offset list is defined in the SRCOFF/CNT - /// field. The source offsets are relative to the beginning of the page where the - /// fixups are to be made. - /// - public ushort[] SourceOffsetList; - - #endregion - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/ImportModuleNameTableEntry.cs b/BinaryObjectScanner.Models/LinearExecutable/ImportModuleNameTableEntry.cs deleted file mode 100644 index d4720c4d..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/ImportModuleNameTableEntry.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The import module name table defines the module name strings imported through - /// dynamic link references. These strings are referenced through the imported - /// relocation fixups. - /// - /// To determine the length of the import module name table subtract the import - /// module name table offset from the import procedure name table offset. These - /// values are located in the linear EXE header. The end of the import module - /// name table is not terminated by a special character, it is followed directly - /// by the import procedure name table. - /// - /// The strings are CASE SENSITIVE and NOT NULL TERMINATED. - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ImportModuleNameTableEntry - { - /// - /// String Length. - /// - /// - /// This defines the length of the string in bytes. The length of each - /// ascii name string is limited to 127 characters. - /// - public byte Length; - - /// - /// ASCII String. - /// - /// - /// This is a variable length string with it's length defined in bytes by - /// the LEN field. The string is case sensitive and is not null terminated. - /// - public string Name; - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/ImportProcedureNameTableEntry.cs b/BinaryObjectScanner.Models/LinearExecutable/ImportProcedureNameTableEntry.cs deleted file mode 100644 index e82a72e1..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/ImportProcedureNameTableEntry.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The import procedure name table defines the procedure name strings imported - /// by this module through dynamic link references. These strings are referenced - /// through the imported relocation fixups. - /// - /// To determine the length of the import procedure name table add the fixup - /// section size to the fixup page table offset, this computes the offset to - /// the end of the fixup section, then subtract the import procedure name table - /// offset. These values are located in the linear EXE header. The import - /// procedure name table is followed by the data pages section. Since the data - /// pages section is aligned on a 'page size' boundary, padded space may exist - /// between the last import name string and the first page in the data pages - /// section. If this padded space exists it will be zero filled. - /// - /// The strings are CASE SENSITIVE and NOT NULL TERMINATED. - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ImportModuleProcedureNameTableEntry - { - /// - /// String Length. - /// - /// - /// This defines the length of the string in bytes. The length of each - /// ascii name string is limited to 127 characters. - /// - /// The high bit in the LEN field (bit 7) is defined as an Overload bit. - /// This bit signifies that additional information is contained in the - /// linear EXE module and will be used in the future for parameter type - /// checking. - /// - public byte Length; - - /// - /// ASCII String. - /// - /// - /// This is a variable length string with it's length defined in bytes by - /// the LEN field. The string is case sensitive and is not null terminated. - /// - public string Name; - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/InformationBlock.cs b/BinaryObjectScanner.Models/LinearExecutable/InformationBlock.cs deleted file mode 100644 index d8f548c2..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/InformationBlock.cs +++ /dev/null @@ -1,426 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The `information block` in the LE header contains the linker version number, - /// length of various tables that further describe the executable file, the - /// offsets from the beginning of the header to the beginning of these tables, - /// the heap and stack sizes, and so on. The following list summarizes the - /// contents of the header `information block` (the locations are relative to - /// the beginning of the block): - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class InformationBlock - { - /// - /// Specifies the signature word - /// 'LE' (4Ch 45H) - /// 'LX' (4Ch 58H) - /// - /// - /// The signature word is used by the loader to identify the EXE - /// file as a valid 32-bit Linear Executable Module Format. - /// - public string Signature; - - /// - /// Byte Ordering. - /// - /// - /// This byte specifies the byte ordering for the linear EXE format. - /// - public ByteOrder ByteOrder; - - /// - /// Word Ordering. - /// - /// - /// This byte specifies the Word ordering for the linear EXE format. - /// - public WordOrder WordOrder; - - /// - /// Linear EXE Format Level. - /// - /// - /// The Linear EXE Format Level is set to 0 for the initial version of the - /// 32-bit linear EXE format. Each incompatible change to the linear EXE - /// format must increment this value. This allows the system to recognized - /// future EXE file versions so that an appropriate error message may be - /// displayed if an attempt is made to load them. - /// - public uint ExecutableFormatLevel; - - /// - /// Module CPU Type. - /// - /// - /// This field specifies the type of CPU required by this module to run. - /// - public CPUType CPUType; - - /// - /// Module OS Type. - /// - /// - /// This field specifies the type of Operating system required to run this module. - /// - public OperatingSystem ModuleOS; - - /// - /// Module version - /// - /// - /// This is useful for differentiating between revisions of dynamic linked modules. - /// This value is specified at link time by the user. - /// - public uint ModuleVersion; - - /// - /// Module type flags - /// - public ModuleFlags ModuleTypeFlags; - - /// - /// Number of pages in module. - /// - /// - /// This field specifies the number of pages physically contained in this module. - /// In other words, pages containing either enumerated or iterated data, or - /// zero-fill pages that have relocations, not invalid or zero-fill pages implied - /// by the Virtual Size in the Object Table being larger than the number of pages - /// actually in the linear EXE file. These pages are contained in the 'preload - /// pages', 'demand load pages' and 'iterated data pages' sections of the linear - /// EXE module. This is used to determine the size of the page information tables - /// in the linear EXE module. - /// - public uint ModuleNumberPages; - - /// - /// The Object number to which the Entry Address is relative. - /// - /// - /// This specifies the object to which the Entry Address is relative. This must be - /// a nonzero value for a program module to be correctly loaded. A zero value for - /// a library module indicates that no library entry routine exists. If this value - /// is zero, then both the Per-process Library Initialization bit and the Per-process - /// Library Termination bit must be clear in the module flags, or else the loader - /// will fail to load the module. Further, if the Per-process Library Termination bit - /// is set, then the object to which this field refers must be a 32-bit object (i.e., - /// the Big/Default bit must be set in the object flags; see below). - /// - public uint InitialObjectCS; - - /// - /// Entry Address of module. - /// - /// - /// The Entry Address is the starting address for program modules and the library - /// initialization and Library termination address for library modules. - /// - public uint InitialEIP; - - /// - /// The Object number to which the ESP is relative. - /// - /// - /// This specifies the object to which the starting ESP is relative. This must be a - /// nonzero value for a program module to be correctly loaded. This field is ignored - /// for a library module. - /// - public uint InitialObjectSS; - - /// - /// Starting stack address of module. - /// - /// - /// The ESP defines the starting stack pointer address for program modules. A zero - /// value in this field indicates that the stack pointer is to be initialized to the - /// highest address/offset in the object. This field is ignored for a library module. - /// - public uint InitialESP; - - /// - /// The size of one page for this system. - /// - /// - /// This field specifies the page size used by the linear EXE format and the system. - /// For the initial version of this linear EXE format the page size is 4Kbytes. - /// (The 4K page size is specified by a value of 4096 in this field.) - /// - public uint MemoryPageSize; - - /// - /// The shift left bits for page offsets. - /// - /// - /// This field gives the number of bit positions to shift left when interpreting - /// the Object Page Table entries' page offset field. This determines the alignment - /// of the page information in the file. For example, a value of 4 in this field - /// would align all pages in the Data Pages and Iterated Pages sections on 16 byte - /// (paragraph) boundaries. A Page Offset Shift of 9 would align all pages on a - /// 512 byte (disk sector) basis. The default value for this field is 12 (decimal), - /// which give a 4096 byte alignment. All other offsets are byte aligned. - /// - public uint BytesOnLastPage; - - /// - /// Total size of the fixup information in bytes. - /// - /// - /// This includes the following 4 tables: - /// - Fixup Page Table - /// - Fixup Record Table - /// - Import Module name Table - /// - Import Procedure Name Table - /// - public uint FixupSectionSize; - - /// - /// Checksum for fixup information. - /// - /// - /// This is a cryptographic checksum covering all of the fixup information. The - /// checksum for the fixup information is kept separate because the fixup data is - /// not always loaded into main memory with the 'loader section'. If the checksum - /// feature is not implemented, then the linker will set these fields to zero. - /// - public uint FixupSectionChecksum; - - /// - /// Size of memory resident tables. - /// - /// - /// This is the total size in bytes of the tables required to be memory resident - /// for the module, while the module is in use. This total size includes all - /// tables from the Object Table down to and including the Per-Page Checksum Table. - /// - public uint LoaderSectionSize; - - /// - /// Checksum for loader section. - /// - /// - /// This is a cryptographic checksum covering all of the loader section information. - /// If the checksum feature is not implemented, then the linker will set these fields - /// to zero. - /// - public uint LoaderSectionChecksum; - - /// - /// Object Table offset. - /// - /// - /// This offset is relative to the beginning of the linear EXE header. - /// - public uint ObjectTableOffset; - - /// - /// Object Table Count. - /// - /// - /// This defines the number of entries in Object Table. - /// - public uint ObjectTableCount; - - /// - /// Object Page Table offset - /// - /// - /// This offset is relative to the beginning of the linear EXE header. - /// - public uint ObjectPageMapOffset; - - /// - /// Object Iterated Pages offset. - /// - /// - /// This offset is relative to the beginning of the linear EXE header. - /// - public uint ObjectIterateDataMapOffset; - - /// - /// Resource Table offset - /// - /// - /// This offset is relative to the beginning of the linear EXE header. - /// - public uint ResourceTableOffset; - - /// - /// Number of entries in Resource Table. - /// - public uint ResourceTableCount; - - /// - /// Resident Name Table offset. - /// - /// - /// This offset is relative to the beginning of the linear EXE header. - /// - public uint ResidentNamesTableOffset; - - /// - /// Entry Table offset. - /// - /// - /// This offset is relative to the beginning of the linear EXE header. - /// - public uint EntryTableOffset; - - /// - /// Module Format Directives Table offset. - /// - /// - /// This offset is relative to the beginning of the linear EXE header. - /// - public uint ModuleDirectivesTableOffset; - - /// - /// Number of Module Format Directives in the Table. - /// - /// - /// This field specifies the number of entries in the - /// Module Format Directives Table. - /// - public uint ModuleDirectivesCount; - - /// - /// Fixup Page Table offset. - /// - /// - /// This offset is relative to the beginning of the linear EXE header. - /// - public uint FixupPageTableOffset; - - /// - /// Fixup Record Table offset. - /// - /// - /// This offset is relative to the beginning of the linear EXE header. - /// - public uint FixupRecordTableOffset; - - /// - /// Import Module Name Table offset. - /// - /// - /// This offset is relative to the beginning of the linear EXE header. - /// - public uint ImportedModulesNameTableOffset; - - /// - /// The number of entries in the Import Module Name Table. - /// - public uint ImportedModulesCount; - - /// - /// Import Procedure Name Table offset. - /// - /// - /// This offset is relative to the beginning of the linear EXE header. - /// - public uint ImportProcedureNameTableOffset; - - /// - /// Per-page Checksum Table offset. - /// - /// - /// This offset is relative to the beginning of the linear EXE header. - /// - public uint PerPageChecksumTableOffset; - - /// - /// Data Pages Offset. - /// - /// - /// This offset is relative to the beginning of the EXE file. - /// - public uint DataPagesOffset; - - /// - /// Number of Preload pages for this module. - /// - /// - /// Note that OS/2 2.0 does not respect the preload of pages as specified - /// in the executable file for performance reasons. - /// - public uint PreloadPageCount; - - /// - /// Non-Resident Name Table offset. - /// - /// - /// This offset is relative to the beginning of the EXE file. - /// - public uint NonResidentNamesTableOffset; - - /// - /// Number of bytes in the Non-resident name table. - /// - public uint NonResidentNamesTableLength; - - /// - /// Non-Resident Name Table Checksum. - /// - /// - /// This is a cryptographic checksum of the Non-Resident Name Table. - /// - public uint NonResidentNamesTableChecksum; - - /// - /// The Auto Data Segment Object number. - /// - /// - /// This is the object number for the Auto Data Segment used by 16-bit modules. - /// This field is supported for 16-bit compatibility only and is not used by - /// 32-bit modules. - /// - public uint AutomaticDataObject; - - /// - /// Debug Information offset. - /// - /// - /// This offset is relative to the beginning of the linear EXE header. - /// - public uint DebugInformationOffset; - - /// - /// Debug Information length. - /// - /// - /// The length of the debug information in bytes. - /// - public uint DebugInformationLength; - - /// - /// Instance pages in preload section. - /// - /// - /// The number of instance data pages found in the preload section. - /// - public uint PreloadInstancePagesNumber; - - /// - /// Instance pages in demand section. - /// - /// - /// The number of instance data pages found in the demand section. - /// - public uint DemandInstancePagesNumber; - - /// - /// Heap size added to the Auto DS Object. - /// - /// - /// The heap size is the number of bytes added to the Auto Data Segment - /// by the loader. This field is supported for 16-bit compatibility only and - /// is not used by 32-bit modules. - /// - public uint ExtraHeapAllocation; - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/ModuleFormatDirectivesTableEntry.cs b/BinaryObjectScanner.Models/LinearExecutable/ModuleFormatDirectivesTableEntry.cs deleted file mode 100644 index c55c3fc4..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/ModuleFormatDirectivesTableEntry.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The Module Format Directives Table is an optional table that allows additional - /// options to be specified. It also allows for the extension of the linear EXE - /// format by allowing additional tables of information to be added to the linear - /// EXE module without affecting the format of the linear EXE header. Likewise, - /// module format directives provide a place in the linear EXE module for - /// 'temporary tables' of information, such as incremental linking information - /// and statistic information gathered on the module. When there are no module - /// format directives for a linear EXE module, the fields in the linear EXE header - /// referencing the module format directives table are zero. - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ModuleFormatDirectivesTableEntry - { - /// - /// Directive number. - /// - /// - /// The directive number specifies the type of directive defined. This can be - /// used to determine the format of the information in the directive data. - /// - public DirectiveNumber DirectiveNumber; - - /// - /// Directive data length. - /// - /// - /// This specifies the length in byte of the directive data for this directive number. - /// - public ushort DirectiveDataLength; - - /// - /// Directive data offset. - /// - /// - /// This is the offset to the directive data for this directive number. It is relative - /// to beginning of linear EXE header for a resident table, and relative to the - /// beginning of the EXE file for non-resident tables. - /// - public uint DirectiveDataOffset; - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/NonResidentNamesTableEntry.cs b/BinaryObjectScanner.Models/LinearExecutable/NonResidentNamesTableEntry.cs deleted file mode 100644 index 3827eb1f..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/NonResidentNamesTableEntry.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The resident and non-resident name tables define the ASCII names and ordinal - /// numbers for exported entries in the module. In addition the first entry in - /// the resident name table contains the module name. These tables are used to - /// translate a procedure name string into an ordinal number by searching for a - /// matching name string. The ordinal number is used to locate the entry point - /// information in the entry table. - /// - /// The resident name table is kept resident in system memory while the module is - /// loaded.It is intended to contain the exported entry point names that are - /// frequently dynamically linked to by name.Non-resident names are not kept in - /// memory and are read from the EXE file when a dynamic link reference is made. - /// Exported entry point names that are infrequently dynamically linked to by name - /// or are commonly referenced by ordinal number should be placed in the - /// non-resident name table.The trade off made for references by name is performance - /// vs memory usage. - /// - /// Import references by name require these tables to be searched to obtain the entry - /// point ordinal number.Import references by ordinal number provide the fastest - /// lookup since the search of these tables is not required. - /// - /// The strings are CASE SENSITIVE and are NOT NULL TERMINATED. - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class NonResidentNamesTableEntry - { - /// - /// String Length. - /// - /// - /// This defines the length of the string in bytes. A zero length indicates there are - /// no more entries in table. The length of each ascii name string is limited to 127 - /// characters. - /// - /// The high bit in the LEN field (bit 7) is defined as an Overload bit. This bit - /// signifies that additional information is contained in the linear EXE module and - /// will be used in the future for parameter type checking. - /// - public byte Length; - - /// - /// ASCII String. - /// - /// - /// This is a variable length string with it's length defined in bytes by the LEN field. - /// The string is case case sensitive and is not null terminated. - /// - public string Name; - - /// - /// Ordinal number. - /// - /// - /// The ordinal number in an ordered index into the entry table for this entry point. - /// - public ushort OrdinalNumber; - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/ObjectPageMapEntry.cs b/BinaryObjectScanner.Models/LinearExecutable/ObjectPageMapEntry.cs deleted file mode 100644 index 313f578f..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/ObjectPageMapEntry.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The Object page table provides information about a logical page in an object. - /// A logical page may be an enumerated page, a pseudo page or an iterated page. - /// The structure of the object page table in conjunction with the structure of - /// the object table allows for efficient access of a page when a page fault occurs, - /// while still allowing the physical page data to be located in the preload page, - /// demand load page or iterated data page sections in the linear EXE module. The - /// logical page entries in the Object Page Table are numbered starting from one. - /// The Object Page Table is parallel to the Fixup Page Table as they are both - /// indexed by the logical page number. - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ObjectPageMapEntry - { - /// - /// Offset to the page data in the EXE file. - /// - /// - /// This field, when bit shifted left by the PAGE OFFSET SHIFT from the module - /// header, specifies the offset from the beginning of the Preload Page section - /// of the physical page data in the EXE file that corresponds to this logical - /// page entry. The page data may reside in the Preload Pages, Demand Load Pages - /// or the Iterated Data Pages sections. - /// - /// If the FLAGS field specifies that this is a zero-Filled page then the PAGE - /// DATA OFFSET field will contain a 0. - /// - /// If the logical page is specified as an iterated data page, as indicated by - /// the FLAGS field, then this field specifies the offset into the Iterated Data - /// Pages section. - /// - /// The logical page number (Object Page Table index), is used to index the Fixup - /// Page Table to find any fixups associated with the logical page. - /// - public uint PageDataOffset; - - /// - /// Number of bytes of data for this page. - /// - /// - /// This field specifies the actual number of bytes that represent the page in the - /// file. If the PAGE SIZE field from the module header is greater than the value - /// of this field and the FLAGS field indicates a Legal Physical Page, the remaining - /// bytes are to be filled with zeros. If the FLAGS field indicates an Iterated Data - /// Page, the iterated data records will completely fill out the remainder. - /// - public ushort DataSize; - - /// - /// Attributes specifying characteristics of this logical page. - /// - public ObjectPageFlags Flags; - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/ObjectTableEntry.cs b/BinaryObjectScanner.Models/LinearExecutable/ObjectTableEntry.cs deleted file mode 100644 index 4a4627b2..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/ObjectTableEntry.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The object table contains information that describes each segment in - /// an executable file. This information includes segment length, segment - /// type, and segment-relocation data. The following list summarizes the - /// values found in in the segment table (the locations are relative to - /// the beginning of each entry): - /// - /// - /// Entries in the Object Table are numbered starting from one. - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ObjectTableEntry - { - /// - /// Virtual memory size. - /// - /// - /// This is the size of the object that will be allocated when the object - /// is loaded. The object's virtual size (rounded up to the page size value) - /// must be greater than or equal to the total size of the pages in the EXE - /// file for the object. This memory size must also be large enough to - /// contain all of the iterated data and uninitialized data in the EXE file. - /// - public uint VirtualSegmentSize; - - /// - /// Relocation Base Address. - /// - /// - /// The relocation base address the object is currently relocated to. If the - /// internal relocation fixups for the module have been removed, this is the - /// address the object will be allocated at by the loader. - /// - public uint RelocationBaseAddress; - - /// - /// Flag bits for the object. - /// - public ObjectFlags ObjectFlags; - - /// - /// Object Page Table Index. - /// - /// - /// This specifies the number of the first object page table entry for this object. - /// The object page table specifies where in the EXE file a page can be found for - /// a given object and specifies per-page attributes. - /// - /// The object table entries are ordered by logical page in the object table. In - /// other words the object table entries are sorted based on the object page table - /// index value. - /// - public uint PageTableIndex; - - /// - /// # of object page table entries for this object. - /// - /// - /// Any logical pages at the end of an object that do not have an entry in the object - /// page table associated with them are handled as zero filled or invalid pages by - /// the loader. - /// - /// When the last logical pages of an object are not specified with an object page - /// table entry, they are treated as either zero filled pages or invalid pages based - /// on the last entry in the object page table for that object. If the last entry - /// was neither a zero filled or invalid page, then the additional pages are treated - /// as zero filled pages. - /// - public uint PageTableEntries; - - /// - /// Reserved for future use. Must be set to zero. - /// - public uint Reserved; - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/PerPageChecksumTableEntry.cs b/BinaryObjectScanner.Models/LinearExecutable/PerPageChecksumTableEntry.cs deleted file mode 100644 index fc1a60b8..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/PerPageChecksumTableEntry.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The Per-Page Checksum table provides space for a cryptographic checksum for - /// each physical page in the EXE file. - /// - /// The checksum table is arranged such that the first entry in the table corresponds - /// to the first logical page of code/data in the EXE file (usually a preload page) - /// and the last entry corresponds to the last logical page in the EXE file (usually - /// a iterated data page). - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class PerPageChecksumTableEntry - { - /// - /// Cryptographic checksum. - /// - public uint Checksum; - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/ResidentNamesTableEntry.cs b/BinaryObjectScanner.Models/LinearExecutable/ResidentNamesTableEntry.cs deleted file mode 100644 index 85258769..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/ResidentNamesTableEntry.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The resident and non-resident name tables define the ASCII names and ordinal - /// numbers for exported entries in the module. In addition the first entry in - /// the resident name table contains the module name. These tables are used to - /// translate a procedure name string into an ordinal number by searching for a - /// matching name string. The ordinal number is used to locate the entry point - /// information in the entry table. - /// - /// The resident name table is kept resident in system memory while the module is - /// loaded. It is intended to contain the exported entry point names that are - /// frequently dynamically linked to by name. Non-resident names are not kept in - /// memory and are read from the EXE file when a dynamic link reference is made. - /// Exported entry point names that are infrequently dynamically linked to by name - /// or are commonly referenced by ordinal number should be placed in the - /// non-resident name table. The trade off made for references by name is performance - /// vs memory usage. - /// - /// Import references by name require these tables to be searched to obtain the entry - /// point ordinal number.Import references by ordinal number provide the fastest - /// lookup since the search of these tables is not required. - /// - /// The strings are CASE SENSITIVE and are NOT NULL TERMINATED. - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ResidentNamesTableEntry - { - /// - /// String Length. - /// - /// - /// This defines the length of the string in bytes. A zero length indicates there are - /// no more entries in table. The length of each ascii name string is limited to 127 - /// characters. - /// - /// The high bit in the LEN field (bit 7) is defined as an Overload bit. This bit - /// signifies that additional information is contained in the linear EXE module and - /// will be used in the future for parameter type checking. - /// - public byte Length; - - /// - /// ASCII String. - /// - /// - /// This is a variable length string with it's length defined in bytes by the LEN field. - /// The string is case case sensitive and is not null terminated. - /// - public string Name; - - /// - /// Ordinal number. - /// - /// - /// The ordinal number in an ordered index into the entry table for this entry point. - /// - public ushort OrdinalNumber; - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/ResourceTableEntry.cs b/BinaryObjectScanner.Models/LinearExecutable/ResourceTableEntry.cs deleted file mode 100644 index 8c7a6334..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/ResourceTableEntry.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The resource table is an array of resource table entries. Each resource table - /// entry contains a type ID and name ID. These entries are used to locate resource - /// objects contained in the Object table. The number of entries in the resource - /// table is defined by the Resource Table Count located in the linear EXE header. - /// More than one resource may be contained within a single object. Resource table - /// entries are in a sorted order, (ascending, by Resource Name ID within the - /// Resource Type ID). This allows the DosGetResource API function to use a binary - /// search when looking up a resource in a 32-bit module instead of the linear search - /// being used in the current 16-bit module. - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ResourceTableEntry - { - /// - /// Resource type ID. - /// - public ResourceTableEntryType TypeID; - - /// - /// An ID used as a name for the resource when referred to. - /// - public ushort NameID; - - /// - /// The number of bytes the resource consists of. - /// - public uint ResourceSize; - - /// - /// The number of the object which contains the resource. - /// - public ushort ObjectNumber; - - /// - /// The offset within the specified object where the resource begins. - /// - public uint Offset; - } -} diff --git a/BinaryObjectScanner.Models/LinearExecutable/VerifyRecordDirectiveTableEntry.cs b/BinaryObjectScanner.Models/LinearExecutable/VerifyRecordDirectiveTableEntry.cs deleted file mode 100644 index 3242ca56..00000000 --- a/BinaryObjectScanner.Models/LinearExecutable/VerifyRecordDirectiveTableEntry.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.LinearExecutable -{ - /// - /// The Verify Record Directive Table is an optional table. It maintains a record - /// of the pages in the EXE file that have been fixed up and written back to the - /// original linear EXE module, along with the module dependencies used to perform - /// these fixups. This table provides an efficient means for verifying the virtual - /// addresses required for the fixed up pages when the module is loaded. - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class VerifyRecordDirectiveTableEntry - { - /// - /// Number of module dependencies. - /// - /// - /// This field specifies how many entries there are in the verify record - /// directive table. This is equal to the number of modules referenced by - /// this module. - /// - public ushort EntryCount; - - /// - /// Ordinal index into the Import Module Name Table. - /// - /// - /// This value is an ordered index in to the Import Module Name Table for - /// the referenced module. - /// - public ushort OrdinalIndex; - - /// - /// Module Version. - /// - /// - /// This is the version of the referenced module that the fixups were - /// originally performed.This is used to insure the same version of the - /// referenced module is loaded that was fixed up in this module and - /// therefore the fixups are still correct. This requires the version - /// number in a module to be incremented anytime the entry point offsets - /// change. - /// - public ushort Version; - - /// - /// Module # of Object Entries. - /// - /// - /// This field is used to identify the number of object verify entries - /// that follow for the referenced module. - /// - public ushort ObjectEntriesCount; - - /// - /// Object # in Module. - /// - /// - /// This field specifies the object number in the referenced module that - /// is being verified. - /// - public ushort ObjectNumberInModule; - - /// - /// Object load base address. - /// - /// - /// This is the address that the object was loaded at when the fixups were - /// performed. - /// - public ushort ObjectLoadBaseAddress; - - /// - /// Object virtual address size. - /// - /// - /// This field specifies the total amount of virtual memory required for - /// this object. - /// - public ushort ObjectVirtualAddressSize; - } -} diff --git a/BinaryObjectScanner.Models/MSDOS/Constants.cs b/BinaryObjectScanner.Models/MSDOS/Constants.cs deleted file mode 100644 index 829773b5..00000000 --- a/BinaryObjectScanner.Models/MSDOS/Constants.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.MSDOS -{ - public static class Constants - { - public static readonly byte[] SignatureBytes = new byte[] { 0x4d, 0x5a }; - - public const string SignatureString = "MZ"; - - public const ushort SignatureUInt16 = 0x5a4d; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/MSDOS/Executable.cs b/BinaryObjectScanner.Models/MSDOS/Executable.cs deleted file mode 100644 index e91ffe82..00000000 --- a/BinaryObjectScanner.Models/MSDOS/Executable.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace BinaryObjectScanner.Models.MSDOS -{ - /// - /// The MS-DOS EXE format, also known as MZ after its signature (the initials of Microsoft engineer Mark Zbykowski), - /// was introduced with MS-DOS 2.0 (version 1.0 only sported the simple COM format). It is designed as a relocatable - /// executable running under real mode. As such, only DOS and Windows 9x can use this format natively, but there are - /// several free DOS emulators (e.g., DOSBox) that support it and that run under various operating systems (e.g., - /// Linux, Amiga, Windows NT, etc.). Although they can exist on their own, MZ executables are embedded in all NE, LE, - /// and PE executables, usually as stubs so that when they are ran under DOS, they display a warning. - /// - /// - public sealed class Executable - { - /// - /// MS-DOS executable header - /// - public ExecutableHeader Header { get; set; } - - /// - /// After loading the executable into memory, the program loader goes through - /// every entry in relocation table. For each relocation entry, the loader - /// adds the start segment address into word value pointed to by the - /// segment:offset pair. So, for example, a relocation entry 0001:001A will - /// make the loader add start segment address to the value at offset - /// 1*0x10+0x1A=0x2A within the program data. - /// - public RelocationEntry[] RelocationTable { get; set; } - } -} diff --git a/BinaryObjectScanner.Models/MSDOS/ExecutableHeader.cs b/BinaryObjectScanner.Models/MSDOS/ExecutableHeader.cs deleted file mode 100644 index 0ad5e9fd..00000000 --- a/BinaryObjectScanner.Models/MSDOS/ExecutableHeader.cs +++ /dev/null @@ -1,130 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.MSDOS -{ - /// - /// MZ executables only consists of 2 structures: the header and the relocation table. - /// The header, which is followed by the program image, looks like this. - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ExecutableHeader - { - #region Standard Fields - - /// - /// 0x5A4D (ASCII for 'M' and 'Z') - /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public string Magic; - - /// - /// Number of bytes in the last page. - /// - public ushort LastPageBytes; - - /// - /// Number of whole/partial pages. - /// - /// A page (or block) is 512 bytes long. - public ushort Pages; - - /// - /// Number of entries in the relocation table. - /// - public ushort RelocationItems; - - /// - /// The number of paragraphs taken up by the header. It can be any value, as the loader - /// just uses it to find where the actual executable data starts. It may be larger than - /// what the "standard" fields take up, and you may use it if you want to include your - /// own header metadata, or put the relocation table there, or use it for any other purpose. [08] - /// - /// A paragraph is 16 bytes in size - public ushort HeaderParagraphSize; - - /// - /// The number of paragraphs required by the program, excluding the PSP and program image. - /// If no free block is big enough, the loading stops. - /// - /// A paragraph is 16 bytes in size - public ushort MinimumExtraParagraphs; - - /// - /// The number of paragraphs requested by the program. - /// If no free block is big enough, the biggest one possible is allocated. - /// - /// A paragraph is 16 bytes in size - public ushort MaximumExtraParagraphs; - - /// - /// Relocatable segment address for SS. - /// - public ushort InitialSSValue; - - /// - /// Initial value for SP. - /// - public ushort InitialSPValue; - - /// - /// When added to the sum of all other words in the file, the result should be zero. - /// - public ushort Checksum; - - /// - /// Initial value for IP. [14] - /// - public ushort InitialIPValue; - - /// - /// Relocatable segment address for CS. - /// - public ushort InitialCSValue; - - /// - /// The (absolute) offset to the relocation table. - /// - public ushort RelocationTableAddr; - - /// - /// Value used for overlay management. - /// If zero, this is the main executable. - /// - public ushort OverlayNumber; - - #endregion - - #region PE Extensions - - /// - /// Reserved words - /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - public ushort[] Reserved1; - - /// - /// Defined by name but no other information is given; typically zeroes - /// - public ushort OEMIdentifier; - - /// - /// Defined by name but no other information is given; typically zeroes - /// - public ushort OEMInformation; - - /// - /// Reserved words - /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] - public ushort[] Reserved2; - - /// - /// Starting address of the PE header - /// - public uint NewExeHeaderAddr; - - #endregion - } -} diff --git a/BinaryObjectScanner.Models/MSDOS/RelocationEntry.cs b/BinaryObjectScanner.Models/MSDOS/RelocationEntry.cs deleted file mode 100644 index 7035d669..00000000 --- a/BinaryObjectScanner.Models/MSDOS/RelocationEntry.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.MSDOS -{ - /// - /// Each pointer in the relocation table looks as such - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class RelocationEntry - { - /// - /// Offset of the relocation within provided segment. - /// - public ushort Offset; - - /// - /// Segment of the relocation, relative to the load segment address. - /// - public ushort Segment; - } -} diff --git a/BinaryObjectScanner.Models/MicrosoftCabinet/CFDATA.cs b/BinaryObjectScanner.Models/MicrosoftCabinet/CFDATA.cs deleted file mode 100644 index 10093108..00000000 --- a/BinaryObjectScanner.Models/MicrosoftCabinet/CFDATA.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.MicrosoftCabinet -{ - /// - /// Each CFDATA structure describes some amount of compressed data, as shown in the following - /// packet diagram. The first CFDATA structure entry for each folder is located by using the - /// field. Subsequent CFDATA structure records for this folder are - /// contiguous. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class CFDATA - { - /// - /// Checksum of this CFDATA structure, from the through the - /// fields. It can be set to 0 (zero) if the checksum is not supplied. - /// - public uint Checksum; - - /// - /// Number of bytes of compressed data in this CFDATA structure record. When the - /// field is zero, this field indicates only the number of bytes that fit into this cabinet file. - /// - public ushort CompressedSize; - - /// - /// The uncompressed size of the data in this CFDATA structure entry in bytes. When this - /// CFDATA structure entry is continued in the next cabinet file, the field will be zero, and - /// the field in the first CFDATA structure entry in the next cabinet file will report the total - /// uncompressed size of the data from both CFDATA structure blocks. - /// - public ushort UncompressedSize; - - /// - /// If the flag is set - /// and the field value is non-zero, this field contains per-datablock application information. - /// This field is defined by the application, and it is used for application-defined purposes. - /// - public byte[] ReservedData; - - /// - /// The compressed data bytes, compressed by using the - /// method. When the field value is zero, these data bytes MUST be combined with the data - /// bytes from the next cabinet's first CFDATA structure entry before decompression. When the - /// field indicates that the data is not compressed, this field contains the - /// uncompressed data bytes. In this case, the and field values will be equal unless - /// this CFDATA structure entry crosses a cabinet file boundary. - /// - public byte[] CompressedData; - } -} diff --git a/BinaryObjectScanner.Models/MicrosoftCabinet/CFFILE.cs b/BinaryObjectScanner.Models/MicrosoftCabinet/CFFILE.cs deleted file mode 100644 index 21a1a9fe..00000000 --- a/BinaryObjectScanner.Models/MicrosoftCabinet/CFFILE.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.MicrosoftCabinet -{ - /// - /// Each CFFILE structure contains information about one of the files stored (or at least partially - /// stored) in this cabinet, as shown in the following packet diagram.The first CFFILE structure entry in - /// each cabinet is found at the absolute offset CFHEADER.coffFiles field. CFHEADER.cFiles field - /// indicates how many of these entries are in the cabinet. The CFFILE structure entries in a cabinet - /// are ordered by iFolder field value, and then by the uoffFolderStart field value.Entries for files - /// continued from the previous cabinet will be first, and entries for files continued to the next cabinet - /// will be last. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class CFFILE - { - /// - /// Specifies the uncompressed size of this file, in bytes. - /// - public uint FileSize; - - /// - /// Specifies the uncompressed offset, in bytes, of the start of this file's data. For the - /// first file in each folder, this value will usually be zero. Subsequent files in the folder will have offsets - /// that are typically the running sum of the cbFile field values. - /// - public uint FolderStartOffset; - - /// - /// Index of the folder that contains this file's data. - /// - public FolderIndex FolderIndex; - - /// - /// Date of this file, in the format ((year–1980) << 9)+(month << 5)+(day), where - /// month={1..12} and day = { 1..31 }. This "date" is typically considered the "last modified" date in local - /// time, but the actual definition is application-defined. - /// - public ushort Date; - - /// - /// Time of this file, in the format (hour << 11)+(minute << 5)+(seconds/2), where - /// hour={0..23}. This "time" is typically considered the "last modified" time in local time, but the - /// actual definition is application-defined. - /// - public ushort Time; - - /// - /// Attributes of this file; can be used in any combination. - /// - public FileAttributes Attributes; - - /// - /// The null-terminated name of this file. Note that this string can include path - /// separator characters.The string can contain up to 256 bytes, plus the null byte. When the - /// _A_NAME_IS_UTF attribute is set, this string can be converted directly to Unicode, avoiding - /// locale-specific dependencies. When the _A_NAME_IS_UTF attribute is not set, this string is subject - /// to interpretation depending on locale. When a string that contains Unicode characters larger than - /// 0x007F is encoded in the szName field, the _A_NAME_IS_UTF attribute SHOULD be included in - /// the file's attributes. When no characters larger than 0x007F are in the name, the - /// _A_NAME_IS_UTF attribute SHOULD NOT be set. If byte values larger than 0x7F are found in - /// CFFILE.szName field, but the _A_NAME_IS_UTF attribute is not set, the characters SHOULD be - /// interpreted according to the current location. - /// - public string Name; - } -} diff --git a/BinaryObjectScanner.Models/MicrosoftCabinet/CFFOLDER.cs b/BinaryObjectScanner.Models/MicrosoftCabinet/CFFOLDER.cs deleted file mode 100644 index b0d09e97..00000000 --- a/BinaryObjectScanner.Models/MicrosoftCabinet/CFFOLDER.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.Collections.Generic; -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.MicrosoftCabinet -{ - /// - /// Each CFFOLDER structure contains information about one of the folders or partial folders stored in - /// this cabinet file, as shown in the following packet diagram.The first CFFOLDER structure entry - /// immediately follows the CFHEADER structure entry. The CFHEADER.cFolders field indicates how - /// many CFFOLDER structure entries are present. - /// - /// Folders can start in one cabinet, and continue on to one or more succeeding cabinets. When the - /// cabinet file creator detects that a folder has been continued into another cabinet, it will complete - /// that folder as soon as the current file has been completely compressed.Any additional files will be - /// placed in the next folder.Generally, this means that a folder would span at most two cabinets, but it - /// could span more than two cabinets if the file is large enough. - /// - /// CFFOLDER structure entries actually refer to folder fragments, not necessarily complete folders. A - /// CFFOLDER structure is the beginning of a folder if the iFolder field value in the first file that - /// references the folder does not indicate that the folder is continued from the previous cabinet file. - /// - /// The typeCompress field can vary from one folder to the next, unless the folder is continued from a - /// previous cabinet file. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class CFFOLDER - { - /// - /// Specifies the absolute file offset of the first CFDATA field block for the folder. - /// - public uint CabStartOffset; - - /// - /// Specifies the number of CFDATA structures for this folder that are actually in this cabinet. - /// A folder can continue into another cabinet and have more CFDATA structure blocks in that cabinet - /// file.A folder can start in a previous cabinet.This number represents only the CFDATA structures for - /// this folder that are at least partially recorded in this cabinet. - /// - public ushort DataCount; - - /// - /// Indicates the compression method used for all CFDATA structure entries in this - /// folder. - /// - public CompressionType CompressionType; - - /// - /// If the CFHEADER.flags.cfhdrRESERVE_PRESENT field is set - /// and the cbCFFolder field is non-zero, then this field contains per-folder application information. - /// This field is defined by the application, and is used for application-defined purposes. - /// - public byte[] ReservedData; - - /// - /// Data blocks associated with this folder - /// - public CFDATA[] DataBlocks; - } -} diff --git a/BinaryObjectScanner.Models/MicrosoftCabinet/CFHEADER.cs b/BinaryObjectScanner.Models/MicrosoftCabinet/CFHEADER.cs deleted file mode 100644 index f9770091..00000000 --- a/BinaryObjectScanner.Models/MicrosoftCabinet/CFHEADER.cs +++ /dev/null @@ -1,153 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.MicrosoftCabinet -{ - /// - /// The CFHEADER structure shown in the following packet diagram provides information about this - /// cabinet (.cab) file. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class CFHEADER - { - /// - /// Contains the characters "M", "S", "C", and "F" (bytes 0x4D, 0x53, 0x43, - /// 0x46). This field is used to ensure that the file is a cabinet (.cab) file. - /// - public string Signature; - - /// - /// Reserved field; MUST be set to 0 (zero). - /// - public uint Reserved1; - - /// - /// Specifies the total size of the cabinet file, in bytes. - /// - public uint CabinetSize; - - /// - /// Reserved field; MUST be set to 0 (zero). - /// - public uint Reserved2; - - /// - /// Specifies the absolute file offset, in bytes, of the first CFFILE field entry. - /// - public uint FilesOffset; - - /// - /// Reserved field; MUST be set to 0 (zero). - /// - public uint Reserved3; - - /// - /// Specifies the minor cabinet file format version. This value MUST be set to 3 (three). - /// - public byte VersionMinor; - - /// - /// Specifies the major cabinet file format version. This value MUST be set to 1 (one). - /// - public byte VersionMajor; - - /// - /// Specifies the number of CFFOLDER field entries in this cabinet file. - /// - public ushort FolderCount; - - /// - /// Specifies the number of CFFILE field entries in this cabinet file. - /// - public ushort FileCount; - - /// - /// Specifies bit-mapped values that indicate the presence of optional data. - /// - public HeaderFlags Flags; - - /// - /// Specifies an arbitrarily derived (random) value that binds a collection of linked cabinet files - /// together.All cabinet files in a set will contain the same setID field value.This field is used by - /// cabinet file extractors to ensure that cabinet files are not inadvertently mixed.This value has no - /// meaning in a cabinet file that is not in a set. - /// - public ushort SetID; - - /// - /// Specifies the sequential number of this cabinet in a multicabinet set. The first cabinet has - /// iCabinet=0. This field, along with the setID field, is used by cabinet file extractors to ensure that - /// this cabinet is the correct continuation cabinet when spanning cabinet files. - /// - public ushort CabinetIndex; - - /// - /// If the flags.cfhdrRESERVE_PRESENT field is not set, this field is not - /// present, and the value of cbCFHeader field MUST be zero.Indicates the size, in bytes, of the - /// abReserve field in this CFHEADER structure.Values for cbCFHeader field MUST be between 0- - /// 60,000. - /// - public ushort HeaderReservedSize; - - /// - /// If the flags.cfhdrRESERVE_PRESENT field is not set, this field is not - /// present, and the value of cbCFFolder field MUST be zero.Indicates the size, in bytes, of the - /// abReserve field in each CFFOLDER field entry.Values for fhe cbCFFolder field MUST be between - /// 0-255. - /// - public byte FolderReservedSize; - - /// - /// If the flags.cfhdrRESERVE_PRESENT field is not set, this field is not - /// present, and the value for the cbCFDATA field MUST be zero.The cbCFDATA field indicates the - /// size, in bytes, of the abReserve field in each CFDATA field entry. Values for the cbCFDATA field - /// MUST be between 0 - 255. - /// - public byte DataReservedSize; - - /// - /// If the flags.cfhdrRESERVE_PRESENT field is set and the - /// cbCFHeader field is non-zero, this field contains per-cabinet-file application information. This field - /// is defined by the application, and is used for application-defined purposes. - /// - public byte[] ReservedData; - - /// - /// If the flags.cfhdrPREV_CABINET field is not set, this - /// field is not present.This is a null-terminated ASCII string that contains the file name of the - /// logically previous cabinet file. The string can contain up to 255 bytes, plus the null byte. Note that - /// this gives the name of the most recently preceding cabinet file that contains the initial instance of a - /// file entry.This might not be the immediately previous cabinet file, when the most recent file spans - /// multiple cabinet files.If searching in reverse for a specific file entry, or trying to extract a file that is - /// reported to begin in the "previous cabinet," the szCabinetPrev field would indicate the name of the - /// cabinet to examine. - /// - public string CabinetPrev; - - /// - /// If the flags.cfhdrPREV_CABINET field is not set, then this - /// field is not present.This is a null-terminated ASCII string that contains a descriptive name for the - /// media that contains the file named in the szCabinetPrev field, such as the text on the disk label. - /// This string can be used when prompting the user to insert a disk. The string can contain up to 255 - /// bytes, plus the null byte. - /// - public string DiskPrev; - - /// - /// If the flags.cfhdrNEXT_CABINET field is not set, this - /// field is not present.This is a null-terminated ASCII string that contains the file name of the next - /// cabinet file in a set. The string can contain up to 255 bytes, plus the null byte. Files that extend - /// beyond the end of the current cabinet file are continued in the named cabinet file. - /// - public string CabinetNext; - - /// - /// If the flags.cfhdrNEXT_CABINET field is not set, this field is - /// not present.This is a null-terminated ASCII string that contains a descriptive name for the media - /// that contains the file named in the szCabinetNext field, such as the text on the disk label. The - /// string can contain up to 255 bytes, plus the null byte. This string can be used when prompting the - /// user to insert a disk. - /// - public string DiskNext; - } -} diff --git a/BinaryObjectScanner.Models/MicrosoftCabinet/Cabinet.cs b/BinaryObjectScanner.Models/MicrosoftCabinet/Cabinet.cs deleted file mode 100644 index 6abfb531..00000000 --- a/BinaryObjectScanner.Models/MicrosoftCabinet/Cabinet.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace BinaryObjectScanner.Models.MicrosoftCabinet -{ - /// - /// Cabinet files are compressed packages containing a - /// number of related files.The format of a cabinet file is optimized for maximum compression. Cabinet - /// files support a number of compression formats, including MSZIP, LZX, or uncompressed. This - /// document does not specify these internal compression formats. - /// - /// - public sealed class Cabinet - { - /// - /// Cabinet header - /// - public CFHEADER Header { get; set; } - - /// - /// One or more CFFOLDER entries - /// - public CFFOLDER[] Folders { get; set; } - - /// - /// A series of one or more cabinet file (CFFILE) entries - /// - public CFFILE[] Files { get; set; } - } -} diff --git a/BinaryObjectScanner.Models/MicrosoftCabinet/Constants.cs b/BinaryObjectScanner.Models/MicrosoftCabinet/Constants.cs deleted file mode 100644 index b740e25d..00000000 --- a/BinaryObjectScanner.Models/MicrosoftCabinet/Constants.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.MicrosoftCabinet -{ - public static class Constants - { - public static readonly byte[] SignatureBytes = new byte[] { 0x4d, 0x53, 0x43, 0x46 }; - - public const string SignatureString = "MSCF"; - - public const uint SignatureUInt32 = 0x4643534d; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/MicrosoftCabinet/Enums.cs b/BinaryObjectScanner.Models/MicrosoftCabinet/Enums.cs deleted file mode 100644 index 2d2dac3d..00000000 --- a/BinaryObjectScanner.Models/MicrosoftCabinet/Enums.cs +++ /dev/null @@ -1,118 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.MicrosoftCabinet -{ - public enum CompressionType : ushort - { - /// - /// Mask for compression type. - /// - MASK_TYPE = 0x000F, - - /// - /// No compression. - /// - TYPE_NONE = 0x0000, - - /// - /// MSZIP compression. - /// - TYPE_MSZIP = 0x0001, - - /// - /// Quantum compression. - /// - TYPE_QUANTUM = 0x0002, - - /// - /// LZX compression. - /// - TYPE_LZX = 0x0003, - } - - [Flags] - public enum FileAttributes : ushort - { - /// - /// File is read-only. - /// - RDONLY = 0x0001, - - /// - /// File is hidden. - /// - HIDDEN = 0x0002, - - /// - /// File is a system file. - /// - SYSTEM = 0x0004, - - /// - /// File has been modified since last backup. - /// - ARCH = 0x0040, - - /// - /// File will be run after extraction. - /// - EXEC = 0x0080, - - /// - /// The szName field contains UTF. - /// - NAME_IS_UTF = 0x0100, - } - - public enum FolderIndex : ushort - { - /// - /// A value of zero indicates that this is the - /// first folder in this cabinet file. - /// - FIRST_FOLDER = 0x0000, - - /// - /// Indicates that the folder index is actually zero, but that - /// extraction of this file would have to begin with the cabinet named in the - /// CFHEADER.szCabinetPrev field. - /// - CONTINUED_FROM_PREV = 0xFFFD, - - /// - /// Indicates that the folder index - /// is actually one less than THE CFHEADER.cFolders field value, and that extraction of this file will - /// require continuation to the cabinet named in the CFHEADER.szCabinetNext field. - /// - CONTINUED_TO_NEXT = 0xFFFE, - - /// - /// - CONTINUED_PREV_AND_NEXT = 0xFFFF, - } - - [Flags] - public enum HeaderFlags : ushort - { - /// - /// The flag is set if this cabinet file is not the first in a set of cabinet files. - /// When this bit is set, the szCabinetPrev and szDiskPrev fields are present in this CFHEADER - /// structure. The value is 0x0001. - /// - PREV_CABINET = 0x0001, - - /// - /// The flag is set if this cabinet file is not the last in a set of cabinet files. - /// When this bit is set, the szCabinetNext and szDiskNext fields are present in this CFHEADER - /// structure. The value is 0x0002. - /// - NEXT_CABINET = 0x0002, - - /// - /// The flag is set if if this cabinet file contains any reserved fields. When - /// this bit is set, the cbCFHeader, cbCFFolder, and cbCFData fields are present in this CFHEADER - /// structure. The value is 0x0004. - /// - RESERVE_PRESENT = 0x0004, - } -} diff --git a/BinaryObjectScanner.Models/MoPaQ/Archive.cs b/BinaryObjectScanner.Models/MoPaQ/Archive.cs deleted file mode 100644 index e020ab49..00000000 --- a/BinaryObjectScanner.Models/MoPaQ/Archive.cs +++ /dev/null @@ -1,61 +0,0 @@ -namespace BinaryObjectScanner.Models.MoPaQ -{ - /// - /// MPQ (MoPaQ) is an archive format developed by Blizzard Entertainment, - /// purposed for storing data files, images, sounds, music and videos for - /// their games. The name MoPaQ comes from the author of the format, - /// Mike O'Brien (Mike O'brien PaCK). - /// - /// - public sealed class Archive - { - // TODO: Data before archive, ignored - - /// - /// MPQ User Data (optional) - /// - public UserData UserData { get; set; } - - /// - /// MPQ Header (required) - /// - public ArchiveHeader ArchiveHeader { get; set; } - - // TODO: Files (optional) - // TODO: Special files (optional) - - /// - /// HET Table (optional) - /// - public HetTable HetTable { get; set; } - - /// - /// BET Table (optional) - /// - public BetTable BetTable { get; set; } - - /// - /// Hash Table (optional) - /// - public HashEntry[] HashTable { get; set; } - - /// - /// Block Table (optional) - /// - public BlockEntry[] BlockTable { get; set; } - - /// - /// Hi-Block Table (optional) - /// - /// - /// Since World of Warcraft - The Burning Crusade, Blizzard extended - /// the MPQ format to support archives larger than 4GB. The hi-block - /// table holds the higher 16-bits of the file position in the MPQ. - /// Hi-block table is plain array of 16-bit values. This table is - /// not encrypted. - /// - public short[] HiBlockTable { get; set; } - - // TODO: Strong digital signature - } -} diff --git a/BinaryObjectScanner.Models/MoPaQ/ArchiveHeader.cs b/BinaryObjectScanner.Models/MoPaQ/ArchiveHeader.cs deleted file mode 100644 index 593bc4db..00000000 --- a/BinaryObjectScanner.Models/MoPaQ/ArchiveHeader.cs +++ /dev/null @@ -1,180 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.MoPaQ -{ - /// - /// MoPaQ archive header - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ArchiveHeader - { - #region V1 Properties - - /// - /// The MPQ archive signature - /// - public string Signature; - - /// - /// Size of the archive header - /// - public uint HeaderSize; - - /// - /// Size of MPQ archive - /// - /// - /// This field is deprecated in the Burning Crusade MoPaQ format, and the size of the archive - /// is calculated as the size from the beginning of the archive to the end of the hash table, - /// block table, or extended block table (whichever is largest). - /// - public uint ArchiveSize; - - /// - /// 0 = Format 1 (up to The Burning Crusade) - /// 1 = Format 2 (The Burning Crusade and newer) - /// 2 = Format 3 (WoW - Cataclysm beta or newer) - /// 3 = Format 4 (WoW - Cataclysm beta or newer) - /// - public FormatVersion FormatVersion; - - /// - /// Power of two exponent specifying the number of 512-byte disk sectors in each logical sector - /// in the archive. The size of each logical sector in the archive is 512 * 2 ^ BlockSize. - /// - public ushort BlockSize; - - /// - /// Offset to the beginning of the hash table, relative to the beginning of the archive. - /// - public uint HashTablePosition; - - /// - /// Offset to the beginning of the block table, relative to the beginning of the archive. - /// - public uint BlockTablePosition; - - /// - /// Number of entries in the hash table. Must be a power of two, and must be less than 2^16 for - /// the original MoPaQ format, or less than 2^20 for the Burning Crusade format. - /// - public uint HashTableSize; - - /// - /// Number of entries in the block table - /// - public uint BlockTableSize; - - #endregion - - #region V2 Properties - - /// - /// Offset to the beginning of array of 16-bit high parts of file offsets. - /// - public ulong HiBlockTablePosition; - - /// - /// High 16 bits of the hash table offset for large archives. - /// - public ushort HashTablePositionHi; - - /// - /// High 16 bits of the block table offset for large archives. - /// - public ushort BlockTablePositionHi; - - #endregion - - #region V3 Properties - - /// - /// 64-bit version of the archive size - /// - public ulong ArchiveSizeLong; - - /// - /// 64-bit position of the BET table - /// - public ulong BetTablePosition; - - /// - /// 64-bit position of the HET table - /// - public ulong HetTablePosition; - - #endregion - - #region V4 Properties - - /// - /// Compressed size of the hash table - /// - public ulong HashTableSizeLong; - - /// - /// Compressed size of the block table - /// - public ulong BlockTableSizeLong; - - /// - /// Compressed size of the hi-block table - /// - public ulong HiBlockTableSize; - - /// - /// Compressed size of the HET block - /// - public ulong HetTableSize; - - /// - /// Compressed size of the BET block - /// - public ulong BetTablesize; - - /// - /// Size of raw data chunk to calculate MD5. - /// - /// MD5 of each data chunk follows the raw file data. - public uint RawChunkSize; - - /// - /// MD5 of the block table before decryption - /// - /// 0x10 bytes - public byte[] BlockTableMD5; - - /// - /// MD5 of the hash table before decryption - /// - /// 0x10 bytes - public byte[] HashTableMD5; - - /// - /// MD5 of the hi-block table - /// - /// 0x10 bytes - public byte[] HiBlockTableMD5; - - /// - /// MD5 of the BET table before decryption - /// - /// 0x10 bytes - public byte[] BetTableMD5; - - /// - /// MD5 of the HET table before decryption - /// - /// 0x10 bytes - public byte[] HetTableMD5; - - /// - /// MD5 of the MPQ header from signature to (including) HetTableMD5 - /// - /// 0x10 bytes - public byte[] MpqHeaderMD5; - - #endregion - } -} diff --git a/BinaryObjectScanner.Models/MoPaQ/BetTable.cs b/BinaryObjectScanner.Models/MoPaQ/BetTable.cs deleted file mode 100644 index e6da1f5f..00000000 --- a/BinaryObjectScanner.Models/MoPaQ/BetTable.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.MoPaQ -{ - /// - /// The BET table is present if the BetTablePos64 member of MPQ header is set - /// to nonzero. BET table is a successor of classic block table, and can fully - /// replace it. It is also supposed to be more effective. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class BetTable - { - // TODO: Extract this out and make in common between HET and BET - #region Common Table Headers - - /// - /// 'BET\x1A' - /// - public string Signature; - - /// - /// Version. Seems to be always 1 - /// - public uint Version; - - /// - /// Size of the contained table - /// - public uint DataSize; - - #endregion - - /// - /// Size of the entire hash table, including the header (in bytes) - /// - public uint TableSize; - - /// - /// Number of files in the BET table - /// - public uint FileCount; - - /// - /// Unknown, set to 0x10 - /// - public uint Unknown; - - /// - /// Size of one table entry (in bits) - /// - public uint TableEntrySize; - - /// - /// Bit index of the file position (within the entry record) - /// - public uint FilePositionBitIndex; - - /// - /// Bit index of the file size (within the entry record) - /// - public uint FileSizeBitIndex; - - /// - /// Bit index of the compressed size (within the entry record) - /// - public uint CompressedSizeBitIndex; - - /// - /// Bit index of the flag index (within the entry record) - /// - public uint FlagIndexBitIndex; - - /// - /// Bit index of the ??? (within the entry record) - /// - public uint UnknownBitIndex; - - /// - /// Bit size of file position (in the entry record) - /// - public uint FilePositionBitCount; - - /// - /// Bit size of file size (in the entry record) - /// - public uint FileSizeBitCount; - - /// - /// Bit size of compressed file size (in the entry record) - /// - public uint CompressedSizeBitCount; - - /// - /// Bit size of flags index (in the entry record) - /// - public uint FlagIndexBitCount; - - /// - /// Bit size of ??? (in the entry record) - /// - public uint UnknownBitCount; - - /// - /// Total size of the BET hash - /// - public uint TotalBetHashSize; - - /// - /// Extra bits in the BET hash - /// - public uint BetHashSizeExtra; - - /// - /// Effective size of BET hash (in bits) - /// - public uint BetHashSize; - - /// - /// Size of BET hashes array, in bytes - /// - public uint BetHashArraySize; - - /// - /// Number of flags in the following array - /// - public uint FlagCount; - - /// - /// Followed by array of file flags. Each entry is 32-bit size and its meaning is the same like - /// - /// Size from - public uint[] FlagsArray; - - // File table. Size of each entry is taken from dwTableEntrySize. - // Size of the table is (dwTableEntrySize * dwMaxFileCount), round up to 8. - - // Array of BET hashes. Table size is taken from dwMaxFileCount from HET table - } -} diff --git a/BinaryObjectScanner.Models/MoPaQ/BlockEntry.cs b/BinaryObjectScanner.Models/MoPaQ/BlockEntry.cs deleted file mode 100644 index e2b23b22..00000000 --- a/BinaryObjectScanner.Models/MoPaQ/BlockEntry.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.MoPaQ -{ - /// - /// Block table contains informations about file sizes and way of their storage within - /// the archive. It also contains the position of file content in the archive. Size - /// of block table entry is (like hash table entry). The block table is also encrypted. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class BlockEntry - { - /// - /// Offset of the beginning of the file data, relative to the beginning of the archive. - /// - public uint FilePosition; - - /// - /// Compressed file size - /// - public uint CompressedSize; - - /// - /// Size of uncompressed file - /// - public uint UncompressedSize; - - /// - /// Flags for the file. - /// - public FileFlags Flags; - } -} diff --git a/BinaryObjectScanner.Models/MoPaQ/Constants.cs b/BinaryObjectScanner.Models/MoPaQ/Constants.cs deleted file mode 100644 index 7c4fb5cd..00000000 --- a/BinaryObjectScanner.Models/MoPaQ/Constants.cs +++ /dev/null @@ -1,87 +0,0 @@ -namespace BinaryObjectScanner.Models.MoPaQ -{ - public static class Constants - { - #region Archive Header - - public static readonly byte[] ArchiveHeaderSignatureBytes = new byte[] { 0x4d, 0x50, 0x51, 0x1a }; - - public static readonly string ArchiveHeaderSignatureString = System.Text.Encoding.ASCII.GetString(ArchiveHeaderSignatureBytes); - - public const uint ArchiveHeaderSignatureUInt32 = 0x1a51504d; - - #endregion - - #region User Data - - public static readonly byte[] UserDataSignatureBytes = new byte[] { 0x4d, 0x50, 0x51, 0x1b }; - - public static readonly string UserDataSignatureString = System.Text.Encoding.ASCII.GetString(UserDataSignatureBytes); - - public const uint UserDataSignatureUInt32 = 0x1b51504d; - - #endregion - - #region HET Table - - public static readonly byte[] HetTableSignatureBytes = new byte[] { 0x48, 0x45, 0x54, 0x1a }; - - public static readonly string HetTableSignatureString = System.Text.Encoding.ASCII.GetString(HetTableSignatureBytes); - - public const uint HetTableSignatureUInt32 = 0x1a544548; - - #endregion - - #region BET Table - - public static readonly byte[] BetTableSignatureBytes = new byte[] { 0x42, 0x45, 0x54, 0x1a }; - - public static readonly string BetTableSignatureString = System.Text.Encoding.ASCII.GetString(BetTableSignatureBytes); - - public const uint BetTableSignatureUInt32 = 0x1a544542; - - #endregion - - #region Patch Header - - /// - /// Signature as an unsigned Int32 value - /// - public const uint PatchSignatureValue = 0x48435450; - - /// - /// Signature as an unsigned Int32 value - /// - public const uint Md5SignatureValue = 0x5F35444D; - - /// - /// Signature as an unsigned Int32 value - /// - public const uint XFRMSignatureValue = 0x4D524658; - - /// - /// Signature as an unsigned Int64 value - /// - public const ulong BSDIFF40SignatureValue = 0x3034464649445342; - - #endregion - - #region Encryption - - public const uint MPQ_HASH_KEY2_MIX = 0x400; - - /// - /// Obtained by HashString("(block table)", MPQ_HASH_FILE_KEY) - /// - public const uint MPQ_KEY_BLOCK_TABLE = 0xEC83B3A3; - - /// - /// Obtained by HashString("(hash table)", MPQ_HASH_FILE_KEY) - /// - public const uint MPQ_KEY_HASH_TABLE = 0xC3AF3770; - - public const uint STORM_BUFFER_SIZE = 0x500; - - #endregion - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/MoPaQ/Enums.cs b/BinaryObjectScanner.Models/MoPaQ/Enums.cs deleted file mode 100644 index abbd3be9..00000000 --- a/BinaryObjectScanner.Models/MoPaQ/Enums.cs +++ /dev/null @@ -1,181 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.MoPaQ -{ - /// - /// Compression types for multiple compressions - /// - [Flags] - public enum CompressionType : uint - { - /// - /// Huffmann compression (used on WAVE files only) - /// - MPQ_COMPRESSION_HUFFMANN = 0x01, - - /// - /// ZLIB compression - /// - MPQ_COMPRESSION_ZLIB = 0x02, - - /// - /// PKWARE DCL compression - /// - MPQ_COMPRESSION_PKWARE = 0x08, - - /// - /// BZIP2 compression (added in Warcraft III) - /// - MPQ_COMPRESSION_BZIP2 = 0x10, - - /// - /// Sparse compression (added in Starcraft 2) - /// - MPQ_COMPRESSION_SPARSE = 0x20, - - /// - /// IMA ADPCM compression (mono) - /// - MPQ_COMPRESSION_ADPCM_MONO = 0x40, - - /// - /// IMA ADPCM compression (stereo) - /// - MPQ_COMPRESSION_ADPCM_STEREO = 0x80, - - /// - /// LZMA compression. Added in Starcraft 2. This value is NOT a combination of flags. - /// - MPQ_COMPRESSION_LZMA = 0x12, - - /// - /// Same compression - /// - MPQ_COMPRESSION_NEXT_SAME = 0xFFFFFFFF, - } - - [Flags] - public enum FileFlags : uint - { - /// - /// File is compressed using PKWARE Data compression library - /// - MPQ_FILE_IMPLODE = 0x00000100, - - /// - /// File is compressed using combination of compression methods - /// - MPQ_FILE_COMPRESS = 0x00000200, - - /// - /// The file is encrypted - /// - MPQ_FILE_ENCRYPTED = 0x00010000, - - /// - /// The decryption key for the file is altered according to the - /// position of the file in the archive - /// - MPQ_FILE_FIX_KEY = 0x00020000, - - /// - /// The file contains incremental patch for an existing file in base MPQ - /// - MPQ_FILE_PATCH_FILE = 0x00100000, - - /// - /// Instead of being divided to 0x1000-bytes blocks, the file is stored - /// as single unit - /// - MPQ_FILE_SINGLE_UNIT = 0x01000000, - - /// - /// File is a deletion marker, indicating that the file no longer exists. - /// This is used to allow patch archives to delete files present in - /// lower-priority archives in the search chain. The file usually has - /// length of 0 or 1 byte and its name is a hash - /// - MPQ_FILE_DELETE_MARKER = 0x02000000, - - /// - /// File has checksums for each sector (explained in the File Data section). - /// Ignored if file is not compressed or imploded. - /// - MPQ_FILE_SECTOR_CRC = 0x04000000, - - /// - /// Set if file exists, reset when the file was deleted - /// - MPQ_FILE_EXISTS = 0x80000000, - } - - public enum FormatVersion : ushort - { - /// - /// Format 1 (up to The Burning Crusade) - /// - Format1 = 0, - - /// - /// Format 2 (The Burning Crusade and newer) - /// - Format2 = 1, - - /// - /// Format 3 (WoW - Cataclysm beta or newer) - /// - Format3 = 2, - - /// - /// Format 4 (WoW - Cataclysm beta or newer) - /// - Format4 = 3, - } - - public enum Locale : short - { - Neutral = 0, - AmericanEnglish = 0, - ChineseTaiwan = 0x404, - Czech = 0x405, - German = 0x407, - English = 0x409, - Spanish = 0x40A, - French = 0x40C, - Italian = 0x410, - Japanese = 0x411, - Korean = 0x412, - Polish = 0x415, - Portuguese = 0x416, - Russian = 0x419, - EnglishUK = 0x809, - } - - public enum PatchType : uint - { - /// - /// Blizzard-modified version of BSDIFF40 incremental patch - /// - BSD0 = 0x30445342, - - /// - /// Unknown - /// - BSDP = 0x50445342, - - /// - /// Plain replace - /// - COPY = 0x59504F43, - - /// - /// Unknown - /// - COUP = 0x50554F43, - - /// - /// Unknown - /// - CPOG = 0x474F5043, - } -} diff --git a/BinaryObjectScanner.Models/MoPaQ/HashEntry.cs b/BinaryObjectScanner.Models/MoPaQ/HashEntry.cs deleted file mode 100644 index 8f0319ae..00000000 --- a/BinaryObjectScanner.Models/MoPaQ/HashEntry.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.MoPaQ -{ - /// - /// Hash table is used for searching files by name. The file name is converted to - /// two 32-bit hash values, which are then used for searching in the table. The size - /// of the hash table must always be a power of two. Each entry in the hash table - /// also contains file locale and offset into block table. Size of one entry of hash - /// table is 16 bytes. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class HashEntry - { - /// - /// The hash of the full file name (part A) - /// - public uint NameHashPartA; - - /// - /// The hash of the full file name (part B) - /// - public uint NameHashPartB; - - /// - /// The language of the file. This is a Windows LANGID data type, and uses the same values. - /// 0 indicates the default language (American English), or that the file is language-neutral. - /// - public Locale Locale; - - /// - /// The platform the file is used for. 0 indicates the default platform. - /// No other values have been observed. - /// - public ushort Platform; - - /// - /// If the hash table entry is valid, this is the index into the block table of the file. - /// Otherwise, one of the following two values: - /// - FFFFFFFFh: Hash table entry is empty, and has always been empty. - /// Terminates searches for a given file. - /// - FFFFFFFEh: Hash table entry is empty, but was valid at some point (a deleted file). - /// Does not terminate searches for a given file. - /// - public uint BlockIndex; - } -} diff --git a/BinaryObjectScanner.Models/MoPaQ/HetTable.cs b/BinaryObjectScanner.Models/MoPaQ/HetTable.cs deleted file mode 100644 index 1b68eb11..00000000 --- a/BinaryObjectScanner.Models/MoPaQ/HetTable.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.MoPaQ -{ - /// - /// The HET table is present if the HetTablePos64 member of MPQ header is - /// set to nonzero. This table can fully replace hash table. Depending on - /// MPQ size, the pair of HET&BET table can be more efficient than Hash&Block - /// table. HET table can be encrypted and compressed. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class HetTable - { - // TODO: Extract this out and make in common between HET and BET - #region Common Table Headers - - /// - /// 'HET\x1A' - /// - public string Signature; - - /// - /// Version. Seems to be always 1 - /// - public uint Version; - - /// - /// Size of the contained table - /// - public uint DataSize; - - #endregion - - /// - /// Size of the entire hash table, including the header (in bytes) - /// - public uint TableSize; - - /// - /// Maximum number of files in the MPQ - /// - public uint MaxFileCount; - - /// - /// Size of the hash table (in bytes) - /// - public uint HashTableSize; - - /// - /// Effective size of the hash entry (in bits) - /// - public uint HashEntrySize; - - /// - /// Total size of file index (in bits) - /// - public uint TotalIndexSize; - - /// - /// Extra bits in the file index - /// - public uint IndexSizeExtra; - - /// - /// Effective size of the file index (in bits) - /// - public uint IndexSize; - - /// - /// Size of the block index subtable (in bytes) - /// - public uint BlockTableSize; - - /// - /// HET hash table. Each entry is 8 bits. - /// - /// Size is derived from HashTableSize - public byte[] HashTable; - - /// - /// Array of file indexes. Bit size of each entry is taken from dwTotalIndexSize. - /// Table size is taken from dwHashTableSize. - /// - public byte[][] FileIndexes; - } -} diff --git a/BinaryObjectScanner.Models/MoPaQ/PatchHeader.cs b/BinaryObjectScanner.Models/MoPaQ/PatchHeader.cs deleted file mode 100644 index 306747b9..00000000 --- a/BinaryObjectScanner.Models/MoPaQ/PatchHeader.cs +++ /dev/null @@ -1,118 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.MoPaQ -{ - /// - /// Each incremental patch file in a patch MPQ starts with a header. It is supposed - /// to be a structure with variable length. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class PatchHeader - { - #region PATCH Header - - /// - /// 'PTCH' - /// - public uint PatchSignature { get; private set; } - - /// - /// Size of the entire patch (decompressed) - /// - public int SizeOfPatchData { get; private set; } - - /// - /// Size of the file before patch - /// - public int SizeBeforePatch { get; private set; } - - /// - /// Size of file after patch - /// - public int SizeAfterPatch { get; private set; } - - #endregion - - #region MD5 Block - - /// - /// 'MD5_' - /// - public uint Md5Signature { get; private set; } - - /// - /// Size of the MD5 block, including the signature and size itself - /// - public int Md5BlockSize { get; private set; } - - /// - /// MD5 of the original (unpached) file - /// - public byte[] Md5BeforePatch { get; private set; } = new byte[0x10]; - - /// - /// MD5 of the patched file - /// - public byte[] Md5AfterPatch { get; private set; } = new byte[0x10]; - - #endregion - - #region XFRM Block - - /// - /// 'XFRM' - /// - public uint XfrmSignature { get; private set; } - - /// - /// Size of the XFRM block, includes XFRM header and patch data - /// - public int XfrmBlockSize { get; private set; } - - /// - /// Type of patch ('BSD0' or 'COPY') - /// - public PatchType PatchType { get; private set; } - - #endregion - - #region Patch Data - BSD0 - - /// - /// 'BSDIFF40' signature - /// - public ulong BsdiffSignature { get; private set; } - - /// - /// Size of CTRL block (in bytes) - /// - public long CtrlBlockSize { get; private set; } - - /// - /// Size of DATA block (in bytes) - /// - public long DataBlockSize { get; private set; } - - /// - /// Size of file after applying the patch (in bytes) - /// - public long NewFileSize { get; private set; } - - // TODO: Fill rest of data from http://zezula.net/en/mpq/patchfiles.html - // CTRL block - // DATA block - // EXTRA block - - #endregion - - #region Patch Data - COPY - - /// - /// File data are simply replaced by the data in the patch. - /// - public byte[] PatchDataCopy { get; private set; } - - #endregion - } -} diff --git a/BinaryObjectScanner.Models/MoPaQ/PatchInfo.cs b/BinaryObjectScanner.Models/MoPaQ/PatchInfo.cs deleted file mode 100644 index d7a5bbcf..00000000 --- a/BinaryObjectScanner.Models/MoPaQ/PatchInfo.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.MoPaQ -{ - /// - /// This structure contains size of the patch, flags and also MD5 of the patch. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class PatchInfo - { - /// - /// Length of patch info header, in bytes - /// - public uint Length; - - /// - /// Flags. 0x80000000 = MD5 (?) - /// - public uint Flags; - - /// - /// Uncompressed size of the patch file - /// - public uint DataSize; - - /// - /// MD5 of the entire patch file after decompression - /// - /// 0x10 bytes - public byte[] MD5; - - /// - /// The sector offset table (variable length) - /// - public uint[] SectorOffsetTable; - } -} diff --git a/BinaryObjectScanner.Models/MoPaQ/UserData.cs b/BinaryObjectScanner.Models/MoPaQ/UserData.cs deleted file mode 100644 index eceeb84f..00000000 --- a/BinaryObjectScanner.Models/MoPaQ/UserData.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.MoPaQ -{ - /// - /// MPQ User Data are optional, and is commonly used in custom maps for - /// Starcraft II. If MPQ User Data header is present, it contains an offset, - /// from where the MPQ header should be searched. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class UserData - { - /// - /// The user data signature - /// - /// - public string Signature; - - /// - /// Maximum size of the user data - /// - public uint UserDataSize; - - /// - /// Offset of the MPQ header, relative to the beginning of this header - /// - public uint HeaderOffset; - - /// - /// Appears to be size of user data header (Starcraft II maps) - /// - public uint UserDataHeaderSize; - - // TODO: Does this area contain extra data that should be read in? - } -} diff --git a/BinaryObjectScanner.Models/N3DS/ARM11KernelCapabilities.cs b/BinaryObjectScanner.Models/N3DS/ARM11KernelCapabilities.cs deleted file mode 100644 index ebaa644b..00000000 --- a/BinaryObjectScanner.Models/N3DS/ARM11KernelCapabilities.cs +++ /dev/null @@ -1,44 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// The kernel capability descriptors are passed to svcCreateProcess. - /// - /// - public sealed class ARM11KernelCapabilities - { - /// - /// Descriptors - /// ------------------- - /// Pattern of bits 20-31 Type Fields - /// 0b1110xxxxxxxx Interrupt info - /// 0b11110xxxxxxx System call mask Bits 24-26: System call mask table index; Bits 0-23: mask - /// 0b1111110xxxxx Kernel release version Bits 8-15: Major version; Bits 0-7: Minor version - /// 0b11111110xxxx Handle table size Bits 0-18: size - /// 0b111111110xxx Kernel flags - /// 0b11111111100x Map address range Describes a memory mapping like the 0b111111111110 descriptor, but an entire range rather than a single page is mapped.Another 0b11111111100x descriptor must follow this one to denote the(exclusive) end of the address range to map. - /// 0b111111111110 Map memory page Bits 0-19: page index to map(virtual address >> 12; the physical address is determined per-page according to Memory layout); Bit 20: Map read-only(otherwise read-write) - /// - /// ARM11 Kernel Flags - /// ------------------- - /// Bit Description - /// 0 Allow debug - /// 1 Force debug - /// 2 Allow non-alphanum - /// 3 Shared page writing - /// 4 Privilege priority - /// 5 Allow main() args - /// 6 Shared device memory - /// 7 Runnable on sleep - /// 8-11 Memory type(1: application, 2: system, 3: base) - /// 12 Special memory - /// 13 Process has access to CPU core 2 (New3DS only) - /// - /// TODO: Make enum for flag values - public uint[] Descriptors; - - /// - /// Reserved - /// - public byte[] Reserved; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/ARM11LocalSystemCapabilities.cs b/BinaryObjectScanner.Models/N3DS/ARM11LocalSystemCapabilities.cs deleted file mode 100644 index d8c4049e..00000000 --- a/BinaryObjectScanner.Models/N3DS/ARM11LocalSystemCapabilities.cs +++ /dev/null @@ -1,66 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - public sealed class ARM11LocalSystemCapabilities - { - /// - /// Program ID - /// - public ulong ProgramID; - - /// - /// Core version (The Title ID low of the required FIRM) - /// - public uint CoreVersion; - - /// - /// Flag1 (implemented starting from 8.0.0-18). - /// - public ARM11LSCFlag1 Flag1; - - /// - /// Flag2 (implemented starting from 8.0.0-18). - /// - public ARM11LSCFlag2 Flag2; - - /// - /// Flag0 - /// - public ARM11LSCFlag0 Flag0; - - /// - /// Priority - /// - public byte Priority; - - /// - /// Resource limit descriptors. The first byte here controls the maximum allowed CpuTime. - /// - public ushort[] ResourceLimitDescriptors; - - /// - /// Storage info - /// - public StorageInfo StorageInfo; - - /// - /// Service access control - /// - public ulong[] ServiceAccessControl; - - /// - /// Extended service access control, support for this was implemented with 9.3.0-X. - /// - public ulong[] ExtendedServiceAccessControl; - - /// - /// Reserved - /// - public byte[] Reserved; - - /// - /// Resource limit category. (0 = APPLICATION, 1 = SYS_APPLET, 2 = LIB_APPLET, 3 = OTHER (sysmodules running under the BASE memregion)) - /// - public ResourceLimitCategory ResourceLimitCategory; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/ARM9AccessControl.cs b/BinaryObjectScanner.Models/N3DS/ARM9AccessControl.cs deleted file mode 100644 index 78d47d62..00000000 --- a/BinaryObjectScanner.Models/N3DS/ARM9AccessControl.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - public sealed class ARM9AccessControl - { - /// - /// Descriptors - /// - public byte[] Descriptors; - - /// - /// ARM9 Descriptor Version. Originally this value had to be ≥ 2. - /// Starting with 9.3.0-X this value has to be either value 2 or value 3. - /// - public byte DescriptorVersion; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/AccessControlInfo.cs b/BinaryObjectScanner.Models/N3DS/AccessControlInfo.cs deleted file mode 100644 index 95aaa127..00000000 --- a/BinaryObjectScanner.Models/N3DS/AccessControlInfo.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - public sealed class AccessControlInfo - { - /// - /// ARM11 local system capabilities - /// - public ARM11LocalSystemCapabilities ARM11LocalSystemCapabilities; - - /// - /// ARM11 kernel capabilities - /// - public ARM11KernelCapabilities ARM11KernelCapabilities; - - /// - /// ARM9 access control - /// - public ARM9AccessControl ARM9AccessControl; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/CIA.cs b/BinaryObjectScanner.Models/N3DS/CIA.cs deleted file mode 100644 index f6c612e0..00000000 --- a/BinaryObjectScanner.Models/N3DS/CIA.cs +++ /dev/null @@ -1,56 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// CIA stands for CTR Importable Archive. This format allows the installation of - /// titles to the 3DS. CIA files and titles on Nintendo's CDN contain identical data. - /// As a consequence, valid CIA files can be generated from CDN content. This also - /// means CIA files can contain anything that titles on Nintendo's CDN can contain. - /// - /// Under normal circumstances CIA files are used where downloading a title is - /// impractical or not possible. Such as distributing a Download Play child, or - /// installing forced Gamecard updates. Those CIA(s) are stored by the titles in - /// question, in an auxiliary CFA file. - /// - /// - public class CIA - { - /// - /// CIA header - /// - public CIAHeader Header { get; set; } - - /// - /// Certificate chain - /// - /// - /// https://www.3dbrew.org/wiki/CIA#Certificate_Chain - /// - public Certificate[] CertificateChain { get; set; } - - /// - /// Ticket - /// - public Ticket Ticket { get; set; } - - /// - /// TMD file data - /// - public TitleMetadata TMDFileData { get; set; } - - /// - /// Content file data - /// - public NCCHHeader[] Partitions { get; set; } - - /// - /// Content file data - /// - /// TODO: Parse the content file data - public byte[] ContentFileData { get; set; } - - /// - /// Meta file data (Not a necessary component) - /// - public MetaData MetaData { get; set; } - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/N3DS/CIAHeader.cs b/BinaryObjectScanner.Models/N3DS/CIAHeader.cs deleted file mode 100644 index f2929539..00000000 --- a/BinaryObjectScanner.Models/N3DS/CIAHeader.cs +++ /dev/null @@ -1,51 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - public sealed class CIAHeader - { - /// - /// Archive header size, usually 0x2020 bytes - /// - public uint HeaderSize; - - /// - /// Type - /// - public ushort Type; - - /// - /// Version - /// - public ushort Version; - - /// - /// Certificate chain size - /// - public uint CertificateChainSize; - - /// - /// Ticket size - /// - public uint TicketSize; - - /// - /// TMD file size - /// - public uint TMDFileSize; - - /// - /// Meta size (0 if no Meta data is present) - /// - public uint MetaSize; - - /// - /// Content size - /// - public ulong ContentSize; - - /// - /// Content Index - /// - public byte[] ContentIndex; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/N3DS/CardInfoHeader.cs b/BinaryObjectScanner.Models/N3DS/CardInfoHeader.cs deleted file mode 100644 index 79399726..00000000 --- a/BinaryObjectScanner.Models/N3DS/CardInfoHeader.cs +++ /dev/null @@ -1,61 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - public sealed class CardInfoHeader - { - /// - /// CARD2: Writable Address In Media Units (For 'On-Chip' Savedata). CARD1: Always 0xFFFFFFFF. - /// - public uint WritableAddressMediaUnits; - - /// - /// Card Info Bitmask - /// - public uint CardInfoBitmask; - - /// - /// Reserved - /// - public byte[] Reserved1; - - /// - /// Filled size of cartridge - /// - public uint FilledSize; - - /// - /// Reserved - /// - public byte[] Reserved2; - - /// - /// Title version - /// - public ushort TitleVersion; - - /// - /// Card revision - /// - public ushort CardRevision; - - /// - /// Reserved - /// - public byte[] Reserved3; - - /// - /// Title ID of CVer in included update partition - /// - public byte[] CVerTitleID; - - /// - /// Version number of CVer in included update partition - /// - public ushort CVerVersionNumber; - - /// - /// Reserved - /// - public byte[] Reserved4; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/Cart.cs b/BinaryObjectScanner.Models/N3DS/Cart.cs deleted file mode 100644 index 940738fd..00000000 --- a/BinaryObjectScanner.Models/N3DS/Cart.cs +++ /dev/null @@ -1,43 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// Represents a 3DS cart image - /// - public class Cart - { - /// - /// 3DS cart header - /// - public NCSDHeader Header { get; set; } - - /// - /// 3DS card info header - /// - public CardInfoHeader CardInfoHeader { get; set; } - - /// - /// 3DS development card info header - /// - public DevelopmentCardInfoHeader DevelopmentCardInfoHeader { get; set; } - - /// - /// NCCH partitions - /// - public NCCHHeader[] Partitions { get; set; } - - /// - /// NCCH extended headers - /// - public NCCHExtendedHeader[] ExtendedHeaders { get; set; } - - /// - /// ExeFS headers associated with each partition - /// - public ExeFSHeader[] ExeFSHeaders { get; set; } - - /// - /// RomFS headers associated with each partition - /// - public RomFSHeader[] RomFSHeaders { get; set; } - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/N3DS/Certificate.cs b/BinaryObjectScanner.Models/N3DS/Certificate.cs deleted file mode 100644 index 71baa7e4..00000000 --- a/BinaryObjectScanner.Models/N3DS/Certificate.cs +++ /dev/null @@ -1,92 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// Certificates contain cryptography information for verifying Signatures. - /// These certificates are also signed. The parent/child relationship between - /// certificates, makes all the certificates effectively signed by 'Root', - /// the public key for which is stored in NATIVE_FIRM. - /// - /// - public sealed class Certificate - { - /// - /// Signature Type - /// - public SignatureType SignatureType; - - /// - /// Signature size - /// - public ushort SignatureSize; - - /// - /// Padding size - /// - public byte PaddingSize; - - /// - /// Signature - /// - public byte[] Signature; - - /// - /// Padding to align next data to 0x40 bytes - /// - public byte[] Padding; - - /// - /// Issuer - /// - public string Issuer; - - /// - /// Key Type - /// - public PublicKeyType KeyType; - - /// - /// Name - /// - public string Name; - - /// - /// Expiration time as UNIX Timestamp, used at least for CTCert - /// - public uint ExpirationTime; - - // This contains the Public Key (i.e. Modulus & Public Exponent) - #region RSA-4096 and RSA-2048 - - /// - /// Modulus - /// - public byte[] RSAModulus; - - /// - /// Public Exponent - /// - public uint RSAPublicExponent; - - /// - /// Padding - /// - public byte[] RSAPadding; - - #endregion - - // This contains the ECC public key, and is as follows: - #region ECC - - /// - /// Public Key - /// - public byte[] ECCPublicKey; - - /// - /// Padding - /// - public byte[] ECCPadding; - - #endregion - } -} diff --git a/BinaryObjectScanner.Models/N3DS/CodeSetInfo.cs b/BinaryObjectScanner.Models/N3DS/CodeSetInfo.cs deleted file mode 100644 index 4992e2de..00000000 --- a/BinaryObjectScanner.Models/N3DS/CodeSetInfo.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - public sealed class CodeSetInfo - { - /// - /// Address - /// - public uint Address; - - /// - /// Physical region size (in page-multiples) - /// - public uint PhysicalRegionSizeInPages; - - /// - /// Size (in bytes) - /// - public uint SizeInBytes; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/Constants.cs b/BinaryObjectScanner.Models/N3DS/Constants.cs deleted file mode 100644 index b5b8a8d7..00000000 --- a/BinaryObjectScanner.Models/N3DS/Constants.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - public static class Constants - { - // ExeFS - public static readonly byte[] CodeSegmentName = new byte[] { 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x00, 0x00, 0x00 }; // .code\0\0\0 - - // NCCH - public const string NCCHMagicNumber = "NCCH"; - - // NCSD - public const string NCSDMagicNumber = "NCSD"; - - // RomFS - public const string RomFSMagicNumber = "IVFC"; - public const uint RomFSSecondMagicNumber = 0x10000; - - // Setup Keys and IVs - public static byte[] PlainCounter = new byte[] { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - public static byte[] ExefsCounter = new byte[] { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - public static byte[] RomfsCounter = new byte[] { 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - public const int CXTExtendedDataHeaderLength = 0x800; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/ContentChunkRecord.cs b/BinaryObjectScanner.Models/N3DS/ContentChunkRecord.cs deleted file mode 100644 index 0d4689a8..00000000 --- a/BinaryObjectScanner.Models/N3DS/ContentChunkRecord.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// There is one of these for each content contained in this title. - /// (Determined by "Content Count" in the TMD Header). - /// - /// - public sealed class ContentChunkRecord - { - /// - /// Content id - /// - public uint ContentId; - - /// - /// Content index - /// - /// - /// This does not apply to DLC. - /// - public ContentIndex ContentIndex; - - /// - /// Content type - /// - public TMDContentType ContentType; - - /// - /// Content size - /// - public ulong ContentSize; - - /// - /// SHA-256 hash - /// - public byte[] SHA256Hash; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/N3DS/ContentInfoRecord.cs b/BinaryObjectScanner.Models/N3DS/ContentInfoRecord.cs deleted file mode 100644 index 0ddf2b40..00000000 --- a/BinaryObjectScanner.Models/N3DS/ContentInfoRecord.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// There are 64 of these records, usually only the first is used. - /// - /// - public sealed class ContentInfoRecord - { - /// - /// Content index offset - /// - public ushort ContentIndexOffset; - - /// - /// Content command count [k] - /// - public ushort ContentCommandCount; - - /// - /// SHA-256 hash of the next k content records that have not been hashed yet - /// - public byte[] UnhashedContentRecordsSHA256Hash; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/N3DS/DevelopmentCardInfoHeader.cs b/BinaryObjectScanner.Models/N3DS/DevelopmentCardInfoHeader.cs deleted file mode 100644 index 1a436129..00000000 --- a/BinaryObjectScanner.Models/N3DS/DevelopmentCardInfoHeader.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - public sealed class DevelopmentCardInfoHeader - { - /// - /// InitialData - /// - public InitialData InitialData; - - /// - /// CardDeviceReserved1 - /// - public byte[] CardDeviceReserved1; - - /// - /// TitleKey - /// - public byte[] TitleKey; - - /// - /// CardDeviceReserved2 - /// - public byte[] CardDeviceReserved2; - - /// - /// TestData - /// - public TestData TestData; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/Enums.cs b/BinaryObjectScanner.Models/N3DS/Enums.cs deleted file mode 100644 index 18fd98db..00000000 --- a/BinaryObjectScanner.Models/N3DS/Enums.cs +++ /dev/null @@ -1,230 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.N3DS -{ - // TODO: Fix this, I don't think it's correct - [Flags] - public enum ARM9AccessControlDescriptors : byte - { - MountNandRoot = 0x01, - MountNandroWriteAccess = 0x02, - MountTwlnRoot = 0x04, - MountWnandRoot = 0x08, - MountCardSPI = 0x0F, - UseSDIF3 = 0x10, - CreateSeed = 0x20, - UseCardSPI = 0x40, - SDApplication = 0x80, - MountSdmcWriteAccess = 0xF0, - } - - [Flags] - public enum ARM11LSCFlag0 : byte - { - IdealProcessor = 0x01 | 0x02, - - AffinityMask = 0x04 | 0x08, - - /// - /// Value Description - /// 0 Prod (64MB of usable application memory) - /// 1 Undefined (unusable) - /// 2 Dev1 (96MB of usable application memory) - /// 3 Dev2 (80MB of usable application memory) - /// 4 Dev3 (72MB of usable application memory) - /// 5 Dev4 (32MB of usable application memory) - /// 6-7 Undefined Same as Prod? - /// - Old3DSSystemMode = 0x0F | 0x10 | 0x20 | 0x40, - } - - [Flags] - public enum ARM11LSCFlag1 : byte - { - EnableL2Cache = 0x01, - Cpuspeed_804MHz = 0x02, - } - - [Flags] - public enum ARM11LSCFlag2 : byte - { - /// - /// Value Description - /// 0 Legacy (use Old3DS system mode) - /// 1 Prod (124MB of usable application memory) - /// 2 Dev1 (178MB of usable application memory) - /// 3 Dev2 (124MB of usable application memory) - /// 4-7 Undefined Same as Prod? - /// - New3DSSystemMode = 0x01 | 0x02 | 0x04 | 0x08, - } - - [Flags] - public enum BitMasks : byte - { - FixedCryptoKey = 0x01, - NoMountRomFs = 0x02, - NoCrypto = 0x04, - NewKeyYGenerator = 0x20, - } - - public enum ContentIndex : ushort - { - /// - /// Main Content (.CXI for 3DS executable content/.CFA for 3DS Data Archives/.SRL for TWL content) - /// - MainContent = 0x0000, - - /// - /// Home Menu Manual (.CFA) - /// - HomeMenuManual = 0x0001, - - /// - /// DLP Child Container (.CFA) - /// - DLPChildContainer = 0x0002, - } - - public enum ContentPlatform : byte - { - CTR = 0x01, - Snake = 0x02, // New3DS - } - - [Flags] - public enum ContentType : byte - { - Data = 0x01, - Executable = 0x02, - SystemUpdate = 0x04, - Manual = 0x08, - Child = 0x04 | 0x08, - Trial = 0x10, - } - - public enum CryptoMethod : byte - { - Original = 0x00, - Seven = 0x01, - NineThree = 0x0A, - NineSix = 0x0B, - } - - [Flags] - public enum FilesystemAccessInfo : ulong - { - CategorySystemApplication = 0x1, - CategoryHardwareCheck = 0x2, - CategoryFilesystemTool = 0x4, - Debug = 0x8, - TWLCardBackup = 0x10, - TWLNANDData = 0x20, - BOSS = 0x40, - sdmcRoot = 0x80, - Core = 0x100, - nandRootroReadOnly = 0x200, - nandRootrw = 0x400, - nandrootroWriteAccess = 0x800, - CategorySystemSettings = 0x1000, - Cardboard = 0x2000, - ExportImportIVS = 0x4000, - sdmcRootWriteOnly = 0x8000, - SwitchCleanup = 0x10000, // Introduced in 3.0.0? - SavedataMove = 0x20000, // Introduced in 5.0.0 - Shop = 0x40000, // Introduced in 5.0.0 - Shell = 0x80000, // Introduced in 5.0.0 - CategoryHomeMenu = 0x100000, // Introduced in 6.0.0 - SeedDB = 0x200000, // Introduced in 9.6.0-X FIRM. Home Menu has this bit set starting with 9.6.0-X. - } - - public enum FilesystemType : ulong - { - None = 0, - Normal = 1, - FIRM = 3, - AGB_FIRMSave = 4, - } - - public enum MediaCardDeviceType : byte - { - NORFlash = 0x01, - None = 0x02, - BT = 0x03, - } - - public enum MediaPlatformIndex : byte - { - CTR = 0x01, - } - - public enum MediaTypeIndex : byte - { - InnerDevice = 0x00, - Card1 = 0x01, - Card2 = 0x02, - ExtendedDevice = 0x03, - } - - public enum NCCHFlags - { - CryptoMethod = 0x03, - ContentPlatform = 0x04, - ContentTypeBitMask = 0x05, - ContentUnitSize = 0x06, - BitMasks = 0x07, - } - - public enum NCSDFlags - { - BackupWriteWaitTime = 0x00, - MediaCardDevice3X = 0x03, - MediaPlatformIndex = 0x04, - MediaTypeIndex = 0x05, - MediaUnitSize = 0x06, - MediaCardDevice2X = 0x07, - } - - public enum PublicKeyType : uint - { - RSA_4096 = 0x00000000, - RSA_2048 = 0x01000000, - EllipticCurve = 0x02000000, - } - - public enum ResourceLimitCategory - { - APPLICATION = 0, - SYS_APPLET = 1, - LIB_APPLET = 2, - OTHER = 3, - } - - // Note: These are reversed because of how C# reads values - public enum SignatureType : uint - { - RSA_4096_SHA1 = 0x00000100, - RSA_2048_SHA1 = 0x01000100, - ECDSA_SHA1 = 0x02000100, - RSA_4096_SHA256 = 0x03000100, - RSA_2048_SHA256 = 0x04000100, - ECDSA_SHA256 = 0x05000100, - } - - [Flags] - public enum StorageInfoOtherAttributes : byte - { - NotUseROMFS = 0x01, - UseExtendedSavedataAccess = 0x02, - } - - [Flags] - public enum TMDContentType : ushort - { - Encrypted = 0x0001, - Disc = 0x0002, - CFM = 0x0004, - Optional = 0x4000, - Shared = 0x8000, - } -} diff --git a/BinaryObjectScanner.Models/N3DS/ExeFSFileHeader.cs b/BinaryObjectScanner.Models/N3DS/ExeFSFileHeader.cs deleted file mode 100644 index 4176c7c1..00000000 --- a/BinaryObjectScanner.Models/N3DS/ExeFSFileHeader.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// There are a maximum of 10 file headers in the ExeFS format. (This maximum - /// number of file headers is disputable, with makerom indicating a maximum of - /// 8 sections and makecia indicating a maximum of 10. From a non-SDK point of - /// view, the ExeFS header format can hold no more than 10 file headers within - /// the currently define size of 0x200 bytes.) - /// - /// - public sealed class ExeFSFileHeader - { - /// - /// File name - /// - public string FileName; - - /// - /// File offset - /// - public uint FileOffset; - - /// - /// File size - /// - public uint FileSize; - - /// - /// SHA256 hash calculated over the entire file contents - /// - public byte[] FileHash; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/ExeFSHeader.cs b/BinaryObjectScanner.Models/N3DS/ExeFSHeader.cs deleted file mode 100644 index 94ab4496..00000000 --- a/BinaryObjectScanner.Models/N3DS/ExeFSHeader.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// ExeFS or Executable Filesystem contains information related to the - /// executable program, and is the part of the CXI format. - /// - /// The ExeFS usually contains one or more of the following files: - /// - .code Contains the code binary, which can be optionally reverse-LZSS compressed via an exheader flag. - /// - logo Contains distribution licensing Binary data. - /// - banner Contains the banner which homemenu uses for this CXI. - /// - icon Contains the icon which homemenu displays for this CXI. - /// - /// - public sealed class ExeFSHeader - { - /// - /// File headers (10 headers maximum, 16 bytes each) - /// - public ExeFSFileHeader[] FileHeaders; - - /// - /// Reserved - /// - public byte[] Reserved; - - /// - /// File hashes (10 hashes maximum, 32 bytes each, one for each header) - /// - /// SHA-256 hashes - public byte[][] FileHashes; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/InitialData.cs b/BinaryObjectScanner.Models/N3DS/InitialData.cs deleted file mode 100644 index 27e84690..00000000 --- a/BinaryObjectScanner.Models/N3DS/InitialData.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - public sealed class InitialData - { - /// - /// Card seed keyY (first u64 is Media ID (same as first NCCH partitionId)) - /// - public byte[] CardSeedKeyY; - - /// - /// Encrypted card seed (AES-CCM, keyslot 0x3B for retail cards, see CTRCARD_SECSEED) - /// - public byte[] EncryptedCardSeed; - - /// - /// Card seed AES-MAC - /// - public byte[] CardSeedAESMAC; - - /// - /// Card seed nonce - /// - public byte[] CardSeedNonce; - - /// - /// Reserved3 - /// - public byte[] Reserved; - - /// - /// Copy of first NCCH header (excluding RSA signature) - /// - public NCCHHeader BackupHeader; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/MetaData.cs b/BinaryObjectScanner.Models/N3DS/MetaData.cs deleted file mode 100644 index 70d10e42..00000000 --- a/BinaryObjectScanner.Models/N3DS/MetaData.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - public sealed class MetaData - { - /// - /// Title ID dependency list - Taken from the application's ExHeader - /// - /// TODO: Determine numeric format of each entry - public byte[] TitleIDDependencyList; - - /// - /// Reserved - /// - public byte[] Reserved1; - - /// - /// Core Version - /// - public uint CoreVersion; - - /// - /// Reserved - /// - public byte[] Reserved2; - - /// - /// Icon Data(.ICN) - Taken from the application's ExeFS - /// - public byte[] IconData; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/N3DS/NCCHExtendedHeader.cs b/BinaryObjectScanner.Models/N3DS/NCCHExtendedHeader.cs deleted file mode 100644 index be55030d..00000000 --- a/BinaryObjectScanner.Models/N3DS/NCCHExtendedHeader.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// The exheader has two sections: - /// - The actual exheader data, containing System Control Info (SCI) and Access Control Info (ACI); - /// - A signed copy of NCCH HDR public key, and exheader ACI. This version of the ACI is used as limitation to the actual ACI. - /// - /// - public sealed class NCCHExtendedHeader - { - /// - /// SCI - /// - public SystemControlInfo SCI; - - /// - /// ACI - /// - public AccessControlInfo ACI; - - /// - /// AccessDesc signature (RSA-2048-SHA256) - /// - public byte[] AccessDescSignature; - - /// - /// NCCH HDR RSA-2048 public key - /// - public byte[] NCCHHDRPublicKey; - - /// - /// ACI (for limitation of first ACI) - /// - public AccessControlInfo ACIForLimitations; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/NCCHHeader.cs b/BinaryObjectScanner.Models/N3DS/NCCHHeader.cs deleted file mode 100644 index 5833d5c1..00000000 --- a/BinaryObjectScanner.Models/N3DS/NCCHHeader.cs +++ /dev/null @@ -1,156 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - public sealed class NCCHHeader - { - /// - /// RSA-2048 signature of the NCCH header, using SHA-256. - /// - public byte[] RSA2048Signature; - - /// - /// Magic ID, always 'NCCH' - /// - public string MagicID; - - /// - /// Content size, in media units (1 media unit = 0x200 bytes) - /// - public uint ContentSizeInMediaUnits; - - /// - /// Partition ID - /// - public ulong PartitionId; - - /// - /// Maker code - /// - public ushort MakerCode; - - /// - /// Version - /// - public ushort Version; - - /// - /// When ncchflag[7] = 0x20 starting with FIRM 9.6.0-X, this is compared with the first output u32 from a - /// SHA256 hash. The data used for that hash is 0x18-bytes: [0x10-long title-unique content lock seed] - /// [programID from NCCH + 0x118]. This hash is only used for verification of the content lock seed, and - /// is not the actual keyY. - /// - public uint VerificationHash; - - /// - /// Program ID - /// - public byte[] ProgramId; - - /// - /// Reserved - /// - public byte[] Reserved1; - - /// - /// Logo Region SHA-256 hash. (For applications built with SDK 5+) (Supported from firmware: 5.0.0-11) - /// - public byte[] LogoRegionHash; - - /// - /// Product code - /// - public string ProductCode; - - /// - /// Extended header SHA-256 hash (SHA256 of 2x Alignment Size, beginning at 0x0 of ExHeader) - /// - public byte[] ExtendedHeaderHash; - - /// - /// Extended header size, in bytes - /// - public uint ExtendedHeaderSizeInBytes; - - /// - /// Reserved - /// - public byte[] Reserved2; - - /// - /// Flags - /// - public NCCHHeaderFlags Flags; - - /// - /// Plain region offset, in media units - /// - public uint PlainRegionOffsetInMediaUnits; - - /// - /// Plain region size, in media units - /// - public uint PlainRegionSizeInMediaUnits; - - /// - /// Logo Region offset, in media units (For applications built with SDK 5+) (Supported from firmware: 5.0.0-11) - /// - public uint LogoRegionOffsetInMediaUnits; - - /// - /// Logo Region size, in media units (For applications built with SDK 5+) (Supported from firmware: 5.0.0-11) - /// - public uint LogoRegionSizeInMediaUnits; - - /// - /// ExeFS offset, in media units - /// - public uint ExeFSOffsetInMediaUnits; - - /// - /// ExeFS size, in media units - /// - public uint ExeFSSizeInMediaUnits; - - /// - /// ExeFS hash region size, in media units - /// - public uint ExeFSHashRegionSizeInMediaUnits; - - /// - /// Reserved - /// - public byte[] Reserved3; - - /// - /// RomFS offset, in media units - /// - public uint RomFSOffsetInMediaUnits; - - /// - /// RomFS size, in media units - /// - public uint RomFSSizeInMediaUnits; - - /// - /// RomFS hash region size, in media units - /// - public uint RomFSHashRegionSizeInMediaUnits; - - /// - /// Reserved - /// - public byte[] Reserved4; - - /// - /// ExeFS superblock SHA-256 hash - (SHA-256 hash, starting at 0x0 of the ExeFS over the number of - /// media units specified in the ExeFS hash region size) - /// - public byte[] ExeFSSuperblockHash; - - /// - /// RomFS superblock SHA-256 hash - (SHA-256 hash, starting at 0x0 of the RomFS over the number - /// of media units specified in the RomFS hash region size) - /// - public byte[] RomFSSuperblockHash; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/NCCHHeaderFlags.cs b/BinaryObjectScanner.Models/N3DS/NCCHHeaderFlags.cs deleted file mode 100644 index cff4f362..00000000 --- a/BinaryObjectScanner.Models/N3DS/NCCHHeaderFlags.cs +++ /dev/null @@ -1,49 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - public sealed class NCCHHeaderFlags - { - /// - /// Reserved - /// - public byte Reserved0; - - /// - /// Reserved - /// - public byte Reserved1; - - /// - /// Reserved - /// - public byte Reserved2; - - /// - /// Crypto Method: When this is non-zero, a NCCH crypto method using two keyslots is used. - /// - public CryptoMethod CryptoMethod; - - /// - /// Content Platform: 1 = CTR, 2 = snake (New 3DS). - /// - public ContentPlatform ContentPlatform; - - /// - /// Content Type Bit-masks: Data = 0x1, Executable = 0x2, SystemUpdate = 0x4, Manual = 0x8, - /// Child = (0x4|0x8), Trial = 0x10. When 'Data' is set, but not 'Executable', NCCH is a CFA. - /// Otherwise when 'Executable' is set, NCCH is a CXI. - /// - public ContentType MediaPlatformIndex; - - /// - /// Content Unit Size i.e. u32 ContentUnitSize = 0x200*2^flags[6]; - /// - public byte ContentUnitSize; - - /// - /// Bit-masks: FixedCryptoKey = 0x1, NoMountRomFs = 0x2, NoCrypto = 0x4, using a new keyY - /// generator = 0x20(starting with FIRM 9.6.0-X). - /// - public BitMasks BitMasks; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/NCSDHeader.cs b/BinaryObjectScanner.Models/N3DS/NCSDHeader.cs deleted file mode 100644 index fe888ff7..00000000 --- a/BinaryObjectScanner.Models/N3DS/NCSDHeader.cs +++ /dev/null @@ -1,119 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// There are two known specialisations of the NCSD container format: - /// - The CTR Cart Image (CCI) format, the 3DS' raw NAND format - /// - CCI is the format of game ROM images. - /// - /// CTR System Update (CSU) is a variant of CCI, where the only difference - /// is in the file extension. - /// - /// - public sealed class NCSDHeader - { - #region Common to all NCSD files - - /// - /// RSA-2048 SHA-256 signature of the NCSD header - /// - public byte[] RSA2048Signature; - - /// - /// Magic Number 'NCSD' - /// - public string MagicNumber; - - /// - /// Size of the NCSD image, in media units (1 media unit = 0x200 bytes) - /// - public uint ImageSizeInMediaUnits; - - /// - /// Media ID - /// - public byte[] MediaId; - - /// - /// Partitions FS type (0=None, 1=Normal, 3=FIRM, 4=AGB_FIRM save) - /// - public FilesystemType PartitionsFSType; - - /// - /// Partitions crypt type (each byte corresponds to a partition in the partition table) - /// - public byte[] PartitionsCryptType; - - /// - /// Offset & Length partition table, in media units - /// - public PartitionTableEntry[] PartitionsTable; - - #endregion - - #region CTR Cart Image (CCI) Specific - - /// - /// Exheader SHA-256 hash - /// - public byte[] ExheaderHash; - - /// - /// Additional header size - /// - public uint AdditionalHeaderSize; - - /// - /// Sector zero offset - /// - public uint SectorZeroOffset; - - /// - /// Partition Flags - /// - public byte[] PartitionFlags; - - /// - /// Partition ID table - /// - public ulong[] PartitionIdTable; - - /// - /// Reserved - /// - public byte[] Reserved1; - - /// - /// Reserved? - /// - public byte[] Reserved2; - - /// - /// Support for this was implemented with 9.6.0-X FIRM. Bit0=1 enables using bits 1-2, it's unknown - /// what these two bits are actually used for(the value of these two bits get compared with some other - /// value during NCSD verification/loading). This appears to enable a new, likely hardware-based, - /// antipiracy check on cartridges. - /// - public byte FirmUpdateByte1; - - /// - /// Support for this was implemented with 9.6.0-X FIRM, see below regarding save crypto. - /// - public byte FirmUpdateByte2; - - #endregion - - #region Raw NAND Format Specific - - /// - /// Unknown - /// - public byte[] Unknown; - - /// - /// Encrypted MBR partition-table, for the TWL partitions(key-data used for this keyslot is console-unique). - /// - public byte[] EncryptedMBR; - - #endregion - } -} diff --git a/BinaryObjectScanner.Models/N3DS/PartitionTableEntry.cs b/BinaryObjectScanner.Models/N3DS/PartitionTableEntry.cs deleted file mode 100644 index 7ce03307..00000000 --- a/BinaryObjectScanner.Models/N3DS/PartitionTableEntry.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// Offset and Length partition table, in media units - /// - /// - public sealed class PartitionTableEntry - { - /// - /// Offset - /// - public uint Offset; - - /// - /// Length - /// - public uint Length; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/RomFSHeader.cs b/BinaryObjectScanner.Models/N3DS/RomFSHeader.cs deleted file mode 100644 index 776694c7..00000000 --- a/BinaryObjectScanner.Models/N3DS/RomFSHeader.cs +++ /dev/null @@ -1,96 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// RomFS (or Read-Only Filesystem) is part of the NCCH format, and is - /// used as external file storage. - /// - /// - /// TODO: Implement the other parts of the RomFS tree structure - public sealed class RomFSHeader - { - /// - /// Magic "IVFC" - /// - public string MagicString; - - /// - /// Magic number 0x10000 - /// - public uint MagicNumber; - - /// - /// Master hash size - /// - public uint MasterHashSize; - - /// - /// Level 1 logical offset - /// - public ulong Level1LogicalOffset; - - /// - /// Level 1 hashdata size - /// - public ulong Level1HashdataSize; - - /// - /// Level 1 block size, in log2 - /// - public uint Level1BlockSizeLog2; - - /// - /// Reserved - /// - public byte[] Reserved1; - - /// - /// Level 2 logical offset - /// - public ulong Level2LogicalOffset; - - /// - /// Level 2 hashdata size - /// - public ulong Level2HashdataSize; - - /// - /// Level 2 block size, in log2 - /// - public uint Level2BlockSizeLog2; - - /// - /// Reserved - /// - public byte[] Reserved2; - - /// - /// Level 3 logical offset - /// - public ulong Level3LogicalOffset; - - /// - /// Level 3 hashdata size - /// - public ulong Level3HashdataSize; - - /// - /// Level 3 block size, in log2 - /// - public uint Level3BlockSizeLog2; - - /// - /// Reserved - /// - public byte[] Reserved3; - - /// - /// Reserved - /// - public byte[] Reserved4; - - /// - /// Optional info size. - /// - public uint OptionalInfoSize; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/StorageInfo.cs b/BinaryObjectScanner.Models/N3DS/StorageInfo.cs deleted file mode 100644 index 2c3001a9..00000000 --- a/BinaryObjectScanner.Models/N3DS/StorageInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// Used in FSReg:Register. - /// - /// - public sealed class StorageInfo - { - /// - /// Extdata ID - /// - public ulong ExtdataID; - - /// - /// System savedata IDs - /// - public byte[] SystemSavedataIDs; - - /// - /// Storage accessible unique IDs - /// - public byte[] StorageAccessibleUniqueIDs; - - /// - /// Filesystem access info - /// - /// TODO: Create enum for the flag values - /// TODO: Combine with "other attributes" - public byte[] FileSystemAccessInfo; - - /// - /// Other attributes - /// - public StorageInfoOtherAttributes OtherAttributes; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/SystemControlInfo.cs b/BinaryObjectScanner.Models/N3DS/SystemControlInfo.cs deleted file mode 100644 index b4563e32..00000000 --- a/BinaryObjectScanner.Models/N3DS/SystemControlInfo.cs +++ /dev/null @@ -1,66 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - public sealed class SystemControlInfo - { - /// - /// Application title (default is "CtrApp") - /// - public string ApplicationTitle; - - /// - /// Reserved - /// - public byte[] Reserved1; - - /// - /// Flag (bit 0: CompressExefsCode, bit 1: SDApplication) - /// - public byte Flag; - - /// - /// Remaster version - /// - public ushort RemasterVersion; - - /// - /// Text code set info - /// - public CodeSetInfo TextCodeSetInfo; - - /// - /// Stack size - /// - public uint StackSize; - - /// - /// Read-only code set info - /// - public CodeSetInfo ReadOnlyCodeSetInfo; - - /// - /// Reserved - /// - public byte[] Reserved2; - - /// - /// Data code set info - /// - public CodeSetInfo DataCodeSetInfo; - - /// - /// BSS size - /// - public uint BSSSize; - - /// - /// Dependency module (program ID) list - /// - public ulong[] DependencyModuleList; - - /// - /// SystemInfo - /// - public SystemInfo SystemInfo; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/SystemInfo.cs b/BinaryObjectScanner.Models/N3DS/SystemInfo.cs deleted file mode 100644 index 35bf2b21..00000000 --- a/BinaryObjectScanner.Models/N3DS/SystemInfo.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - public sealed class SystemInfo - { - /// - /// SaveData Size - /// - public ulong SaveDataSize; - - /// - /// Jump ID - /// - public ulong JumpID; - - /// - /// Reserved - /// - public byte[] Reserved; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/TestData.cs b/BinaryObjectScanner.Models/N3DS/TestData.cs deleted file mode 100644 index 65559085..00000000 --- a/BinaryObjectScanner.Models/N3DS/TestData.cs +++ /dev/null @@ -1,59 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// The test data is the same one encountered in development DS/DSi cartridges. - /// - /// - public sealed class TestData - { - /// - /// The bytes FF 00 FF 00 AA 55 AA 55. - /// - public byte[] Signature; - - /// - /// An ascending byte sequence equal to the offset mod 256 (08 09 0A ... FE FF 00 01 ... FF). - /// - public byte[] AscendingByteSequence; - - /// - /// A descending byte sequence equal to 255 minus the offset mod 256 (FF FE FD ... 00 FF DE ... 00). - /// - public byte[] DescendingByteSequence; - - /// - /// Filled with 00 (0b00000000) bytes. - /// - public byte[] Filled00; - - /// - /// Filled with FF (0b11111111) bytes. - /// - public byte[] FilledFF; - - /// - /// Filled with 0F (0b00001111) bytes. - /// - public byte[] Filled0F; - - /// - /// Filled with F0 (0b11110000) bytes. - /// - public byte[] FilledF0; - - /// - /// Filled with 55 (0b01010101) bytes. - /// - public byte[] Filled55; - - /// - /// Filled with AA (0b10101010) bytes. - /// - public byte[] FilledAA; - - /// - /// The final byte is 00 (0b00000000). - /// - public byte FinalByte; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/Ticket.cs b/BinaryObjectScanner.Models/N3DS/Ticket.cs deleted file mode 100644 index 03ad1d46..00000000 --- a/BinaryObjectScanner.Models/N3DS/Ticket.cs +++ /dev/null @@ -1,178 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// A format used to store an encrypted titlekey (using 128-Bit AES-CBC). - /// With 3DS, the Ticket format was updated (now v1) from Wii/DSi format (v0). - /// - /// - public sealed class Ticket - { - /// - /// Signature Type - /// - public SignatureType SignatureType; - - /// - /// Signature size - /// - public ushort SignatureSize; - - /// - /// Padding size - /// - public byte PaddingSize; - - /// - /// Signature - /// - public byte[] Signature; - - /// - /// Padding - /// - public byte[] Padding; - - /// - /// Issuer - /// - public string Issuer; - - /// - /// ECC PublicKey - /// - public byte[] ECCPublicKey; - - /// - /// Version (For 3DS this is always 1) - /// - public byte Version; - - /// - /// CaCrlVersion - /// - public byte CaCrlVersion; - - /// - /// SignerCrlVersion - /// - public byte SignerCrlVersion; - - /// - /// TitleKey (normal-key encrypted using one of the common keyYs; see below) - /// - /// - /// The titlekey is decrypted by using the AES engine with the ticket common-key keyslot. - /// The keyY is selected through an index (ticket offset 0xB1) into a plaintext array - /// of 6 keys ("common keyYs") stored in the data section of Process9. AES-CBC mode is used - /// where the IV is the big-endian titleID. Note that on a retail unit index0 is a retail keyY, - /// while on a dev-unit index0 is the dev common-key which is a normal-key. - /// (On retail for these keyYs, the hardware key-scrambler is used) - /// - /// The titlekey is used to decrypt content downloaded from the CDN using 128-bit AES-CBC with - /// the content index (as big endian u16, padded with trailing zeroes) as the IV. - /// - public byte[] TitleKey; - - /// - /// Reserved - /// - public byte Reserved1; - - /// - /// TicketID - /// - public ulong TicketID; - - /// - /// ConsoleID - /// - public uint ConsoleID; - - /// - /// TitleID - /// - public ulong TitleID; - - /// - /// Reserved - /// - public byte[] Reserved2; - - /// - /// Ticket title version - /// - /// - /// The Ticket Title Version is generally the same as the title version stored in the - /// Title Metadata. Although it doesn't have to match the TMD version to be valid. - /// - public ushort TicketTitleVersion; - - /// - /// Reserved - /// - public byte[] Reserved3; - - /// - /// License Type - /// - public byte LicenseType; - - /// - /// Index to the common keyY used for this ticket, usually 0x1 for retail system titles - /// - public byte CommonKeyYIndex; - - /// - /// Reserved - /// - public byte[] Reserved4; - - /// - /// eShop Account ID? - /// - public uint eShopAccountID; - - /// - /// Reserved - /// - public byte Reserved5; - - /// - /// Audit - /// - public byte Audit; - - /// - /// Reserved - /// - public byte[] Reserved6; - - /// - /// Limits - /// - /// - /// In demos, the first u32 in the "Limits" section is 0x4, then the second u32 is the max-playcount. - /// - public uint[] Limits; - - /// - /// The Content Index of a ticket has its own size defined within itself, - /// with seemingly a minimal of 20 bytes, the second u32 in big endian defines - /// the full value of X. - /// - public uint ContentIndexSize; - - /// - /// Content Index - /// - public byte[] ContentIndex; - - /// - /// Certificate chain - /// - /// - /// https://www.3dbrew.org/wiki/Ticket#Certificate_Chain - /// - public Certificate[] CertificateChain; - } -} diff --git a/BinaryObjectScanner.Models/N3DS/TitleMetadata.cs b/BinaryObjectScanner.Models/N3DS/TitleMetadata.cs deleted file mode 100644 index e26b5122..00000000 --- a/BinaryObjectScanner.Models/N3DS/TitleMetadata.cs +++ /dev/null @@ -1,155 +0,0 @@ -namespace BinaryObjectScanner.Models.N3DS -{ - /// - /// A format used to store information about a title (installed title, DLC, etc.) - /// and all its installed contents, including which contents they consist of and - /// their SHA256 hashes. - /// - /// - public sealed class TitleMetadata - { - /// - /// Signature Type - /// - public SignatureType SignatureType; - - /// - /// Signature size - /// - public ushort SignatureSize; - - /// - /// Padding size - /// - public byte PaddingSize; - - /// - /// Signature - /// - public byte[] Signature; - - /// - /// Padding - /// - public byte[] Padding1; - - /// - /// Signature Issuer - /// - public string Issuer; - - /// - /// Version - /// - public byte Version; - - /// - /// CaCrlVersion - /// - public byte CaCrlVersion; - - /// - /// SignerCrlVersion - /// - public byte SignerCrlVersion; - - /// - /// Reserved - /// - public byte Reserved1; - - /// - /// System Version - /// - public ulong SystemVersion; - - /// - /// TitleID - /// - public ulong TitleID; - - /// - /// Title Type - /// - public uint TitleType; - - /// - /// Group ID - /// - public ushort GroupID; - - /// - /// Save Data Size in Little Endian (Bytes) (Also SRL Public Save Data Size) - /// - public uint SaveDataSize; - - /// - /// SRL Private Save Data Size in Little Endian (Bytes) - /// - public uint SRLPrivateSaveDataSize; - - /// - /// Reserved - /// - public byte[] Reserved2; - - /// - /// SRL Flag - /// - public byte SRLFlag; - - /// - /// Reserved - /// - public byte[] Reserved3; - - /// - /// Access Rights - /// - public uint AccessRights; - - /// - /// Title Version - /// - public ushort TitleVersion; - - /// - /// Content Count (big-endian) - /// - public ushort ContentCount; - - /// - /// Boot Content - /// - public ushort BootContent; - - /// - /// Padding - /// - public byte[] Padding2; - - /// - /// SHA-256 Hash of the Content Info Records - /// - public byte[] SHA256HashContentInfoRecords; - - /// - /// There are 64 of these records, usually only the first is used. - /// - public ContentInfoRecord[] ContentInfoRecords; - - /// - /// There is one of these for each content contained in this title. - /// (Determined by "Content Count" in the TMD Header). - /// - public ContentChunkRecord[] ContentChunkRecords; - - /// - /// Certificate chain - /// - /// - /// https://www.3dbrew.org/wiki/Title_metadata#Certificate_Chain - /// - public Certificate[] CertificateChain; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/NCF/ChecksumEntry.cs b/BinaryObjectScanner.Models/NCF/ChecksumEntry.cs deleted file mode 100644 index c4ca4d53..00000000 --- a/BinaryObjectScanner.Models/NCF/ChecksumEntry.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.NCF -{ - /// - public sealed class ChecksumEntry - { - /// - /// Checksum. - /// - public uint Checksum; - } -} diff --git a/BinaryObjectScanner.Models/NCF/ChecksumHeader.cs b/BinaryObjectScanner.Models/NCF/ChecksumHeader.cs deleted file mode 100644 index cb5873d5..00000000 --- a/BinaryObjectScanner.Models/NCF/ChecksumHeader.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace BinaryObjectScanner.Models.NCF -{ - /// - public sealed class ChecksumHeader - { - /// - /// Always 0x00000001 - /// - public uint Dummy0 { get; set; } - - /// - /// Size of LPNCFCHECKSUMHEADER & LPNCFCHECKSUMMAPHEADER & in bytes. - /// - public uint ChecksumSize { get; set; } - } -} diff --git a/BinaryObjectScanner.Models/NCF/ChecksumMapEntry.cs b/BinaryObjectScanner.Models/NCF/ChecksumMapEntry.cs deleted file mode 100644 index 72482514..00000000 --- a/BinaryObjectScanner.Models/NCF/ChecksumMapEntry.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace BinaryObjectScanner.Models.NCF -{ - /// - public sealed class ChecksumMapEntry - { - /// - /// Number of checksums. - /// - public uint ChecksumCount; - - /// - /// Index of first checksum. - /// - public uint FirstChecksumIndex; - } -} diff --git a/BinaryObjectScanner.Models/NCF/ChecksumMapHeader.cs b/BinaryObjectScanner.Models/NCF/ChecksumMapHeader.cs deleted file mode 100644 index e0df4726..00000000 --- a/BinaryObjectScanner.Models/NCF/ChecksumMapHeader.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace BinaryObjectScanner.Models.NCF -{ - /// - public sealed class ChecksumMapHeader - { - /// - /// Always 0x14893721 - /// - public uint Dummy0; - - /// - /// Always 0x00000001 - /// - public uint Dummy1; - - /// - /// Number of items. - /// - public uint ItemCount; - - /// - /// Number of checksums. - /// - public uint ChecksumCount; - } -} diff --git a/BinaryObjectScanner.Models/NCF/DirectoryCopyEntry.cs b/BinaryObjectScanner.Models/NCF/DirectoryCopyEntry.cs deleted file mode 100644 index 38327569..00000000 --- a/BinaryObjectScanner.Models/NCF/DirectoryCopyEntry.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.NCF -{ - /// - public sealed class DirectoryCopyEntry - { - /// - /// Index of the directory item. - /// - public uint DirectoryIndex; - } -} diff --git a/BinaryObjectScanner.Models/NCF/DirectoryEntry.cs b/BinaryObjectScanner.Models/NCF/DirectoryEntry.cs deleted file mode 100644 index 1d8f8848..00000000 --- a/BinaryObjectScanner.Models/NCF/DirectoryEntry.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace BinaryObjectScanner.Models.NCF -{ - /// - public sealed class DirectoryEntry - { - /// - /// Offset to the directory item name from the end of the directory items. - /// - public uint NameOffset; - - /// - /// Directory item name from the end of the directory items. - /// - public string Name; - - /// - /// Size of the item. (If file, file size. If folder, num items.) - /// - public uint ItemSize; - - /// - /// Checksome index. (0xFFFFFFFF == None). - /// - public uint ChecksumIndex; - - /// - /// Flags for the directory item. (0x00000000 == Folder). - /// - public HL_NCF_FLAG DirectoryFlags; - - /// - /// Index of the parent directory item. (0xFFFFFFFF == None). - /// - public uint ParentIndex; - - /// - /// Index of the next directory item. (0x00000000 == None). - /// - public uint NextIndex; - - /// - /// Index of the first directory item. (0x00000000 == None). - /// - public uint FirstIndex; - } -} diff --git a/BinaryObjectScanner.Models/NCF/DirectoryHeader.cs b/BinaryObjectScanner.Models/NCF/DirectoryHeader.cs deleted file mode 100644 index c9b180b8..00000000 --- a/BinaryObjectScanner.Models/NCF/DirectoryHeader.cs +++ /dev/null @@ -1,76 +0,0 @@ -namespace BinaryObjectScanner.Models.NCF -{ - /// - public sealed class DirectoryHeader - { - /// - /// Always 0x00000004 - /// - public uint Dummy0; - - /// - /// Cache ID. - /// - public uint CacheID; - - /// - /// NCF file version. - /// - public uint LastVersionPlayed; - - /// - /// Number of items in the directory. - /// - public uint ItemCount; - - /// - /// Number of files in the directory. - /// - public uint FileCount; - - /// - /// Always 0x00008000. Data per checksum? - /// - public uint ChecksumDataLength; - - /// - /// Size of lpNCFDirectoryEntries & lpNCFDirectoryNames & lpNCFDirectoryInfo1Entries & lpNCFDirectoryInfo2Entries & lpNCFDirectoryCopyEntries & lpNCFDirectoryLocalEntries in bytes. - /// - public uint DirectorySize; - - /// - /// Size of the directory names in bytes. - /// - public uint NameSize; - - /// - /// Number of Info1 entires. - /// - public uint Info1Count; - - /// - /// Number of files to copy. - /// - public uint CopyCount; - - /// - /// Number of files to keep local. - /// - public uint LocalCount; - - /// - /// Reserved - /// - public uint Dummy1; - - /// - /// Reserved - /// - public uint Dummy2; - - /// - /// Header checksum. - /// - public uint Checksum; - } -} diff --git a/BinaryObjectScanner.Models/NCF/DirectoryInfo1Entry.cs b/BinaryObjectScanner.Models/NCF/DirectoryInfo1Entry.cs deleted file mode 100644 index c5683456..00000000 --- a/BinaryObjectScanner.Models/NCF/DirectoryInfo1Entry.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.NCF -{ - /// - public sealed class DirectoryInfo1Entry - { - /// - /// Reserved - /// - public uint Dummy0; - } -} diff --git a/BinaryObjectScanner.Models/NCF/DirectoryInfo2Entry.cs b/BinaryObjectScanner.Models/NCF/DirectoryInfo2Entry.cs deleted file mode 100644 index 06bb92cf..00000000 --- a/BinaryObjectScanner.Models/NCF/DirectoryInfo2Entry.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.NCF -{ - /// - public sealed class DirectoryInfo2Entry - { - /// - /// Reserved - /// - public uint Dummy0 { get; set; } - } -} diff --git a/BinaryObjectScanner.Models/NCF/DirectoryLocalEntry.cs b/BinaryObjectScanner.Models/NCF/DirectoryLocalEntry.cs deleted file mode 100644 index cf826f9f..00000000 --- a/BinaryObjectScanner.Models/NCF/DirectoryLocalEntry.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.NCF -{ - /// - public sealed class DirectoryLocalEntry - { - /// - /// Index of the directory item. - /// - public uint DirectoryIndex; - } -} diff --git a/BinaryObjectScanner.Models/NCF/Enums.cs b/BinaryObjectScanner.Models/NCF/Enums.cs deleted file mode 100644 index 62c8e7a3..00000000 --- a/BinaryObjectScanner.Models/NCF/Enums.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.NCF -{ - [Flags] - public enum HL_NCF_FLAG : uint - { - /// - /// Folder - /// - HL_NCF_FLAG_FOLDER = 0x00000000, - - /// - /// Don't overwrite the item if copying it to the disk and the item already exis - /// - HL_NCF_FLAG_COPY_LOCAL_NO_OVERWRITE = 0x00000001, - - /// - /// The item is to be copied to the disk. - /// - HL_NCF_FLAG_COPY_LOCAL = 0x0000000a, - - /// - /// Backup the item before overwriting it. - /// - HL_NCF_FLAG_BACKUP_LOCAL = 0x00000040, - - /// - /// The item is encrypted. - /// - HL_NCF_FLAG_ENCRYPTED = 0x00000100, - - /// - /// The item is a file. - /// - HL_NCF_FLAG_FILE = 0x00004000, - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/NCF/File.cs b/BinaryObjectScanner.Models/NCF/File.cs deleted file mode 100644 index 14777012..00000000 --- a/BinaryObjectScanner.Models/NCF/File.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System.Collections.Generic; - -namespace BinaryObjectScanner.Models.NCF -{ - /// - /// Half-Life No Cache File - /// - /// - public sealed class File - { - /// - /// Header data - /// - public Header Header { get; set; } - - /// - /// Directory header data - /// - public DirectoryHeader DirectoryHeader { get; set; } - - /// - /// Directory entries data - /// - public DirectoryEntry[] DirectoryEntries { get; set; } - - /// - /// Directory names data - /// - public Dictionary DirectoryNames { get; set; } - - /// - /// Directory info 1 entries data - /// - public DirectoryInfo1Entry[] DirectoryInfo1Entries { get; set; } - - /// - /// Directory info 2 entries data - /// - public DirectoryInfo2Entry[] DirectoryInfo2Entries { get; set; } - - /// - /// Directory copy entries data - /// - public DirectoryCopyEntry[] DirectoryCopyEntries { get; set; } - - /// - /// Directory local entries data - /// - public DirectoryLocalEntry[] DirectoryLocalEntries { get; set; } - - /// - /// Unknown header data - /// - public UnknownHeader UnknownHeader { get; set; } - - /// - /// Unknown entries data - /// - public UnknownEntry[] UnknownEntries { get; set; } - - /// - /// Checksum header data - /// - public ChecksumHeader ChecksumHeader { get; set; } - - /// - /// Checksum map header data - /// - public ChecksumMapHeader ChecksumMapHeader { get; set; } - - /// - /// Checksum map entries data - /// - public ChecksumMapEntry[] ChecksumMapEntries { get; set; } - - /// - /// Checksum entries data - /// - public ChecksumEntry[] ChecksumEntries { get; set; } - } -} diff --git a/BinaryObjectScanner.Models/NCF/Header.cs b/BinaryObjectScanner.Models/NCF/Header.cs deleted file mode 100644 index 75a08cf9..00000000 --- a/BinaryObjectScanner.Models/NCF/Header.cs +++ /dev/null @@ -1,61 +0,0 @@ -namespace BinaryObjectScanner.Models.NCF -{ - /// - public sealed class Header - { - /// - /// Always 0x00000001 - /// - public uint Dummy0; - - /// - /// Always 0x00000002 - /// - public uint MajorVersion; - - /// - /// NCF version number. - /// - public uint MinorVersion; - - /// - /// Cache ID - /// - public uint CacheID; - - /// - /// Last version played - /// - public uint LastVersionPlayed; - - /// - /// Reserved - /// - public uint Dummy1; - - /// - /// Reserved - /// - public uint Dummy2; - - /// - /// Total size of NCF file in bytes. - /// - public uint FileSize; - - /// - /// Size of each data block in bytes. - /// - public uint BlockSize; - - /// - /// Number of data blocks. - /// - public uint BlockCount; - - /// - /// Reserved - /// - public uint Dummy3; - } -} diff --git a/BinaryObjectScanner.Models/NCF/UnknownEntry.cs b/BinaryObjectScanner.Models/NCF/UnknownEntry.cs deleted file mode 100644 index ad74decf..00000000 --- a/BinaryObjectScanner.Models/NCF/UnknownEntry.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.NCF -{ - /// - public sealed class UnknownEntry - { - /// - /// Reserved - /// - public uint Dummy0; - } -} diff --git a/BinaryObjectScanner.Models/NCF/UnknownHeader.cs b/BinaryObjectScanner.Models/NCF/UnknownHeader.cs deleted file mode 100644 index 8c6b222b..00000000 --- a/BinaryObjectScanner.Models/NCF/UnknownHeader.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace BinaryObjectScanner.Models.NCF -{ - /// - public sealed class UnknownHeader - { - /// - /// Always 0x00000001 - /// - public uint Dummy0; - - /// - /// Always 0x00000000 - /// - public uint Dummy1; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/Constants.cs b/BinaryObjectScanner.Models/NewExecutable/Constants.cs deleted file mode 100644 index 5a2ccbbe..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/Constants.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.NewExecutable -{ - public static class Constants - { - public static readonly byte[] SignatureBytes = new byte[] { 0x4e, 0x45 }; - - public const string SignatureString = "NE"; - - public const ushort SignatureUInt16 = 0x454e; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/NewExecutable/EntryTableBundle.cs b/BinaryObjectScanner.Models/NewExecutable/EntryTableBundle.cs deleted file mode 100644 index 9352f381..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/EntryTableBundle.cs +++ /dev/null @@ -1,84 +0,0 @@ -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - /// The entry table follows the imported-name table. This table contains - /// bundles of entry-point definitions. Bundling is done to save space in - /// the entry table. The entry table is accessed by an ordinal value. - /// Ordinal number one is defined to index the first entry in the entry - /// table. To find an entry point, the bundles are scanned searching for a - /// specific entry point using an ordinal number. The ordinal number is - /// adjusted as each bundle is checked. When the bundle that contains the - /// entry point is found, the ordinal number is multiplied by the size of - /// the bundle's entries to index the proper entry. - /// - /// - /// The linker forms bundles in the most dense manner it can, under the - /// restriction that it cannot reorder entry points to improve bundling. - /// The reason for this restriction is that other .EXE files may refer to - /// entry points within this bundle by their ordinal number. The following - /// describes the format of the entry table bundles. - /// - /// - public sealed class EntryTableBundle - { - /// - /// Number of entries in this bundle. All records in one bundle - /// are either moveable or refer to the same fixed segment. A zero - /// value in this field indicates the end of the entry table. - /// - public byte EntryCount; - - /// - /// Segment indicator for this bundle. This defines the type of - /// entry table entry data within the bundle. There are three - /// types of entries that are defined. - /// - 000h = Unused entries. There is no entry data in an unused - /// bundle. The next bundle follows this field. This is - /// used by the linker to skip ordinal numbers. - /// - 001h-0FEh = Segment number for fixed segment entries. A fixed - /// segment entry is 3 bytes long. - /// - 0FFH = Moveable segment entries. The entry data contains the - /// segment number for the entry points. A moveable segment - /// entry is 6 bytes long. - /// - public byte SegmentIndicator; - - #region Fixed Segment Entry - - /// - /// Flag word. - /// - public FixedSegmentEntryFlag FixedFlagWord; - - /// - /// Offset within segment to entry point. - /// - public ushort FixedOffset; - - #endregion - - #region Moveable Segment Entry - - /// - /// Flag word. - /// - public MoveableSegmentEntryFlag MoveableFlagWord; - - /// - /// INT 3FH. - /// - public ushort MoveableReserved; - - /// - /// Segment number. - /// - public byte MoveableSegmentNumber; - - /// - /// Offset within segment to entry point. - /// - public ushort MoveableOffset; - - #endregion - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/Enums.cs b/BinaryObjectScanner.Models/NewExecutable/Enums.cs deleted file mode 100644 index 8a45dc02..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/Enums.cs +++ /dev/null @@ -1,324 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - [Flags] - public enum FixedSegmentEntryFlag : byte - { - /// - /// Set if the entry is exported. - /// - Exported = 0x01, - - /// - /// Set if the entry uses a global (shared) data segments. - /// - /// - /// The first assembly-language instruction in the - /// entry point prologue must be "MOV AX,data - /// segment number". This may be set only for - /// SINGLEDATA library modules. - /// - Global = 0x02, - } - - [Flags] - public enum HeaderFlag : ushort - { - #region Program Flags - - NOAUTODATA = 0x0000, - - /// - /// Shared automatic data segment - /// - SINGLEDATA = 0x0001, - - /// - /// Instanced automatic data segment - /// - MULTIPLEDATA = 0x0002, - - /// - /// Global initialization - /// - GlobalInitialization = 0x0004, - - /// - /// Protected mode only - /// - ProtectedModeOnly = 0x0008, - - /// - /// 8086 instructions - /// - Instructions8086 = 0x0010, - - /// - /// 80286 instructions - /// - Instructions80286 = 0x0020, - - /// - /// 80386 instructions - /// - Instructions80386 = 0x0040, - - /// - /// 80x87 instructions - /// - Instructions80x87 = 0x0080, - - #endregion - - #region Application Flags - - /// - /// Full screen (not aware of Windows/P.M. API) - /// - FullScreen = 0x0100, - - /// - /// Compatible with Windows/P.M. API - /// - WindowsPMCompatible = 0x0200, - - /// - /// Uses Windows/P.M. API - /// - WindowsPM = 0x0400, - - /// - /// OS/2 family application - /// - OS2FamilyApplication = 0x0800, - - /// - /// Unknown (Reserved?) - /// - UnknownReserved = 0x1000, - - /// - /// Errors detected at link time, module will not load - /// - ErrorsDetectedAtLinkTime = 0x2000, - - /// - /// Unknown (non-conforming program) - /// - UnknownNonConforming = 0x4000, - - /// - /// Library module. - /// The SS:SP information is invalid, CS:IP points - /// to an initialization procedure that is called - /// with AX equal to the module handle. This - /// initialization procedure must perform a far - /// return to the caller, with AX not equal to - /// zero to indicate success, or AX equal to zero - /// to indicate failure to initialize. DS is set - /// to the library's data segment if the - /// SINGLEDATA flag is set. Otherwise, DS is set - /// to the caller's data segment. - /// - /// - /// A program or DLL can only contain dynamic - /// links to executable files that have this - /// library module flag set. One program cannot - /// dynamic-link to another program. - /// - LibraryModule = 0x8000, - - #endregion - } - - [Flags] - public enum MoveableSegmentEntryFlag : byte - { - /// - /// Set if the entry is exported. - /// - Exported = 0x01, - - /// - /// Set if the entry uses a global (shared) data segments. - /// - Global = 0x02, - } - - public enum OperatingSystem : byte - { - OS2 = 0x01, - WINDOWS = 0x02, - EU_MSDOS4 = 0x03, - WINDOWS_386 = 0x04, - BOSS = 0x05, - } - - [Flags] - public enum OS2Flag : byte - { - /// - /// Long filename support - /// - LongFilenameSupport = 0x01, - - /// - /// 2.x protected mode - /// - ProtectedMode = 0x02, - - /// - /// 2.x proportional fonts - /// - ProportionalFonts = 0x04, - - /// - /// Executable has gangload area - /// - HasGangload = 0x08, - - /// - /// Unknown - /// - Unknown = 0xF0, - } - - public enum OSFixupType : ushort - { - /// - /// FIARQQ, FJARQQ - /// - FIARQQ = 0x0001, - - /// - /// FISRQQ, FJSRQQ - /// - FISRQQ = 0x0002, - - /// - /// FICRQQ, FJCRQQ - /// - FICRQQ = 0x0003, - - FIERQQ = 0x0004, - - FIDRQQ = 0x0005, - - FIWRQQ = 0x0006, - } - - [Flags] - public enum RelocationRecordFlag : byte - { - TARGET_MASK = 0x03, - - INTERNALREF = 0x00, - - IMPORTORDINAL = 0x01, - - IMPORTNAME = 0x02, - - OSFIXUP = 0x03, - - ADDITIVE = 0x04, - } - - public enum RelocationRecordSourceType : byte - { - SOURCE_MASK = 0x0F, - - LOBYTE = 0x00, - - SEGMENT = 0x02, - - /// - /// 32-bit pointer - /// - FAR_ADDR = 0x03, - - /// - /// 16-bit offset - /// - OFFSET = 0x05, - } - - [Flags] - public enum ResourceTypeResourceFlag : ushort - { - /// - /// Resource is not fixed. - /// - MOVEABLE = 0x0010, - - /// - /// Resource can be shared. - /// - PURE = 0x0020, - - /// - /// Resource is preloaded. - /// - PRELOAD = 0x0040, - } - - public enum SegmentEntryType - { - /// - /// 000h - There is no entry data in an unused bundle. The next bundle - /// follows this field. This is used by the linker to skip ordinal numbers. - /// - Unused, - - /// - /// 001h-0FEh - Segment number for fixed segment entries. A fixed segment - /// entry is 3 bytes long. - /// - FixedSegment, - - /// - /// 0FFH - Moveable segment entries. The entry data contains the segment - /// number for the entry points. A moveable segment entry is 6 bytes long. - /// - MoveableSegment, - } - - [Flags] - public enum SegmentTableEntryFlag : ushort - { - /// - /// Segment-type field. - /// - TYPE_MASK = 0x0007, - - /// - /// Code-segment type. - /// - CODE = 0x0000, - - /// - /// Data-segment type. - /// - DATA = 0x0001, - - /// - /// Segment is not fixed. - /// - MOVEABLE = 0x0010, - - /// - /// Segment will be preloaded; read-only if this is a data segment. - /// - PRELOAD = 0x0040, - - /// - /// Set if segment has relocation records. - /// - RELOCINFO = 0x0100, - - /// - /// Discard priority. - /// - DISCARD = 0xF000, - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/Executable.cs b/BinaryObjectScanner.Models/NewExecutable/Executable.cs deleted file mode 100644 index 3dc4abcf..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/Executable.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.Collections.Generic; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - /// The segmented EXE header contains general information about the EXE - /// file and contains information on the location and size of the other - /// sections. The Windows loader copies this section, along with other - /// data, into the module table in the system data. The module table is - /// internal data used by the loader to manage the loaded executable - /// modules in the system and to support dynamic linking. - /// - /// - public sealed class Executable - { - /// - /// MS-DOS executable stub - /// - public MSDOS.Executable Stub { get; set; } - - /// - /// New Executable header - /// - public ExecutableHeader Header { get; set; } - - /// - /// Segment table - /// - public SegmentTableEntry[] SegmentTable { get; set; } - - /// - /// Resource table - /// - public ResourceTable ResourceTable { get; set; } - - /// - /// Resident-Name table - /// - public ResidentNameTableEntry[] ResidentNameTable { get; set; } - - /// - /// Module-Reference table - /// - public ModuleReferenceTableEntry[] ModuleReferenceTable { get; set; } - - /// - /// Imported-Name table - /// - public Dictionary ImportedNameTable { get; set; } - - /// - /// Entry table - /// - public EntryTableBundle[] EntryTable { get; set; } - - /// - /// Nonresident-Name table - /// - public NonResidentNameTableEntry[] NonResidentNameTable { get; set; } - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/ExecutableHeader.cs b/BinaryObjectScanner.Models/NewExecutable/ExecutableHeader.cs deleted file mode 100644 index 993ab17b..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/ExecutableHeader.cs +++ /dev/null @@ -1,198 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - /// The NE header is a relatively large structure with multiple characteristics. - /// Because of the age of the format some items are unclear in meaning. - /// - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ExecutableHeader - { - /// - /// Signature word. - /// "N" is low-order byte. - /// "E" is high-order byte. - /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public string Magic; - - /// - /// Version number of the linker. - /// - public byte LinkerVersion; - - /// - /// Revision number of the linker. - /// - public byte LinkerRevision; - - /// - /// Entry Table file offset, relative to the beginning of the segmented EXE header. - /// - public ushort EntryTableOffset; - - /// - /// Number of bytes in the entry table. - /// - public ushort EntryTableSize; - - /// - /// 32-bit CRC of entire contents of file. - /// - /// These words are taken as 00 during the calculation. - public uint CrcChecksum; - - /// - /// Flag word - /// - public HeaderFlag FlagWord; - - /// - /// Segment number of automatic data segment. - /// This value is set to zero if SINGLEDATA and - /// MULTIPLEDATA flag bits are clear, NOAUTODATA is - /// indicated in the flags word. - /// - /// - /// A Segment number is an index into the module's segment - /// table. The first entry in the segment table is segment - /// number 1. - /// - public ushort AutomaticDataSegmentNumber; - - /// - /// Initial size, in bytes, of dynamic heap added to the - /// data segment. This value is zero if no initial local - /// heap is allocated. - /// - public ushort InitialHeapAlloc; - - /// - /// Initial size, in bytes, of stack added to the data - /// segment. This value is zero to indicate no initial - /// stack allocation, or when SS is not equal to DS. - /// - public ushort InitialStackAlloc; - - /// - /// Segment number:offset of CS:IP. - /// - public uint InitialCSIPSetting; - - /// - /// Segment number:offset of SS:SP. - /// - /// - /// If SS equals the automatic data segment and SP equals - /// zero, the stack pointer is set to the top of the - /// automatic data segment just below the additional heap - /// area. - /// - public uint InitialSSSPSetting; - - /// - /// Number of entries in the Segment Table. - /// - public ushort FileSegmentCount; - - /// - /// Number of entries in the Module Reference Table. - /// - public ushort ModuleReferenceTableSize; - - /// - /// Number of bytes in the Non-Resident Name Table. - /// - public ushort NonResidentNameTableSize; - - /// - /// Segment Table file offset, relative to the beginning - /// of the segmented EXE header. - /// - public ushort SegmentTableOffset; - - /// - /// Resource Table file offset, relative to the beginning - /// of the segmented EXE header. - /// - public ushort ResourceTableOffset; - - /// - /// Resident Name Table file offset, relative to the - /// beginning of the segmented EXE header. - /// - public ushort ResidentNameTableOffset; - - /// - /// Module Reference Table file offset, relative to the - /// beginning of the segmented EXE header. - /// - public ushort ModuleReferenceTableOffset; - - /// - /// Imported Names Table file offset, relative to the - /// beginning of the segmented EXE header. - /// - public ushort ImportedNamesTableOffset; - - /// - /// Non-Resident Name Table offset, relative to the - /// beginning of the file. - /// - public uint NonResidentNamesTableOffset; - - /// - /// Number of movable entries in the Entry Table. - /// - public ushort MovableEntriesCount; - - /// - /// Logical sector alignment shift count, log(base 2) of - /// the segment sector size (default 9). - /// - public ushort SegmentAlignmentShiftCount; - - /// - /// Number of resource entries. - /// - public ushort ResourceEntriesCount; - - /// - /// Executable type, used by loader. - /// - public OperatingSystem TargetOperatingSystem; - - /// - /// Other OS/2 flags - /// - public OS2Flag AdditionalFlags; - - /// - /// Offset to return thunks or start of gangload area - /// - public ushort ReturnThunkOffset; - - /// - /// Offset to segment reference thunks or size of gangload area - /// - public ushort SegmentReferenceThunkOffset; - - /// - /// Minimum code swap area size - /// - public ushort MinCodeSwapAreaSize; - - /// - /// Windows SDK revison number - /// - public byte WindowsSDKRevision; - - /// - /// Windows SDK version number - /// - public byte WindowsSDKVersion; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/ImportNameRelocationRecord.cs b/BinaryObjectScanner.Models/NewExecutable/ImportNameRelocationRecord.cs deleted file mode 100644 index c5bedf56..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/ImportNameRelocationRecord.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ImportNameRelocationRecord - { - /// - /// Index into module reference table for the imported module. - /// - public ushort Index; - - /// - /// Offset within Imported Names Table to procedure name string. - /// - public ushort Offset; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/ImportOrdinalRelocationRecord.cs b/BinaryObjectScanner.Models/NewExecutable/ImportOrdinalRelocationRecord.cs deleted file mode 100644 index 0683dd3d..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/ImportOrdinalRelocationRecord.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ImportOrdinalRelocationRecord - { - /// - /// Index into module reference table for the imported module. - /// - public ushort Index; - - /// - /// Procedure ordinal number. - /// - public ushort Ordinal; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/ImportedNameTableEntry.cs b/BinaryObjectScanner.Models/NewExecutable/ImportedNameTableEntry.cs deleted file mode 100644 index dd045c97..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/ImportedNameTableEntry.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - /// The imported-name table follows the module-reference table. This table - /// contains the names of modules and procedures that are imported by the - /// executable file. Each entry is composed of a 1-byte field that - /// contains the length of the string, followed by any number of - /// characters. The strings are not null-terminated and are case - /// sensitive. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ImportedNameTableEntry - { - /// - /// Length of the name string that follows. A zero value indicates - /// the end of the name table. - /// - public byte Length; - - /// - /// ASCII text of the name string. - /// - public byte[] NameString; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/InternalRefRelocationRecord.cs b/BinaryObjectScanner.Models/NewExecutable/InternalRefRelocationRecord.cs deleted file mode 100644 index c3304808..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/InternalRefRelocationRecord.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class InternalRefRelocationRecord - { - /// - /// Segment number for a fixed segment, or 0FFh for a - /// movable segment. - /// - public byte SegmentNumber; - - /// - /// 0 - /// - public byte Reserved; - - /// - /// Offset into segment if fixed segment, or ordinal - /// number index into Entry Table if movable segment. - /// - public ushort Offset; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/ModuleReferenceTableEntry.cs b/BinaryObjectScanner.Models/NewExecutable/ModuleReferenceTableEntry.cs deleted file mode 100644 index b3443821..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/ModuleReferenceTableEntry.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - /// The module-reference table follows the resident-name table. Each entry - /// contains an offset for the module-name string within the imported- - /// names table; each entry is 2 bytes long. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ModuleReferenceTableEntry - { - /// - /// Offset within Imported Names Table to referenced module name string. - /// - public ushort Offset; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/NonResidentNameTableEntry.cs b/BinaryObjectScanner.Models/NewExecutable/NonResidentNameTableEntry.cs deleted file mode 100644 index ebc3af6c..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/NonResidentNameTableEntry.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - /// The nonresident-name table follows the entry table, and contains a - /// module description and nonresident exported procedure name strings. - /// The first string in this table is a module description. These name - /// strings are case-sensitive and are not null-terminated. The name - /// strings follow the same format as those defined in the resident name - /// table. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class NonResidentNameTableEntry - { - /// - /// Length of the name string that follows. A zero value indicates - /// the end of the name table. - /// - public byte Length; - - /// - /// ASCII text of the name string. - /// - public byte[] NameString; - - /// - /// Ordinal number (index into entry table). This value is ignored - /// for the module name. - /// - public ushort OrdinalNumber; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/OSFixupRelocationRecord.cs b/BinaryObjectScanner.Models/NewExecutable/OSFixupRelocationRecord.cs deleted file mode 100644 index d6fe66d3..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/OSFixupRelocationRecord.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class OSFixupRelocationRecord - { - /// - /// Operating system fixup type. - /// Floating-point fixups. - /// - public OSFixupType FixupType; - - /// - /// 0 - /// - public ushort Reserved; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/PerSegmentData.cs b/BinaryObjectScanner.Models/NewExecutable/PerSegmentData.cs deleted file mode 100644 index 6a5a6c71..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/PerSegmentData.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - /// The location and size of the per-segment data is defined in the - /// segment table entry for the segment. If the segment has relocation - /// fixups, as defined in the segment table entry flags, they directly - /// follow the segment data in the file. The relocation fixup information - /// is defined as follows: - /// - /// - public sealed class PerSegmentData - { - /// - /// Number of relocation records that follow. - /// - public ushort RelocationRecordCount; - - /// - /// A table of relocation records follows. - /// - public RelocationRecord[] RelocationRecords; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/RelocationRecord.cs b/BinaryObjectScanner.Models/NewExecutable/RelocationRecord.cs deleted file mode 100644 index 53d85132..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/RelocationRecord.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - /// A table of relocation records follows. The following is the format - /// of each relocation record. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class RelocationRecord - { - /// - /// Source type. - /// - public RelocationRecordSourceType SourceType; - - /// - /// Flags byte. - /// - /// The target value has four types that are defined in the flag - /// byte field. - /// - public RelocationRecordFlag Flags; - - /// - /// Offset within this segment of the source chain. - /// If the ADDITIVE flag is set, then target value is added to - /// the source contents, instead of replacing the source and - /// following the chain. The source chain is an 0FFFFh - /// terminated linked list within this segment of all - /// references to the target. - /// - public ushort Offset; - - /// - /// INTERNALREF - /// - /// Must be NULL if is not set to - public InternalRefRelocationRecord InternalRefRelocationRecord; - - /// - /// IMPORTNAME - /// - /// Must be NULL if is not set to - public ImportNameRelocationRecord ImportNameRelocationRecord; - - /// - /// IMPORTORDINAL - /// - /// Must be NULL if is not set to - public ImportOrdinalRelocationRecord ImportOrdinalRelocationRecord; - - /// - /// IMPORTORDINAL - /// - /// Must be NULL if is not set to - public OSFixupRelocationRecord OSFixupRelocationRecord; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/ResidentNameTableEntry.cs b/BinaryObjectScanner.Models/NewExecutable/ResidentNameTableEntry.cs deleted file mode 100644 index 1508719a..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/ResidentNameTableEntry.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - /// The resident-name table follows the resource table, and contains this - /// module's name string and resident exported procedure name strings. The - /// first string in this table is this module's name. These name strings - /// are case-sensitive and are not null-terminated. The following - /// describes the format of the name strings: - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ResidentNameTableEntry - { - /// - /// Length of the name string that follows. A zero value indicates - /// the end of the name table. - /// - public byte Length; - - /// - /// ASCII text of the name string. - /// - public byte[] NameString; - - /// - /// Ordinal number (index into entry table). This value is ignored - /// for the module name. - /// - public ushort OrdinalNumber; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/ResourceTable.cs b/BinaryObjectScanner.Models/NewExecutable/ResourceTable.cs deleted file mode 100644 index a24731bb..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/ResourceTable.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Collections.Generic; -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - /// The resource table follows the segment table and contains entries for - /// each resource in the executable file. The resource table consists of - /// an alignment shift count, followed by a table of resource records. The - /// resource records define the type ID for a set of resources. Each - /// resource record contains a table of resource entries of the defined - /// type. The resource entry defines the resource ID or name ID for the - /// resource. It also defines the location and size of the resource. The - /// following describes the contents of each of these structures: - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ResourceTable - { - /// - /// Alignment shift count for resource data. - /// - public ushort AlignmentShiftCount; - - /// - /// A table of resource type information blocks follows. - /// - public ResourceTypeInformationEntry[] ResourceTypes; - - /// - /// Resource type and name strings are stored at the end of the - /// resource table. - /// - public Dictionary TypeAndNameStrings; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/ResourceTypeAndNameString.cs b/BinaryObjectScanner.Models/NewExecutable/ResourceTypeAndNameString.cs deleted file mode 100644 index 62dd6e1a..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/ResourceTypeAndNameString.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - /// Resource type and name strings are stored at the end of the - /// resource table. Note that these strings are NOT null terminated and - /// are case sensitive. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ResourceTypeAndNameString - { - /// - /// Length of the type or name string that follows. A zero value - /// indicates the end of the resource type and name string, also - /// the end of the resource table. - /// - public byte Length; - - /// - /// ASCII text of the type or name string. - /// - public byte[] Text; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/ResourceTypeInformationEntry.cs b/BinaryObjectScanner.Models/NewExecutable/ResourceTypeInformationEntry.cs deleted file mode 100644 index 8bf40356..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/ResourceTypeInformationEntry.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - /// A table of resource type information blocks follows. The following - /// is the format of each type information block: - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ResourceTypeInformationEntry - { - /// - /// Type ID. This is an integer type if the high-order bit is - /// set (8000h); otherwise, it is an offset to the type string, - /// the offset is relative to the beginning of the resource - /// table. A zero type ID marks the end of the resource type - /// information blocks. - /// - public ushort TypeID; - - /// - /// Number of resources for this type. - /// - public ushort ResourceCount; - - /// - /// Reserved. - /// - public uint Reserved; - - /// - /// A table of resources for this type follows. - /// - public ResourceTypeResourceEntry[] Resources; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/ResourceTypeResourceEntry.cs b/BinaryObjectScanner.Models/NewExecutable/ResourceTypeResourceEntry.cs deleted file mode 100644 index 8a46d392..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/ResourceTypeResourceEntry.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - /// A table of resources for this type follows. The following is - /// the format of each resource (8 bytes each): - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ResourceTypeResourceEntry - { - /// - /// File offset to the contents of the resource data, - /// relative to beginning of file. The offset is in terms - /// of the alignment shift count value specified at - /// beginning of the resource table. - /// - public ushort Offset; - - /// - /// Length of the resource in the file (in bytes). - /// - public ushort Length; - - /// - /// Flag word. - /// - public ResourceTypeResourceFlag FlagWord; - - /// - /// Resource ID. This is an integer type if the high-order - /// bit is set (8000h), otherwise it is the offset to the - /// resource string, the offset is relative to the - /// beginning of the resource table. - /// - public ushort ResourceID; - - /// - /// Reserved. - /// - public uint Reserved; - } -} diff --git a/BinaryObjectScanner.Models/NewExecutable/SegmentTableEntry.cs b/BinaryObjectScanner.Models/NewExecutable/SegmentTableEntry.cs deleted file mode 100644 index 241f8bf6..00000000 --- a/BinaryObjectScanner.Models/NewExecutable/SegmentTableEntry.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.NewExecutable -{ - /// - /// The segment table contains an entry for each segment in the executable - /// file. The number of segment table entries are defined in the segmented - /// EXE header. The first entry in the segment table is segment number 1. - /// The following is the structure of a segment table entry. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class SegmentTableEntry - { - /// - /// Logical-sector offset (n byte) to the contents of the segment - /// data, relative to the beginning of the file. Zero means no - /// file data. - /// - public ushort Offset; - - /// - /// Length of the segment in the file, in bytes. Zero means 64K. - /// - public ushort Length; - - /// - /// Flag word. - /// - public SegmentTableEntryFlag FlagWord; - - /// - /// Minimum allocation size of the segment, in bytes. Total size - /// of the segment. Zero means 64K. - /// - public ushort MinimumAllocationSize; - } -} diff --git a/BinaryObjectScanner.Models/Nitro/Cart.cs b/BinaryObjectScanner.Models/Nitro/Cart.cs deleted file mode 100644 index 8159dccb..00000000 --- a/BinaryObjectScanner.Models/Nitro/Cart.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace BinaryObjectScanner.Models.Nitro -{ - /// - /// Represents a DS/DSi cart image - /// - public class Cart - { - /// - /// DS/DSi cart header - /// - public CommonHeader CommonHeader { get; set; } - - /// - /// DSi extended cart header - /// - public ExtendedDSiHeader ExtendedDSiHeader { get; set; } - - /// - /// Secure area, may be encrypted or decrypted - /// - public byte[] SecureArea { get; set; } - - /// - /// Name table (folder allocation table, name list) - /// - public NameTable NameTable { get; set; } - - /// - /// File allocation table - /// - public FileAllocationTableEntry[] FileAllocationTable { get; set; } - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Nitro/CommonHeader.cs b/BinaryObjectScanner.Models/Nitro/CommonHeader.cs deleted file mode 100644 index 3ba53a69..00000000 --- a/BinaryObjectScanner.Models/Nitro/CommonHeader.cs +++ /dev/null @@ -1,214 +0,0 @@ -namespace BinaryObjectScanner.Models.Nitro -{ - /// - /// Nintendo DS / DSi cartridge header - /// - /// - public sealed class CommonHeader - { - /// - /// Game Title - /// - public string GameTitle; - - /// - /// Gamecode - /// - public uint GameCode; - - /// - /// Makercode - /// - public string MakerCode; - - /// - /// Unitcode - /// - public Unitcode UnitCode; - - /// - /// Encryption seed select (device code. 0 = normal) - /// - public byte EncryptionSeedSelect; - - /// - /// Devicecapacity - /// - public byte DeviceCapacity; - - /// - /// Reserved - /// - public byte[] Reserved1; - - /// - /// Game Revision (used by DSi titles) - /// - public ushort GameRevision; - - /// - /// ROM Version - /// - public byte RomVersion; - - /// - /// Internal flags, (Bit2: Autostart) - /// - public byte InternalFlags; - - /// - /// ARM9 rom offset - /// - public uint ARM9RomOffset; - - /// - /// ARM9 entry address - /// - public uint ARM9EntryAddress; - - /// - /// ARM9 load address - /// - public uint ARM9LoadAddress; - - /// - /// ARM9 size - /// - public uint ARM9Size; - - /// - /// ARM7 rom offset - /// - public uint ARM7RomOffset; - - /// - /// ARM7 entry address - /// - public uint ARM7EntryAddress; - - /// - /// ARM7 load address - /// - public uint ARM7LoadAddress; - - /// - /// ARM7 size - /// - public uint ARM7Size; - - /// - /// File Name Table (FNT) offset - /// - public uint FileNameTableOffset; - - /// - /// File Name Table (FNT) length - /// - public uint FileNameTableLength; - - /// - /// File Allocation Table (FNT) offset - /// - public uint FileAllocationTableOffset; - - /// - /// File Allocation Table (FNT) length - /// - public uint FileAllocationTableLength; - - /// - /// File Name Table (FNT) offset - /// - public uint ARM9OverlayOffset; - - /// - /// File Name Table (FNT) length - /// - public uint ARM9OverlayLength; - - /// - /// File Name Table (FNT) offset - /// - public uint ARM7OverlayOffset; - - /// - /// File Name Table (FNT) length - /// - public uint ARM7OverlayLength; - - /// - /// Normal card control register settings (0x00416657 for OneTimePROM) - /// - public uint NormalCardControlRegisterSettings; - - /// - /// Secure card control register settings (0x081808F8 for OneTimePROM) - /// - public uint SecureCardControlRegisterSettings; - - /// - /// Icon Banner offset (NDSi same as NDS, but with new extra entries) - /// - public uint IconBannerOffset; - - /// - /// Secure area (2K) CRC - /// - public ushort SecureAreaCRC; - - /// - /// Secure transfer timeout (0x0D7E for OneTimePROM) - /// - public ushort SecureTransferTimeout; - - /// - /// ARM9 autoload - /// - public uint ARM9Autoload; - - /// - /// ARM7 autoload - /// - public uint ARM7Autoload; - - /// - /// Secure disable - /// - public byte[] SecureDisable; - - /// - /// NTR region ROM size (excluding DSi area) - /// - public uint NTRRegionRomSize; - - /// - /// Header size - /// - public uint HeaderSize; - - /// - ///Reserved (0x88, 0x8C, 0x90 = Unknown, used by DSi) - /// - public byte[] Reserved2; - - /// - /// Nintendo Logo - /// - public byte[] NintendoLogo; - - /// - /// Nintendo Logo CRC - /// - public ushort NintendoLogoCRC; - - /// - /// Header CRC - /// - public ushort HeaderCRC; - - /// - /// Debugger reserved - /// - public byte[] DebuggerReserved; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Nitro/Constants.cs b/BinaryObjectScanner.Models/Nitro/Constants.cs deleted file mode 100644 index 4c6a3262..00000000 --- a/BinaryObjectScanner.Models/Nitro/Constants.cs +++ /dev/null @@ -1,368 +0,0 @@ -namespace BinaryObjectScanner.Models.Nitro -{ - public static class Constants - { - public const uint MAGIC30 = 0x72636E65; - - public const uint MAGIC34 = 0x6A624F79; - - #region Empty Secure Area - - public const uint EmptySecureAreaValue1 = 0x00000000; - - public const uint EmptySecureAreaValue2 = 0x00000000; - - #endregion - - #region Improperly Decrypted Secure Area - - public const uint ImproperlyDecrypted1Value1 = 0xE386C397; - - public const uint ImproperlyDecrypted1Value2 = 0x82775B7E; - - public const uint ImproperlyDecrypted2Value1 = 0xF98415B8; - - public const uint ImproperlyDecrypted2Value2 = 0x698068FC; - - public const uint ImproperlyDecrypted3Value1 = 0xA71329EE; - - public const uint ImproperlyDecrypted3Value2 = 0x2A1D4C38; - - public const uint ImproperlyDecrypted4Value1 = 0xC44DCC48; - - public const uint ImproperlyDecrypted4Value2 = 0x38B6F8CB; - - public const uint ImproperlyDecrypted5Value1 = 0x3A9323B5; - - public const uint ImproperlyDecrypted5Value2 = 0xC0387241; - - #endregion - - #region Improperly Encrypted Secure Area - - public const uint ImproperlyEncrypted1Value1 = 0x4BCE88BE; - - public const uint ImproperlyEncrypted1Value2 = 0xD3662DD1; - - public const uint ImproperlyEncrypted2Value1 = 0x2543C534; - - public const uint ImproperlyEncrypted2Value2 = 0xCC4BE38E; - - #endregion - - #region Properly Decrypted Non-Standard Secure Area (Mastering Issue) - - /// Dragon Quest 5 (EU) - public const uint NonStandardDecrypted1Value1 = 0xD0D48B67; - - /// Dragon Quest 5 (EU) - public const uint NonStandardDecrypted1Value2 = 0x39392F23; - - /// Dragon Quest 5 (USA) - public const uint NonStandardDecrypted2Value1 = 0x014A191A; - - /// Dragon Quest 5 (USA) - public const uint NonStandardDecrypted2Value2 = 0xA5C470B9; - - /// Dragon Quest 5 (JP) - public const uint NonStandardDecrypted3Value1 = 0x7829BC8D; - - /// Dragon Quest 5 (JP) - public const uint NonStandardDecrypted3Value2 = 0x9968EF44; - - /// Prince of Persia (EU) - public const uint NonStandardDecrypted4Value1 = 0xC4A15AB8; - - /// Prince of Persia (EU) - public const uint NonStandardDecrypted4Value2 = 0xD2E667C8; - - /// Prince of Persia (USA) - public const uint NonStandardDecrypted5Value1 = 0xD5E97D20; - - /// Prince of Persia (USA) - public const uint NonStandardDecrypted5Value2 = 0x21B2A159; - - #endregion - - #region Properly Decrypted Prototype Secure Area - - public const uint PrototypeDecryptedValue1 = 0xBA35F813; - - public const uint PrototypeDecryptedValue2 = 0xB691AAE8; - - #endregion - - #region Properly Decrypted Secure Area - - public const uint DecryptedValue1 = 0xE7FFDEFF; - - public const uint DecryptedValue2 = 0xE7FFDEFF; - - #endregion - - public static byte[] EncryptionData = new byte[] - { - 0x99,0xD5,0x20,0x5F,0x57,0x44,0xF5,0xB9,0x6E,0x19,0xA4,0xD9,0x9E,0x6A,0x5A,0x94, - 0xD8,0xAE,0xF1,0xEB,0x41,0x75,0xE2,0x3A,0x93,0x82,0xD0,0x32,0x33,0xEE,0x31,0xD5, - 0xCC,0x57,0x61,0x9A,0x37,0x06,0xA2,0x1B,0x79,0x39,0x72,0xF5,0x55,0xAE,0xF6,0xBE, - 0x5F,0x1B,0x69,0xFB,0xE5,0x9D,0xF1,0xE9,0xCE,0x2C,0xD9,0xA1,0x5E,0x32,0x05,0xE6, - 0xFE,0xD3,0xFE,0xCF,0xD4,0x62,0x04,0x0D,0x8B,0xF5,0xEC,0xB7,0x2B,0x60,0x79,0xBB, - 0x12,0x95,0x31,0x0D,0x6E,0x3F,0xDA,0x2B,0x88,0x84,0xF0,0xF1,0x3D,0x12,0x7E,0x25, - 0x45,0x22,0xF1,0xBB,0x24,0x06,0x1A,0x06,0x11,0xAD,0xDF,0x28,0x8B,0x64,0x81,0x34, - 0x2B,0xEB,0x33,0x29,0x99,0xAA,0xF2,0xBD,0x9C,0x14,0x95,0x9D,0x9F,0xF7,0xF5,0x8C, - 0x72,0x97,0xA1,0x29,0x9D,0xD1,0x5F,0xCF,0x66,0x4D,0x07,0x1A,0xDE,0xD3,0x4A,0x4B, - 0x85,0xC9,0xA7,0xA3,0x17,0x95,0x05,0x3A,0x3D,0x49,0x0A,0xBF,0x0A,0x89,0x8B,0xA2, - 0x4A,0x82,0x49,0xDD,0x27,0x90,0xF1,0x0B,0xE9,0xEB,0x1C,0x6A,0x83,0x76,0x45,0x05, - 0xBA,0x81,0x70,0x61,0x17,0x3F,0x4B,0xDE,0xAE,0xCF,0xAB,0x39,0x57,0xF2,0x3A,0x56, - 0x48,0x11,0xAD,0x8A,0x40,0xE1,0x45,0x3F,0xFA,0x9B,0x02,0x54,0xCA,0xA6,0x93,0xFB, - 0xEF,0x4D,0xFE,0x6F,0xA3,0xD8,0x87,0x9C,0x08,0xBA,0xD5,0x48,0x6A,0x8D,0x2D,0xFD, - 0x6E,0x15,0xF8,0x74,0xBD,0xBE,0x52,0x8B,0x18,0x22,0x8A,0x9E,0xFB,0x74,0x37,0x07, - 0x1B,0x36,0x6C,0x4A,0x19,0xBA,0x42,0x62,0xB9,0x79,0x91,0x10,0x7B,0x67,0x65,0x96, - 0xFE,0x02,0x23,0xE8,0xEE,0x99,0x8C,0x77,0x3E,0x5C,0x86,0x64,0x4D,0x6D,0x78,0x86, - 0xA5,0x4F,0x65,0xE2,0x1E,0xB2,0xDF,0x5A,0x0A,0xD0,0x7E,0x08,0x14,0xB0,0x71,0xAC, - 0xBD,0xDB,0x83,0x1C,0xB9,0xD7,0xA1,0x62,0xCD,0xC6,0x63,0x7C,0x52,0x69,0xC3,0xE6, - 0xBF,0x75,0xCE,0x12,0x44,0x5D,0x21,0x04,0xFA,0xFB,0xD3,0x3C,0x38,0x11,0x63,0xD4, - 0x95,0x85,0x41,0x49,0x46,0x09,0xF2,0x08,0x43,0x11,0xDC,0x1F,0x76,0xC0,0x15,0x6D, - 0x1F,0x3C,0x63,0x70,0xEA,0x87,0x80,0x6C,0xC3,0xBD,0x63,0x8B,0xC2,0x37,0x21,0x37, - 0xDC,0xEE,0x09,0x23,0x2E,0x37,0x6A,0x4D,0x73,0x90,0xF7,0x50,0x30,0xAC,0x1C,0x92, - 0x04,0x10,0x23,0x91,0x4F,0xD2,0x07,0xAA,0x68,0x3E,0x4F,0x9A,0xC9,0x64,0x60,0x6A, - 0xC8,0x14,0x21,0xF3,0xD6,0x22,0x41,0x12,0x44,0x24,0xCF,0xE6,0x8A,0x56,0xDD,0x0D, - 0x53,0x4D,0xE1,0x85,0x1E,0x8C,0x52,0x5A,0x9C,0x19,0x84,0xC2,0x03,0x57,0xF1,0x6F, - 0xE3,0x00,0xBE,0x58,0xF6,0x4C,0xED,0xD5,0x21,0x64,0x9C,0x1F,0xBE,0x55,0x03,0x3C, - 0x4A,0xDC,0xFF,0xAA,0xC9,0xDA,0xE0,0x5D,0x5E,0xBF,0xE6,0xDE,0xF5,0xD8,0xB1,0xF8, - 0xFF,0x36,0xB3,0xB9,0x62,0x67,0x95,0xDB,0x31,0x5F,0x37,0xED,0x4C,0x70,0x67,0x99, - 0x90,0xB5,0x18,0x31,0x6C,0x3D,0x99,0x99,0xE4,0x42,0xDA,0xD3,0x25,0x42,0x13,0xA0, - 0xAE,0xD7,0x70,0x6C,0xB1,0x55,0xCF,0xC7,0xD7,0x46,0xD5,0x43,0x61,0x17,0x3D,0x44, - 0x28,0xE9,0x33,0x85,0xD5,0xD0,0xA2,0x93,0xAA,0x25,0x12,0x1F,0xFB,0xC5,0x0B,0x46, - 0xF5,0x97,0x76,0x56,0x45,0xA6,0xBE,0x87,0xB1,0x94,0x6B,0xE8,0xB1,0xFE,0x33,0x99, - 0xAE,0x1F,0x3E,0x6C,0x39,0x71,0x1D,0x09,0x00,0x90,0x37,0xE4,0x10,0x3E,0x75,0x74, - 0xFF,0x8C,0x83,0x3B,0xB0,0xF1,0xB0,0xF9,0x01,0x05,0x47,0x42,0x95,0xF1,0xD6,0xAC, - 0x7E,0x38,0xE6,0x9E,0x95,0x74,0x26,0x3F,0xB4,0x68,0x50,0x18,0xD0,0x43,0x30,0xB4, - 0x4C,0x4B,0xE3,0x68,0xBF,0xE5,0x4D,0xB6,0x95,0x8B,0x0A,0xA0,0x74,0x25,0x32,0x77, - 0xCF,0xA1,0xF7,0x2C,0xD8,0x71,0x13,0x5A,0xAB,0xEA,0xC9,0x51,0xE8,0x0D,0xEE,0xEF, - 0xE9,0x93,0x7E,0x19,0xA7,0x1E,0x43,0x38,0x81,0x16,0x2C,0xA1,0x48,0xE3,0x73,0xCC, - 0x29,0x21,0x6C,0xD3,0x5D,0xCE,0xA0,0xD9,0x61,0x71,0x43,0xA0,0x15,0x13,0xB5,0x64, - 0x92,0xCF,0x2A,0x19,0xDC,0xAD,0xB7,0xA5,0x9F,0x86,0x65,0xF8,0x1A,0x9F,0xE7,0xFB, - 0xF7,0xFD,0xB8,0x13,0x6C,0x27,0xDB,0x6F,0xDF,0x35,0x1C,0xF7,0x8D,0x2C,0x5B,0x9B, - 0x12,0xAB,0x38,0x64,0x06,0xCC,0xDE,0x31,0xE8,0x4E,0x75,0x11,0x64,0xE3,0xFA,0xEA, - 0xEB,0x34,0x54,0xC2,0xAD,0x3F,0x34,0xEB,0x93,0x2C,0x7D,0x26,0x36,0x9D,0x56,0xF3, - 0x5A,0xE1,0xF6,0xB3,0x98,0x63,0x4A,0x9E,0x32,0x83,0xE4,0x9A,0x84,0x60,0x7D,0x90, - 0x2E,0x13,0x0E,0xEE,0x93,0x4B,0x36,0xA2,0x85,0xEC,0x16,0x38,0xE8,0x88,0x06,0x02, - 0xBF,0xF0,0xA0,0x3A,0xED,0xD7,0x6A,0x9A,0x73,0xE1,0x57,0xCF,0xF8,0x44,0xB8,0xDC, - 0x2E,0x23,0x59,0xD1,0xDF,0x95,0x52,0x71,0x99,0x61,0xA0,0x4B,0xD5,0x7F,0x6E,0x78, - 0xBA,0xA9,0xC5,0x30,0xD3,0x40,0x86,0x32,0x9D,0x32,0x0C,0x9C,0x37,0xB7,0x02,0x2F, - 0xBA,0x54,0x98,0xA9,0xC4,0x13,0x04,0xC9,0x8D,0xBE,0xC8,0xE7,0x5D,0x97,0x50,0x2E, - 0x93,0xD6,0x22,0x59,0x0C,0x27,0xBC,0x22,0x92,0xE0,0xA7,0x20,0x0F,0x93,0x6F,0x7F, - 0x4C,0x9F,0xD3,0xB5,0xA6,0x2A,0x0B,0x74,0x67,0x49,0x7D,0x10,0x26,0xCB,0xD1,0xC5, - 0x86,0x71,0xE7,0x8C,0xA0,0x9C,0xE9,0x5B,0xB2,0x1A,0xF6,0x01,0xEE,0x8C,0x9E,0x5E, - 0x83,0xF2,0x1A,0xDB,0xE6,0xE5,0xEA,0x84,0x59,0x76,0xD2,0x7C,0xF6,0x8D,0xA5,0x49, - 0x36,0x48,0xC2,0x16,0x52,0xBB,0x83,0xA3,0x74,0xB9,0x07,0x0C,0x3B,0xFF,0x61,0x28, - 0xE1,0x61,0xE9,0xE4,0xEF,0x6E,0x15,0xAA,0x4E,0xBA,0xE8,0x5D,0x05,0x96,0xBB,0x32, - 0x56,0xB0,0xFB,0x72,0x52,0x0F,0x0E,0xC8,0x42,0x25,0x65,0x76,0x89,0xAF,0xF2,0xDE, - 0x10,0x27,0xF0,0x01,0x4B,0x74,0xA7,0x97,0x07,0xD5,0x26,0x54,0x54,0x09,0x1F,0x82, - 0x0A,0x86,0x7D,0x30,0x39,0x0E,0xB3,0x26,0x9B,0x0B,0x57,0xBB,0x36,0x06,0x31,0xAF, - 0xFD,0x79,0xFC,0xD9,0x30,0x10,0x2B,0x0C,0xB3,0xE1,0x9B,0xD7,0x7B,0xDC,0x5F,0xEF, - 0xD2,0xF8,0x13,0x45,0x4D,0x47,0x75,0xBD,0x46,0x96,0x3C,0x7E,0x75,0xF3,0x3E,0xB5, - 0x67,0xC5,0x9A,0x3B,0xB0,0x5B,0x29,0x6B,0xDE,0x80,0x5B,0xC8,0x15,0x05,0xB1,0x31, - 0xB6,0xCE,0x49,0xDD,0xAD,0x84,0xB5,0xAE,0x60,0xDC,0x67,0x31,0x34,0x30,0xFE,0x4E, - 0xBD,0x80,0x2F,0xA6,0xBF,0x63,0x39,0x21,0x86,0xD9,0x35,0x7F,0x16,0x68,0x22,0x05, - 0x54,0xE9,0x90,0x26,0x8C,0x07,0x6C,0x51,0xA4,0x31,0x55,0xD7,0x09,0x07,0xA8,0x3E, - 0x2E,0x53,0x66,0xC1,0xF8,0xF2,0x7B,0xC4,0xF2,0x58,0xCF,0xF1,0x87,0xC5,0xA2,0xE7, - 0x27,0x8F,0x30,0x87,0x58,0xA0,0x64,0x62,0x23,0x18,0xB9,0x88,0x7C,0xFA,0xCE,0xC4, - 0x98,0xAE,0xAD,0x17,0xCC,0x4A,0x5B,0xF3,0xE9,0x48,0xD5,0x56,0xD3,0x0D,0xF2,0xC8, - 0x92,0x73,0x8C,0xDB,0xD7,0x2F,0x56,0xAC,0x81,0xF9,0x92,0x69,0x4D,0xC6,0x32,0xF6, - 0xE6,0xC0,0x8D,0x21,0xE2,0x76,0x80,0x61,0x11,0xBC,0xDC,0x6C,0x93,0xAF,0x19,0x69, - 0x9B,0xD0,0xBF,0xB9,0x31,0x9F,0x02,0x67,0xA3,0x51,0xEE,0x83,0x06,0x22,0x7B,0x0C, - 0xAB,0x49,0x42,0x40,0xB8,0xD5,0x01,0x7D,0xCE,0x5E,0xF7,0x55,0x53,0x39,0xC5,0x99, - 0x46,0xD8,0x87,0x9F,0xBA,0xF7,0x64,0xB4,0xE3,0x9A,0xFA,0xA1,0x6D,0x90,0x68,0x10, - 0x30,0xCA,0x8A,0x54,0xA7,0x9F,0x60,0xC3,0x19,0xF5,0x6B,0x0D,0x7A,0x51,0x98,0xE6, - 0x98,0x43,0x51,0xB4,0xD6,0x35,0xE9,0x4F,0xC3,0xDF,0x0F,0x7B,0xD6,0x2F,0x5C,0xBD, - 0x3A,0x15,0x61,0x19,0xF1,0x4B,0xCB,0xAA,0xDC,0x6D,0x64,0xC9,0xD3,0xC6,0x1E,0x56, - 0xEF,0x38,0x4C,0x50,0x71,0x86,0x75,0xCC,0x0D,0x0D,0x4E,0xE9,0x28,0xF6,0x06,0x5D, - 0x70,0x1B,0xAA,0xD3,0x45,0xCF,0xA8,0x39,0xAC,0x95,0xA6,0x2E,0xB4,0xE4,0x22,0xD4, - 0x74,0xA8,0x37,0x5F,0x48,0x7A,0x04,0xCC,0xA5,0x4C,0x40,0xD8,0x28,0xB4,0x28,0x08, - 0x0D,0x1C,0x72,0x52,0x41,0xF0,0x7D,0x47,0x19,0x3A,0x53,0x4E,0x58,0x84,0x62,0x6B, - 0x93,0xB5,0x8A,0x81,0x21,0x4E,0x0D,0xDC,0xB4,0x3F,0xA2,0xC6,0xFC,0xC9,0x2B,0x40, - 0xDA,0x38,0x04,0xE9,0x5E,0x5A,0x86,0x6B,0x0C,0x22,0x25,0x85,0x68,0x11,0x8D,0x7C, - 0x92,0x1D,0x95,0x55,0x4D,0xAB,0x8E,0xBB,0xDA,0xA6,0xE6,0xB7,0x51,0xB6,0x32,0x5A, - 0x05,0x41,0xDD,0x05,0x2A,0x0A,0x56,0x50,0x91,0x17,0x47,0xCC,0xC9,0xE6,0x7E,0xB5, - 0x61,0x4A,0xDB,0x73,0x67,0x51,0xC8,0x33,0xF5,0xDA,0x6E,0x74,0x2E,0x54,0xC3,0x37, - 0x0D,0x6D,0xAF,0x08,0xE8,0x15,0x8A,0x5F,0xE2,0x59,0x21,0xCD,0xA8,0xDE,0x0C,0x06, - 0x5A,0x77,0x6B,0x5F,0xDB,0x18,0x65,0x3E,0xC8,0x50,0xDE,0x78,0xE0,0xB8,0x82,0xB3, - 0x5D,0x4E,0x72,0x32,0x07,0x4F,0xC1,0x34,0x23,0xBA,0x96,0xB7,0x67,0x4E,0xA4,0x28, - 0x1E,0x34,0x62,0xEB,0x2D,0x6A,0x70,0xE9,0x2F,0x42,0xC4,0x70,0x4E,0x5A,0x31,0x9C, - 0xF9,0x5B,0x47,0x28,0xAA,0xDA,0x71,0x6F,0x38,0x1F,0xB3,0x78,0xC4,0x92,0x6B,0x1C, - 0x9E,0xF6,0x35,0x9A,0xB7,0x4D,0x0E,0xBF,0xCC,0x18,0x29,0x41,0x03,0x48,0x35,0x5D, - 0x55,0xD0,0x2B,0xC6,0x29,0xAF,0x5C,0x60,0x74,0x69,0x8E,0x5E,0x9B,0x7C,0xD4,0xBD, - 0x7B,0x44,0x64,0x7D,0x3F,0x92,0x5D,0x69,0xB6,0x1F,0x00,0x4B,0xD4,0x83,0x35,0xCF, - 0x7E,0x64,0x4E,0x17,0xAE,0x8D,0xD5,0x2E,0x9A,0x28,0x12,0x4E,0x2E,0x2B,0x49,0x08, - 0x5C,0xAE,0xC6,0x46,0x85,0xAE,0x41,0x61,0x1E,0x6F,0x82,0xD2,0x51,0x37,0x16,0x1F, - 0x0B,0xF6,0x59,0xA4,0x9A,0xCA,0x5A,0xAF,0x0D,0xD4,0x33,0x8B,0x20,0x63,0xF1,0x84, - 0x80,0x5C,0xCB,0xCF,0x08,0xB4,0xB9,0xD3,0x16,0x05,0xBD,0x62,0x83,0x31,0x9B,0x56, - 0x51,0x98,0x9F,0xBA,0xB2,0x5B,0xAA,0xB2,0x22,0x6B,0x2C,0xB5,0xD4,0x48,0xFA,0x63, - 0x2B,0x5F,0x58,0xFA,0x61,0xFA,0x64,0x09,0xBB,0x38,0xE0,0xB8,0x9D,0x92,0x60,0xA8, - 0x0D,0x67,0x6F,0x0E,0x37,0xF5,0x0D,0x01,0x9F,0xC2,0x77,0xD4,0xFE,0xEC,0xF1,0x73, - 0x30,0x39,0xE0,0x7D,0xF5,0x61,0x98,0xE4,0x2C,0x28,0x55,0x04,0x56,0x55,0xDB,0x2F, - 0x6B,0xEC,0xE5,0x58,0x06,0xB6,0x64,0x80,0x6A,0x2A,0x1A,0x4E,0x5B,0x0F,0xD8,0xC4, - 0x0A,0x2E,0x52,0x19,0xD9,0x62,0xF5,0x30,0x48,0xBE,0x8C,0x7B,0x4F,0x38,0x9B,0xA2, - 0xC3,0xAF,0xC9,0xD3,0xC7,0xC1,0x62,0x41,0x86,0xB9,0x61,0x21,0x57,0x6F,0x99,0x4F, - 0xC1,0xBA,0xCE,0x7B,0xB5,0x3B,0x4D,0x5E,0x8A,0x8B,0x44,0x57,0x5F,0x13,0x5F,0x70, - 0x6D,0x5B,0x29,0x47,0xDC,0x38,0xE2,0xEC,0x04,0x55,0x65,0x12,0x2A,0xE8,0x17,0x43, - 0xE1,0x8E,0xDD,0x2A,0xB3,0xE2,0x94,0xF7,0x09,0x6E,0x5C,0xE6,0xEB,0x8A,0xF8,0x6D, - 0x89,0x49,0x54,0x48,0xF5,0x2F,0xAD,0xBF,0xEA,0x94,0x4B,0xCA,0xFC,0x39,0x87,0x82, - 0x5F,0x8A,0x01,0xF2,0x75,0xF2,0xE6,0x71,0xD6,0xD8,0x42,0xDE,0xF1,0x2D,0x1D,0x28, - 0xA6,0x88,0x7E,0xA3,0xA0,0x47,0x1D,0x30,0xD9,0xA3,0x71,0xDF,0x49,0x1C,0xCB,0x01, - 0xF8,0x36,0xB1,0xF2,0xF0,0x22,0x58,0x5D,0x45,0x6B,0xBD,0xA0,0xBB,0xB2,0x88,0x42, - 0xC7,0x8C,0x28,0xCE,0x93,0xE8,0x90,0x63,0x08,0x90,0x7C,0x89,0x3C,0xF5,0x7D,0xB7, - 0x04,0x2D,0x4F,0x55,0x51,0x16,0xFD,0x7E,0x79,0xE8,0xBE,0xC1,0xF2,0x12,0xD4,0xF8, - 0xB4,0x84,0x05,0x23,0xA0,0xCC,0xD2,0x2B,0xFD,0xE1,0xAB,0xAD,0x0D,0xD1,0x55,0x6C, - 0x23,0x41,0x94,0x4D,0x77,0x37,0x4F,0x05,0x28,0x0C,0xBF,0x17,0xB3,0x12,0x67,0x6C, - 0x8C,0xC3,0x5A,0xF7,0x41,0x84,0x2A,0x6D,0xD0,0x94,0x12,0x27,0x2C,0xB4,0xED,0x9C, - 0x4D,0xEC,0x47,0x82,0x97,0xD5,0x67,0xB9,0x1B,0x9D,0xC0,0x55,0x07,0x7E,0xE5,0x8E, - 0xE2,0xA8,0xE7,0x3E,0x12,0xE4,0x0E,0x3A,0x2A,0x45,0x55,0x34,0xA2,0xF9,0x2D,0x5A, - 0x1B,0xAB,0x52,0x7C,0x83,0x10,0x5F,0x55,0xD2,0xF1,0x5A,0x43,0x2B,0xC6,0xA7,0xA4, - 0x89,0x15,0x95,0xE8,0xB4,0x4B,0x9D,0xF8,0x75,0xE3,0x9F,0x60,0x78,0x5B,0xD6,0xE6, - 0x0D,0x44,0xE6,0x21,0x06,0xBD,0x47,0x22,0x53,0xA4,0x00,0xAD,0x8D,0x43,0x13,0x85, - 0x39,0xF7,0xAA,0xFC,0x38,0xAF,0x7B,0xED,0xFC,0xE4,0x2B,0x54,0x50,0x98,0x4C,0xFC, - 0x85,0x80,0xF7,0xDF,0x3C,0x80,0x22,0xE1,0x94,0xDA,0xDE,0x24,0xC6,0xB0,0x7A,0x39, - 0x38,0xDC,0x0F,0xA1,0xA7,0xF4,0xF9,0x6F,0x63,0x18,0x57,0x8B,0x84,0x41,0x2A,0x2E, - 0xD4,0x53,0xF2,0xD9,0x00,0x0F,0xD0,0xDD,0x99,0x6E,0x19,0xA6,0x0A,0xD0,0xEC,0x5B, - 0x58,0x24,0xAB,0xC0,0xCB,0x06,0x65,0xEC,0x1A,0x13,0x38,0x94,0x0A,0x67,0x03,0x2F, - 0x3F,0xF7,0xE3,0x77,0x44,0x77,0x33,0xC6,0x14,0x39,0xD0,0xE3,0xC0,0xA2,0x08,0x79, - 0xBB,0x40,0x99,0x57,0x41,0x0B,0x01,0x90,0xCD,0xE1,0xCC,0x48,0x67,0xDB,0xB3,0xAF, - 0x88,0x74,0xF3,0x4C,0x82,0x8F,0x72,0xB1,0xB5,0x23,0x29,0xC4,0x12,0x6C,0x19,0xFC, - 0x8E,0x46,0xA4,0x9C,0xC4,0x25,0x65,0x87,0xD3,0x6D,0xBE,0x8A,0x93,0x11,0x03,0x38, - 0xED,0x83,0x2B,0xF3,0x46,0xA4,0x93,0xEA,0x3B,0x53,0x85,0x1D,0xCE,0xD4,0xF1,0x08, - 0x83,0x27,0xED,0xFC,0x9B,0x1A,0x18,0xBC,0xF9,0x8B,0xAE,0xDC,0x24,0xAB,0x50,0x38, - 0xE9,0x72,0x4B,0x10,0x22,0x17,0x7B,0x46,0x5D,0xAB,0x59,0x64,0xF3,0x40,0xAE,0xF8, - 0xBB,0xE5,0xC8,0xF9,0x26,0x03,0x4E,0x55,0x7D,0xEB,0xEB,0xFE,0xF7,0x39,0xE6,0xE0, - 0x0A,0x11,0xBE,0x2E,0x28,0xFF,0x98,0xED,0xC0,0xC9,0x42,0x56,0x42,0xC3,0xFD,0x00, - 0xF6,0xAF,0x87,0xA2,0x5B,0x01,0x3F,0x32,0x92,0x47,0x95,0x9A,0x72,0xA5,0x32,0x3D, - 0xAE,0x6B,0xD0,0x9B,0x07,0xD2,0x49,0x92,0xE3,0x78,0x4A,0xFA,0xA1,0x06,0x7D,0xF2, - 0x41,0xCF,0x77,0x74,0x04,0x14,0xB2,0x0C,0x86,0x84,0x64,0x16,0xD5,0xBB,0x51,0xA1, - 0xE5,0x6F,0xF1,0xD1,0xF2,0xE2,0xF7,0x5F,0x58,0x20,0x4D,0xB8,0x57,0xC7,0xCF,0xDD, - 0xC5,0xD8,0xBE,0x76,0x3D,0xF6,0x5F,0x7E,0xE7,0x2A,0x8B,0x88,0x24,0x1B,0x38,0x3F, - 0x0E,0x41,0x23,0x77,0xF5,0xF0,0x4B,0xD4,0x0C,0x1F,0xFA,0xA4,0x0B,0x80,0x5F,0xCF, - 0x45,0xF6,0xE0,0xDA,0x2F,0x34,0x59,0x53,0xFB,0x20,0x3C,0x52,0x62,0x5E,0x35,0xB5, - 0x62,0xFE,0x8B,0x60,0x63,0xE3,0x86,0x5A,0x15,0x1A,0x6E,0xD1,0x47,0x45,0xBC,0x32, - 0xB4,0xEB,0x67,0x38,0xAB,0xE4,0x6E,0x33,0x3A,0xB5,0xED,0xA3,0xAD,0x67,0xE0,0x4E, - 0x41,0x95,0xEE,0x62,0x62,0x71,0x26,0x1D,0x31,0xEF,0x62,0x30,0xAF,0xD7,0x82,0xAC, - 0xC2,0xDC,0x05,0x04,0xF5,0x97,0x07,0xBF,0x11,0x59,0x23,0x07,0xC0,0x64,0x02,0xE8, - 0x97,0xE5,0x3E,0xAF,0x18,0xAC,0x59,0xA6,0x8B,0x4A,0x33,0x90,0x1C,0x6E,0x7C,0x9C, - 0x20,0x7E,0x4C,0x3C,0x3E,0x61,0x64,0xBB,0xC5,0x6B,0x7C,0x7E,0x3E,0x9F,0xC5,0x4C, - 0x9F,0xEA,0x73,0xF5,0xD7,0x89,0xC0,0x4C,0xF4,0xFB,0xF4,0x2D,0xEC,0x14,0x1B,0x51, - 0xD5,0xC1,0x12,0xC8,0x10,0xDF,0x0B,0x4A,0x8B,0x9C,0xBC,0x93,0x45,0x6A,0x3E,0x3E, - 0x7D,0xC1,0xA9,0xBA,0xCD,0xC1,0xB4,0x07,0xE4,0xE1,0x68,0x86,0x43,0xB2,0x6D,0x38, - 0xF3,0xFB,0x0C,0x5C,0x66,0x37,0x71,0xDE,0x56,0xEF,0x6E,0xA0,0x10,0x40,0x65,0xA7, - 0x98,0xF7,0xD0,0xBE,0x0E,0xC8,0x37,0x36,0xEC,0x10,0xCA,0x7C,0x9C,0xAB,0x84,0x1E, - 0x05,0x17,0x76,0x02,0x1C,0x4F,0x52,0xAA,0x5F,0xC1,0xC6,0xA0,0x56,0xB9,0xD8,0x04, - 0x84,0x44,0x4D,0xA7,0x59,0xD8,0xDE,0x60,0xE6,0x38,0x0E,0x05,0x8F,0x03,0xE1,0x3B, - 0x6D,0x81,0x04,0x33,0x6F,0x30,0x0B,0xCE,0x69,0x05,0x21,0x33,0xFB,0x26,0xBB,0x89, - 0x7D,0xB6,0xAE,0x87,0x7E,0x51,0x07,0xE0,0xAC,0xF7,0x96,0x0A,0x6B,0xF9,0xC4,0x5C, - 0x1D,0xE4,0x44,0x47,0xB8,0x5E,0xFA,0xE3,0x78,0x84,0x55,0x42,0x4B,0x48,0x5E,0xF7, - 0x7D,0x47,0x35,0x86,0x1D,0x2B,0x43,0x05,0x03,0xEC,0x8A,0xB8,0x1E,0x06,0x3C,0x76, - 0x0C,0x48,0x1A,0x43,0xA7,0xB7,0x8A,0xED,0x1E,0x13,0xC6,0x43,0xEE,0x10,0xEF,0xDB, - 0xEC,0xFB,0x3C,0x83,0xB2,0x95,0x44,0xEF,0xD8,0x54,0x51,0x4E,0x2D,0x11,0x44,0x1D, - 0xFB,0x36,0x59,0x1E,0x7A,0x34,0xC1,0xC3,0xCA,0x57,0x00,0x61,0xEA,0x67,0xA5,0x16, - 0x9B,0x55,0xD0,0x55,0xE1,0x7F,0xD9,0x36,0xD2,0x40,0x76,0xAE,0xDC,0x01,0xCE,0xB0, - 0x7A,0x83,0xD5,0xCB,0x20,0x98,0xEC,0x6B,0xC1,0x72,0x92,0x34,0xF3,0x82,0x57,0x37, - 0x62,0x8A,0x32,0x36,0x0C,0x90,0x43,0xAE,0xAE,0x5C,0x9B,0x78,0x8E,0x13,0x65,0x02, - 0xFD,0x68,0x71,0xC1,0xFE,0xB0,0x31,0xA0,0x24,0x82,0xB0,0xC3,0xB1,0x79,0x69,0xA7, - 0xF5,0xD2,0xEB,0xD0,0x82,0xC0,0x32,0xDC,0x9E,0xC7,0x26,0x3C,0x6D,0x8D,0x98,0xC1, - 0xBB,0x22,0xD4,0xD0,0x0F,0x33,0xEC,0x3E,0xB9,0xCC,0xE1,0xDC,0x6A,0x4C,0x77,0x36, - 0x14,0x1C,0xF9,0xBF,0x81,0x9F,0x28,0x5F,0x71,0x85,0x32,0x29,0x90,0x75,0x48,0xC4, - 0xB3,0x4A,0xCE,0xD8,0x44,0x8F,0x14,0x2F,0xFD,0x40,0x57,0xEF,0xAA,0x08,0x75,0xD9, - 0x46,0xD1,0xD6,0x6E,0x32,0x55,0x1F,0xC3,0x18,0xFE,0x84,0x1F,0xFC,0x84,0xD5,0xFF, - 0x71,0x5E,0x1B,0x48,0xC3,0x86,0x95,0x0E,0x28,0x08,0x27,0xD3,0x38,0x83,0x71,0x7B, - 0x4C,0x80,0x63,0x54,0x9A,0x56,0xB0,0xAC,0xCF,0x80,0xCA,0x31,0x09,0xEF,0xFE,0xF3, - 0xBE,0xAF,0x24,0x7E,0xA6,0xFE,0x53,0x3F,0xC2,0x8D,0x4A,0x33,0x68,0xD1,0x22,0xA6, - 0x66,0xAD,0x7B,0xEA,0xDE,0xB6,0x43,0xB0,0xA1,0x25,0x95,0x00,0xA3,0x3F,0x75,0x46, - 0x14,0x11,0x44,0xEC,0xD7,0x95,0xBC,0x92,0xF0,0x4F,0xA9,0x16,0x53,0x62,0x97,0x60, - 0x2A,0x0F,0x41,0xF1,0x71,0x24,0xBE,0xEE,0x94,0x7F,0x08,0xCD,0x60,0x93,0xB3,0x85, - 0x5B,0x07,0x00,0x3F,0xD8,0x0F,0x28,0x83,0x9A,0xD1,0x69,0x9F,0xD1,0xDA,0x2E,0xC3, - 0x90,0x01,0xA2,0xB9,0x6B,0x4E,0x2A,0x66,0x9D,0xDA,0xAE,0xA6,0xEA,0x2A,0xD3,0x68, - 0x2F,0x0C,0x0C,0x9C,0xD2,0x8C,0x4A,0xED,0xE2,0x9E,0x57,0x65,0x9D,0x09,0x87,0xA3, - 0xB4,0xC4,0x32,0x5D,0xC9,0xD4,0x32,0x2B,0xB1,0xE0,0x71,0x1E,0x64,0x4D,0xE6,0x90, - 0x71,0xE3,0x1E,0x40,0xED,0x7D,0xF3,0x84,0x0E,0xED,0xC8,0x78,0x76,0xAE,0xC0,0x71, - 0x27,0x72,0xBB,0x05,0xEA,0x02,0x64,0xFB,0xF3,0x48,0x6B,0xB5,0x42,0x93,0x3F,0xED, - 0x9F,0x13,0x53,0xD2,0xF7,0xFE,0x2A,0xEC,0x1D,0x47,0x25,0xDB,0x3C,0x91,0x86,0xC6, - 0x8E,0xF0,0x11,0xFD,0x23,0x74,0x36,0xF7,0xA4,0xF5,0x9E,0x7A,0x7E,0x53,0x50,0x44, - 0xD4,0x47,0xCA,0xD3,0xEB,0x38,0x6D,0xE6,0xD9,0x71,0x94,0x7F,0x4A,0xC6,0x69,0x4B, - 0x11,0xF4,0x52,0xEA,0x22,0xFE,0x8A,0xB0,0x36,0x67,0x8B,0x59,0xE8,0xE6,0x80,0x2A, - 0xEB,0x65,0x04,0x13,0xEE,0xEC,0xDC,0x9E,0x5F,0xB1,0xEC,0x05,0x6A,0x59,0xE6,0x9F, - 0x5E,0x59,0x6B,0x89,0xBF,0xF7,0x1A,0xCA,0x44,0xF9,0x5B,0x6A,0x71,0x85,0x03,0xE4, - 0x29,0x62,0xE0,0x70,0x6F,0x41,0xC4,0xCF,0xB2,0xB1,0xCC,0xE3,0x7E,0xA6,0x07,0xA8, - 0x87,0xE7,0x7F,0x84,0x93,0xDB,0x52,0x4B,0x6C,0xEC,0x7E,0xDD,0xD4,0x24,0x48,0x10, - 0x69,0x9F,0x04,0x60,0x74,0xE6,0x48,0x18,0xF3,0xE4,0x2C,0xB9,0x4F,0x2E,0x50,0x7A, - 0xDF,0xD4,0x54,0x69,0x2B,0x8B,0xA7,0xF3,0xCE,0xFF,0x1F,0xF3,0x3E,0x26,0x01,0x39, - 0x17,0x95,0x84,0x89,0xB0,0xF0,0x4C,0x4B,0x82,0x91,0x9F,0xC4,0x4B,0xAC,0x9D,0xA5, - 0x74,0xAF,0x17,0x25,0xC9,0xCA,0x32,0xD3,0xBC,0x89,0x8A,0x84,0x89,0xCC,0x0D,0xAE, - 0x7C,0xA2,0xDB,0x9C,0x6A,0x78,0x91,0xEE,0xEA,0x76,0x5D,0x4E,0x87,0x60,0xF5,0x69, - 0x15,0x67,0xD4,0x02,0xCF,0xAF,0x48,0x36,0x07,0xEA,0xBF,0x6F,0x66,0x2D,0x06,0x8F, - 0xC4,0x9A,0xFE,0xF9,0xF6,0x90,0x87,0x75,0xB8,0xF7,0xAD,0x0F,0x76,0x10,0x5A,0x3D, - 0x59,0xB0,0x2E,0xB3,0xC7,0x35,0x2C,0xCC,0x70,0x56,0x2B,0xCB,0xE3,0x37,0x96,0xC5, - 0x2F,0x46,0x1B,0x8A,0x22,0x46,0xC7,0x88,0xA7,0x26,0x32,0x98,0x61,0xDF,0x86,0x22, - 0x8A,0xF4,0x1C,0x2F,0x87,0xA1,0x09,0xAA,0xCC,0xA9,0xAE,0xD3,0xBD,0x00,0x45,0x1C, - 0x9A,0x54,0x87,0x86,0x52,0x87,0xEF,0xFF,0x1E,0x8F,0xA1,0x8F,0xC1,0x89,0x5C,0x35, - 0x1B,0xDA,0x2D,0x3A,0x2C,0x16,0xB2,0xC2,0xF1,0x56,0xE2,0x78,0xC1,0x6B,0x63,0x97, - 0xC5,0x56,0x8F,0xC9,0x32,0x7F,0x2C,0xAA,0xAF,0xA6,0xA8,0xAC,0x20,0x91,0x22,0x88, - 0xDE,0xE4,0x60,0x8B,0xF9,0x4B,0x42,0x25,0x1A,0xE3,0x7F,0x9C,0x2C,0x19,0x89,0x3A, - 0x7E,0x05,0xD4,0x36,0xCC,0x69,0x58,0xC2,0xC1,0x32,0x8B,0x2F,0x90,0x85,0xEB,0x7A, - 0x39,0x50,0xA5,0xA1,0x27,0x92,0xC5,0x66,0xB0,0x20,0x4F,0x58,0x7E,0x55,0x83,0x43, - 0x2B,0x45,0xE2,0x9C,0xE4,0xD8,0x12,0x90,0x2C,0x16,0x83,0x56,0x16,0x79,0x03,0xB3, - 0xAD,0x2D,0x61,0x18,0x1A,0x13,0x1F,0x37,0xE2,0xE1,0x9C,0x73,0x7B,0x80,0xD5,0xFD, - 0x2D,0x51,0x87,0xFC,0x7B,0xAA,0xD7,0x1F,0x2C,0x7A,0x8E,0xAF,0xF4,0x8D,0xBB,0xCD, - 0x95,0x11,0x7C,0x72,0x0B,0xEE,0x6F,0xE2,0xB9,0xAF,0xDE,0x37,0x83,0xDE,0x8C,0x8D, - 0x62,0x05,0x67,0xB7,0x96,0xC6,0x8D,0x56,0xB6,0x0D,0xD7,0x62,0xBA,0xD6,0x46,0x36, - 0xBD,0x8E,0xC8,0xE6,0xEA,0x2A,0x6C,0x10,0x14,0xFF,0x6B,0x5B,0xFA,0x82,0x3C,0x46, - 0xB1,0x30,0x43,0x46,0x51,0x8A,0x7D,0x9B,0x92,0x3E,0x83,0x79,0x5B,0x55,0x5D,0xB2, - 0x6C,0x5E,0xCE,0x90,0x62,0x8E,0x53,0x98,0xC9,0x0D,0x6D,0xE5,0x2D,0x57,0xCD,0xC5, - 0x81,0x57,0xBA,0xE1,0xE8,0xB8,0x8F,0x72,0xE5,0x4F,0x13,0xDC,0xEA,0x9D,0x71,0x15, - 0x10,0xB2,0x11,0x88,0xD5,0x09,0xD4,0x7F,0x5B,0x65,0x7F,0x2C,0x3B,0x38,0x4C,0x11, - 0x68,0x50,0x8D,0xFB,0x9E,0xB0,0x59,0xBF,0x94,0x80,0x89,0x4A,0xC5,0x1A,0x18,0x12, - 0x89,0x53,0xD1,0x4A,0x10,0x29,0xE8,0x8C,0x1C,0xEC,0xB6,0xEA,0x46,0xC7,0x17,0x8B, - 0x25,0x15,0x31,0xA8,0xA2,0x6B,0x43,0xB1,0x9D,0xE2,0xDB,0x0B,0x87,0x9B,0xB0,0x11, - 0x04,0x0E,0x71,0xD2,0x29,0x77,0x89,0x82,0x0A,0x66,0x41,0x7F,0x1D,0x0B,0x48,0xFF, - 0x72,0xBB,0x24,0xFD,0xC2,0x48,0xA1,0x9B,0xFE,0x7B,0x7F,0xCE,0x88,0xDB,0x86,0xD9, - 0x85,0x3B,0x1C,0xB0,0xDC,0xA8,0x33,0x07,0xBF,0x51,0x2E,0xE3,0x0E,0x9A,0x00,0x97, - 0x1E,0x06,0xC0,0x97,0x43,0x9D,0xD8,0xB6,0x45,0xC4,0x86,0x67,0x5F,0x00,0xF8,0x88, - 0x9A,0xA4,0x52,0x9E,0xC7,0xAA,0x8A,0x83,0x75,0xEC,0xC5,0x18,0xAE,0xCE,0xC3,0x2F, - 0x1A,0x2B,0xF9,0x18,0xFF,0xAE,0x1A,0xF5,0x53,0x0B,0xB5,0x33,0x51,0xA7,0xFD,0xE8, - 0xA8,0xE1,0xA2,0x64,0xB6,0x22,0x17,0x43,0x80,0xCC,0x0A,0xD8,0xAE,0x3B,0xBA,0x40, - 0xD7,0xD9,0x92,0x4A,0x89,0xDF,0x04,0x10,0xEE,0x9B,0x18,0x2B,0x6A,0x77,0x69,0x8A, - 0x68,0xF4,0xF9,0xB9,0xA2,0x21,0x15,0x6E,0xE6,0x1E,0x3B,0x03,0x62,0x30,0x9B,0x60, - 0x41,0x7E,0x25,0x9B,0x9E,0x8F,0xC5,0x52,0x10,0x08,0xF8,0xC2,0x69,0xA1,0x21,0x11, - 0x88,0x37,0x5E,0x79,0x35,0x66,0xFF,0x10,0x42,0x18,0x6E,0xED,0x97,0xB6,0x6B,0x1C, - 0x4E,0x36,0xE5,0x6D,0x7D,0xB4,0xE4,0xBF,0x20,0xB9,0xE0,0x05,0x3A,0x69,0xD5,0xB8, - 0xE3,0xD5,0xDC,0xE0,0xB9,0xAC,0x53,0x3E,0x07,0xA4,0x57,0xAD,0x77,0xFF,0x48,0x18, - 0x76,0x2A,0xAC,0x49,0x2A,0x8E,0x47,0x75,0x6D,0x9F,0x67,0x63,0x30,0x35,0x8C,0x39, - 0x05,0x39,0xD5,0x6F,0x64,0x3A,0x5B,0xAD,0xCA,0x0B,0xBB,0x82,0x52,0x99,0x45,0xB1, - 0x93,0x36,0x36,0x99,0xAF,0x13,0x20,0x44,0x36,0xD8,0x02,0x44,0x09,0x39,0x92,0x85, - 0xFF,0x4A,0x4A,0x97,0x87,0xA6,0x63,0xD7,0xC7,0xB5,0xB5,0x24,0xED,0x0F,0xB4,0x6F, - 0x0C,0x58,0x52,0x14,0xD9,0xA6,0x7B,0xD3,0x79,0xBC,0x38,0x58,0xA1,0xBD,0x3B,0x84, - 0x06,0xD8,0x1A,0x06,0xFD,0x6B,0xA8,0xEA,0x4B,0x69,0x28,0x04,0x37,0xAD,0x82,0x99, - 0xFB,0x0E,0x1B,0x85,0xBD,0xA8,0x5D,0x73,0xCD,0xDC,0x58,0x75,0x0A,0xBE,0x63,0x6C, - 0x48,0xE7,0x4C,0xE4,0x30,0x2B,0x04,0x60,0xB9,0x15,0xD8,0xDA,0x86,0x81,0x75,0x8F, - 0x96,0xD4,0x8D,0x1C,0x5D,0x70,0x85,0x7C,0x1C,0x67,0x7B,0xD5,0x08,0x67,0xA6,0xCE, - 0x4B,0x0A,0x66,0x70,0xB7,0xE5,0x63,0xD4,0x5B,0x8A,0x82,0xEA,0x10,0x67,0xCA,0xE2, - 0xF4,0xEF,0x17,0x85,0x2F,0x2A,0x5F,0x8A,0x97,0x82,0xF8,0x6A,0xD6,0x34,0x10,0xEA, - 0xEB,0xC9,0x5C,0x3C,0xE1,0x49,0xF8,0x46,0xEB,0xDE,0xBD,0xF6,0xA9,0x92,0xF1,0xAA, - 0xA6,0xA0,0x18,0xB0,0x3A,0xD3,0x0F,0x1F,0xF3,0x6F,0xFF,0x31,0x45,0x43,0x44,0xD3, - 0x50,0x9A,0xF7,0x88,0x09,0x96,0xC1,0xCE,0x76,0xCC,0xF2,0x2C,0x2C,0xBA,0xAD,0x82, - 0x77,0x8F,0x18,0x84,0xC0,0xD2,0x07,0x9C,0x36,0x90,0x83,0x4E,0x0B,0xA5,0x4F,0x43, - 0x3E,0x04,0xAB,0x78,0x4F,0xD6,0xFB,0x09,0x01,0x24,0x90,0xDA,0x6F,0x3C,0x3A,0x61, - 0x0D,0x7F,0x69,0x4A,0xEB,0x2B,0x30,0x02,0xB4,0xDB,0xE0,0x84,0xA9,0xEC,0xD7,0x35, - 0xBF,0x37,0x7D,0x85,0x58,0xCE,0xA9,0x4E,0xE4,0x80,0xC7,0xA8,0xD3,0x30,0x67,0x48, - 0xEB,0x29,0xAF,0x2F,0x74,0x6A,0xB4,0xA7,0x3F,0x0F,0x3F,0x92,0xAF,0xF3,0xCA,0xAC, - 0xAF,0x4B,0xD9,0x94,0xC0,0x43,0xCA,0x81,0x0D,0x2F,0x48,0xA1,0xB0,0x27,0xD5,0xD2, - 0xEF,0x4B,0x05,0x85,0xA3,0xDE,0x4D,0x93,0x30,0x3C,0xF0,0xBB,0x4A,0x8F,0x30,0x27, - 0x4C,0xEB,0xE3,0x3E,0x64,0xED,0x9A,0x2F,0x3B,0xF1,0x82,0xF0,0xBA,0xF4,0xCF,0x7F, - 0x40,0xCB,0xB0,0xE1,0x7F,0xBC,0xAA,0x57,0xD3,0xC9,0x74,0xF2,0xFA,0x43,0x0D,0x22, - 0xD0,0xF4,0x77,0x4E,0x93,0xD7,0x85,0x70,0x1F,0x99,0xBF,0xB6,0xDE,0x35,0xF1,0x30, - 0xA7,0x5E,0x71,0xF0,0x6B,0x01,0x2D,0x7B,0x64,0xF0,0x33,0x53,0x0A,0x39,0x88,0xF3, - 0x6B,0x3A,0xA6,0x6B,0x35,0xD2,0x2F,0x43,0xCD,0x02,0xFD,0xB5,0xE9,0xBC,0x5B,0xAA, - 0xD8,0xA4,0x19,0x7E,0x0E,0x5D,0x94,0x81,0x9E,0x6F,0x77,0xAD,0xD6,0x0E,0x74,0x93, - 0x96,0xE7,0xC4,0x18,0x5F,0xAD,0xF5,0x19, - }; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Nitro/Enums.cs b/BinaryObjectScanner.Models/Nitro/Enums.cs deleted file mode 100644 index ba804ded..00000000 --- a/BinaryObjectScanner.Models/Nitro/Enums.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.Nitro -{ - public enum Unitcode : byte - { - NDS = 0x00, - - NDSPlusDSi = 0x02, - - DSi = 0x03, - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Nitro/ExtendedDSiHeader.cs b/BinaryObjectScanner.Models/Nitro/ExtendedDSiHeader.cs deleted file mode 100644 index 8b55c340..00000000 --- a/BinaryObjectScanner.Models/Nitro/ExtendedDSiHeader.cs +++ /dev/null @@ -1,259 +0,0 @@ -namespace BinaryObjectScanner.Models.Nitro -{ - /// - /// Nintendo DSi extended cart header - /// - /// - public sealed class ExtendedDSiHeader - { - /// - /// Global MBK1..MBK5 Settings - /// - public uint[] GlobalMBK15Settings; - - /// - /// Local MBK6..MBK8 Settings for ARM9 - /// - public uint[] LocalMBK68SettingsARM9; - - /// - /// Local MBK6..MBK8 Settings for ARM7 - /// - public uint[] LocalMBK68SettingsARM7; - - /// - /// Global MBK9 Setting - /// - public uint GlobalMBK9Setting; - - /// - /// Region Flags - /// - public uint RegionFlags; - - /// - /// Access control - /// - public uint AccessControl; - - /// - /// ARM7 SCFG EXT mask (controls which devices to enable) - /// - public uint ARM7SCFGEXTMask; - - /// - /// Reserved/flags? When bit2 of byte 0x1bf is set, usage of banner.sav from the title data dir is enabled.(additional banner data) - /// - public uint ReservedFlags; - - /// - /// ARM9i rom offset - /// - public uint ARM9iRomOffset; - - /// - /// Reserved - /// - public uint Reserved3; - - /// - /// ARM9i load address - /// - public uint ARM9iLoadAddress; - - /// - /// ARM9i size; - /// - public uint ARM9iSize; - - /// - /// ARM7i rom offset - /// - public uint ARM7iRomOffset; - - /// - /// Pointer to base address where various structures and parameters are passed to the title - what is that??? - /// - public uint Reserved4; - - /// - /// ARM7i load address - /// - public uint ARM7iLoadAddress; - - /// - /// ARM7i size; - /// - public uint ARM7iSize; - - /// - /// Digest NTR region offset - /// - public uint DigestNTRRegionOffset; - - /// - /// Digest NTR region length - /// - public uint DigestNTRRegionLength; - - // - /// Digest TWL region offset - /// - public uint DigestTWLRegionOffset; - - /// - /// Digest TWL region length - /// - public uint DigestTWLRegionLength; - - // - /// Digest Sector Hashtable region offset - /// - public uint DigestSectorHashtableRegionOffset; - - /// - /// Digest Sector Hashtable region length - /// - public uint DigestSectorHashtableRegionLength; - - // - /// Digest Block Hashtable region offset - /// - public uint DigestBlockHashtableRegionOffset; - - /// - /// Digest Block Hashtable region length - /// - public uint DigestBlockHashtableRegionLength; - - /// - /// Digest Sector size - /// - public uint DigestSectorSize; - - /// - /// Digeset Block Sectorount - /// - public uint DigestBlockSectorCount; - - /// - /// Icon Banner Size (usually 0x23C0) - /// - public uint IconBannerSize; - - /// - /// Unknown (used by DSi) - /// - public uint Unknown1; - - /// - /// NTR+TWL region ROM size (total size including DSi area) - /// - public uint NTRTWLRegionRomSize; - - /// - /// Unknown (used by DSi) - /// - public byte[] Unknown2; - - /// - /// Modcrypt area 1 offset - /// - public uint ModcryptArea1Offset; - - /// - /// Modcrypt area 1 size - /// - public uint ModcryptArea1Size; - - /// - /// Modcrypt area 2 offset - /// - public uint ModcryptArea2Offset; - - /// - /// Modcrypt area 2 size - /// - public uint ModcryptArea2Size; - - /// - /// Title ID - /// - public byte[] TitleID; - - /// - /// DSiWare: "public.sav" size - /// - public uint DSiWarePublicSavSize; - - /// - /// DSiWare: "private.sav" size - /// - public uint DSiWarePrivateSavSize; - - /// - /// Reserved (zero) - /// - public byte[] ReservedZero; - - /// - /// Unknown (used by DSi) - /// - public byte[] Unknown3; - - /// - /// ARM9 (with encrypted secure area) SHA1 HMAC hash - /// - public byte[] ARM9WithSecureAreaSHA1HMACHash; - - /// - /// ARM7 SHA1 HMAC hash - /// - public byte[] ARM7SHA1HMACHash; - - /// - /// Digest master SHA1 HMAC hash - /// - public byte[] DigestMasterSHA1HMACHash; - - /// - /// Banner SHA1 HMAC hash - /// - public byte[] BannerSHA1HMACHash; - - /// - /// ARM9i (decrypted) SHA1 HMAC hash - /// - public byte[] ARM9iDecryptedSHA1HMACHash; - - /// - /// ARM7i (decrypted) SHA1 HMAC hash - /// - public byte[] ARM7iDecryptedSHA1HMACHash; - - /// - /// Reserved - /// - public byte[] Reserved5; - - /// - /// ARM9 (without secure area) SHA1 HMAC hash - /// - public byte[] ARM9NoSecureAreaSHA1HMACHash; - - /// - /// Reserved - /// - public byte[] Reserved6; - - /// - /// Reserved and unchecked region, always zero. Used for passing arguments in debug environment. - /// - public byte[] ReservedAndUnchecked; - - /// - /// RSA signature (the first 0xE00 bytes of the header are signed with an 1024-bit RSA signature). - /// - public byte[] RSASignature; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Nitro/FileAllocationTableEntry.cs b/BinaryObjectScanner.Models/Nitro/FileAllocationTableEntry.cs deleted file mode 100644 index 4e8217ca..00000000 --- a/BinaryObjectScanner.Models/Nitro/FileAllocationTableEntry.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace BinaryObjectScanner.Models.Nitro -{ - /// - /// The structure of the file allocation table is very simple, - /// it's just a table of 8 byte entries - /// - /// - public sealed class FileAllocationTableEntry - { - /// - /// Start offset of file - /// - public uint StartOffset; - - /// - /// End offset of file (after this is padding) - /// - public uint EndOffset; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Nitro/FolderAllocationTableEntry.cs b/BinaryObjectScanner.Models/Nitro/FolderAllocationTableEntry.cs deleted file mode 100644 index ed08606e..00000000 --- a/BinaryObjectScanner.Models/Nitro/FolderAllocationTableEntry.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace BinaryObjectScanner.Models.Nitro -{ - /// - /// Each folder in the file system has a 8 byte long entry. - /// The first one is for the root folder, and acts as an entry - /// point to the file system. - /// - /// - public sealed class FolderAllocationTableEntry - { - /// - /// Start offset of folder contents within Name List - /// relative to start of NameTable - /// - public uint StartOffset; - - /// - /// Index of first file within folder in File Allocation Table - /// - public ushort FirstFileIndex; - - /// - /// Index of parent folder in current table; for root folder - /// this holds the number of entries in the table - /// - public byte ParentFolderIndex; - - /// - /// Unknown, always 0xF0 except for root folder - /// - public byte Unknown; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Nitro/NameListEntry.cs b/BinaryObjectScanner.Models/Nitro/NameListEntry.cs deleted file mode 100644 index 6e706f60..00000000 --- a/BinaryObjectScanner.Models/Nitro/NameListEntry.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace BinaryObjectScanner.Models.Nitro -{ - /// - /// The name list holds the names of the folders, and their contents - /// in order, with references back to the Folder Allocation Table. - /// - /// - public sealed class NameListEntry - { - /// - /// The least significant 7 bits store the length of the name, - /// and the most significant bit indicates whether it is a - /// folder (1 = folder, 0 = file). - /// - public bool Folder; - - /// - /// The variable length name (UTF-8) - /// - public string Name; - - /// - /// Only there if it is a folder. Refers to the the index of it - /// within the Folder allocation table, allowing its contents to - /// be found. - /// - public ushort Index; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Nitro/NameTable.cs b/BinaryObjectScanner.Models/Nitro/NameTable.cs deleted file mode 100644 index 63399cf2..00000000 --- a/BinaryObjectScanner.Models/Nitro/NameTable.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace BinaryObjectScanner.Models.Nitro -{ - /// - /// The name table stores the names of the files and the structure - /// of the file system. From the information stored, the index of the - /// file's entry in the File Allocation Table can be found. - /// - /// It is split into two parts: - /// - Folder Allocation Table - /// - Name List - /// - /// - public sealed class NameTable - { - /// - /// Folder allocation table - /// - public FolderAllocationTableEntry[] FolderAllocationTable; - - /// - /// Name list - /// - public NameListEntry[] NameList; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PAK/Constants.cs b/BinaryObjectScanner.Models/PAK/Constants.cs deleted file mode 100644 index cbaba9ff..00000000 --- a/BinaryObjectScanner.Models/PAK/Constants.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.PAK -{ - public static class Constants - { - public static readonly byte[] SignatureBytes = new byte[] { 0x50, 0x41, 0x43, 0x4b }; - - public const string SignatureString = "PACK"; - - public const uint SignatureUInt32 = 0x4b434150; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PAK/DirectoryItem.cs b/BinaryObjectScanner.Models/PAK/DirectoryItem.cs deleted file mode 100644 index a0eb3d5b..00000000 --- a/BinaryObjectScanner.Models/PAK/DirectoryItem.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace BinaryObjectScanner.Models.PAK -{ - /// - public sealed class DirectoryItem - { - /// - /// Item Name - /// - public string ItemName; - - /// - /// Item Offset - /// - public uint ItemOffset; - - /// - /// Item Length - /// - public uint ItemLength; - } -} diff --git a/BinaryObjectScanner.Models/PAK/File.cs b/BinaryObjectScanner.Models/PAK/File.cs deleted file mode 100644 index 24694256..00000000 --- a/BinaryObjectScanner.Models/PAK/File.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace BinaryObjectScanner.Models.PAK -{ - /// - /// Half-Life Package File - /// - /// - public sealed class File - { - /// - /// Deserialized directory header data - /// - public Header Header { get; set; } - - /// - /// Deserialized directory items data - /// - public DirectoryItem[] DirectoryItems { get; set; } - } -} diff --git a/BinaryObjectScanner.Models/PAK/Header.cs b/BinaryObjectScanner.Models/PAK/Header.cs deleted file mode 100644 index e0d77918..00000000 --- a/BinaryObjectScanner.Models/PAK/Header.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace BinaryObjectScanner.Models.PAK -{ - /// - public sealed class Header - { - /// - /// Signature - /// - public string Signature; - - /// - /// Directory Offset - /// - public uint DirectoryOffset; - - /// - /// Directory Length - /// - public uint DirectoryLength; - } -} diff --git a/BinaryObjectScanner.Models/PFF/Archive.cs b/BinaryObjectScanner.Models/PFF/Archive.cs deleted file mode 100644 index 0af763d9..00000000 --- a/BinaryObjectScanner.Models/PFF/Archive.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace BinaryObjectScanner.Models.PFF -{ - /// - /// PFF archive - /// - /// - public sealed class Archive - { - /// - /// Archive header - /// - public Header Header { get; set; } - - /// - /// Segments - /// - public Segment[] Segments { get; set; } - - /// - /// Footer - /// - public Footer Footer { get; set; } - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PFF/Constants.cs b/BinaryObjectScanner.Models/PFF/Constants.cs deleted file mode 100644 index cbb75cd1..00000000 --- a/BinaryObjectScanner.Models/PFF/Constants.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace BinaryObjectScanner.Models.PFF -{ - /// - public static class Constants - { - public const string Version0SignatureString = "PFF0"; - public const uint Version0HSegmentSize = 0x00000020; - - // Version 1 not confirmed - // public const string Version1SignatureString = "PFF1"; - // public const uint Version1SegmentSize = 0x00000020; - - public const string Version2SignatureString = "PFF2"; - public const uint Version2SegmentSize = 0x00000020; - - public const string Version3SignatureString = "PFF3"; - public const uint Version3SegmentSize = 0x00000024; - - public const string Version4SignatureString = "PFF4"; - public const uint Version4SegmentSize = 0x00000028; - - public const string FooterKingTag = "KING"; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PFF/Footer.cs b/BinaryObjectScanner.Models/PFF/Footer.cs deleted file mode 100644 index 5c020fc6..00000000 --- a/BinaryObjectScanner.Models/PFF/Footer.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace BinaryObjectScanner.Models.PFF -{ - /// - /// PFF file footer - /// - /// - public sealed class Footer - { - /// - /// Current system IP - /// - public uint SystemIP; - - /// - /// Reserved - /// - public uint Reserved; - - /// - /// King tag - /// - public string KingTag; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PFF/Header.cs b/BinaryObjectScanner.Models/PFF/Header.cs deleted file mode 100644 index e6e89a65..00000000 --- a/BinaryObjectScanner.Models/PFF/Header.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace BinaryObjectScanner.Models.PFF -{ - /// - /// PFF archive header - /// - /// Versions 2, 3, and 4 supported - /// - public sealed class Header - { - /// - /// Size of the following header - /// - public uint HeaderSize; - - /// - /// Signature - /// - /// Versions 2 and 3 share the same signature but different header sizes - public string Signature; - - /// - /// Number of files - /// - public uint NumberOfFiles; - - /// - /// File segment size - /// - public uint FileSegmentSize; - - /// - /// File list offset - /// - public uint FileListOffset; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PFF/Segment.cs b/BinaryObjectScanner.Models/PFF/Segment.cs deleted file mode 100644 index 2657c928..00000000 --- a/BinaryObjectScanner.Models/PFF/Segment.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace BinaryObjectScanner.Models.PFF -{ - /// - /// PFF segment identifier - /// - /// - public sealed class Segment - { - /// - /// Deleted flag - /// - public uint Deleted; - - /// - /// File location - /// - public uint FileLocation; - - /// - /// File size - /// - public uint FileSize; - - /// - /// Packed date - /// - public uint PackedDate; - - /// - /// File name - /// - public string FileName; - - /// - /// Modified date - /// - /// Only for versions 3 and 4 - public uint ModifiedDate; - - /// - /// Compression level - /// - /// Only for version 4 - public uint CompressionLevel; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PlayJ/AudioFile.cs b/BinaryObjectScanner.Models/PlayJ/AudioFile.cs deleted file mode 100644 index 34f05baa..00000000 --- a/BinaryObjectScanner.Models/PlayJ/AudioFile.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace BinaryObjectScanner.Models.PlayJ -{ - /// - /// PlayJ audio file / CDS entry - /// - public sealed class AudioFile - { - /// - /// Header - /// - public AudioHeader Header { get; set; } - - /// - /// Unknown block 1 - /// - public UnknownBlock1 UnknownBlock1 { get; set; } - - #region V1 Only - - /// - /// Value referred to by - /// - /// Typically 0x00000000 - public uint UnknownValue2 { get; set; } - - /// - /// Unknown block 3 (V1 only) - /// - public UnknownBlock3 UnknownBlock3 { get; set; } - - #endregion - - #region V2 Only - - /// - /// Number of data files embedded - /// - public uint DataFilesCount { get; set; } - - /// - /// Data files (V2 only) - /// - public DataFile[] DataFiles { get; set; } - - // After the data files is a block starting with 0x00000001 - // This block then contains highly repeating data, possible audio samples? - - #endregion - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PlayJ/AudioHeader.cs b/BinaryObjectScanner.Models/PlayJ/AudioHeader.cs deleted file mode 100644 index 26ee5de7..00000000 --- a/BinaryObjectScanner.Models/PlayJ/AudioHeader.cs +++ /dev/null @@ -1,93 +0,0 @@ -namespace BinaryObjectScanner.Models.PlayJ -{ - /// - /// PlayJ audio header / CDS entry header - /// - /// V1 and V2 variants exist - public abstract class AudioHeader - { - /// - /// Signature (0x4B539DFF) - /// - public uint Signature; - - /// - /// Version - /// - public uint Version; - - // Header-specific data goes here - - /// - /// Length of the track name - /// - public ushort TrackLength; - - /// - /// Track name (not null-terminated) - /// - public string Track; - - /// - /// Length of the artist name - /// - public ushort ArtistLength; - - /// - /// Artist name (not null-terminated) - /// - public string Artist; - - /// - /// Length of the album name - /// - public ushort AlbumLength; - - /// - /// Album name (not null-terminated) - /// - public string Album; - - /// - /// Length of the writer name - /// - public ushort WriterLength; - - /// - /// Writer name (not null-terminated) - /// - public string Writer; - - /// - /// Length of the publisher name - /// - public ushort PublisherLength; - - /// - /// Publisher name (not null-terminated) - /// - public string Publisher; - - /// - /// Length of the label name - /// - public ushort LabelLength; - - /// - /// Label name (not null-terminated) - /// - public string Label; - - /// - /// Length of the comments - /// - /// Optional field only in some samples - public ushort CommentsLength; - - /// - /// Comments (not null-terminated) - /// - /// Optional field only in some samples - public string Comments; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PlayJ/AudioHeaderV1.cs b/BinaryObjectScanner.Models/PlayJ/AudioHeaderV1.cs deleted file mode 100644 index 2045562b..00000000 --- a/BinaryObjectScanner.Models/PlayJ/AudioHeaderV1.cs +++ /dev/null @@ -1,62 +0,0 @@ -namespace BinaryObjectScanner.Models.PlayJ -{ - /// - /// PlayJ audio header / CDS entry header (V1) - /// - public sealed class AudioHeaderV1 : AudioHeader - { - /// - /// Download track ID - /// - /// 0xFFFFFFFF if unset - public uint TrackID; - - /// - /// Offset to unknown data block 1 - /// - public uint UnknownOffset1; - - /// - /// Offset to unknown data block 2 - /// - public uint UnknownOffset2; - - /// - /// Offset to unknown data block 3 - /// - public uint UnknownOffset3; - - /// - /// Unknown - /// - /// Always 0x00000001 - public uint Unknown1; - - /// - /// Unknown - /// - /// Typically 0x00000001 in download titles - public uint Unknown2; - - /// - /// Track year - /// - /// 0xFFFFFFFF if unset - public uint Year; - - /// - /// Track number - /// - public byte TrackNumber; - - /// - /// Subgenre - /// - public Subgenre Subgenre; - - /// - /// Track duration in seconds - /// - public uint Duration; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PlayJ/AudioHeaderV2.cs b/BinaryObjectScanner.Models/PlayJ/AudioHeaderV2.cs deleted file mode 100644 index de575686..00000000 --- a/BinaryObjectScanner.Models/PlayJ/AudioHeaderV2.cs +++ /dev/null @@ -1,126 +0,0 @@ -namespace BinaryObjectScanner.Models.PlayJ -{ - /// - /// PlayJ audio header / CDS entry header (V2) - /// - public sealed class AudioHeaderV2 : AudioHeader - { - /// - /// Unknown (Always 0x00000001) - /// - public uint Unknown1; - - /// - /// Unknown (Always 0x00000001) - /// - public uint Unknown2; - - /// - /// Unknown (Always 0x00000000) - /// - public uint Unknown3; - - /// - /// Unknown (Always 0x00000003) - /// - public uint Unknown4; - - /// - /// Unknown (Always 0x00000001) - /// - public uint Unknown5; - - /// - /// Unknown (Always 0x00000000) - /// - public uint Unknown6; - - /// - /// Offset to unknown block 1, relative to the track ID - /// - public uint UnknownOffset1; - - /// - /// Unknown - /// - public uint Unknown7; - - /// - /// Unknown (Always 0x00000004) - /// - public uint Unknown8; - - /// - /// Unknown (Always 0x00000002) - /// - public uint Unknown9; - - /// - /// Offset to unknown block 1, relative to the track ID - /// - /// Always identical to ? - public uint UnknownOffset2; - - /// - /// Unknown - /// - public uint Unknown10; - - /// - /// Unknown - /// - public uint Unknown11; - - /// - /// Unknown (Always 0x0000005) - /// - public uint Unknown12; - - /// - /// Unknown (Always 0x0000009) - /// - public uint Unknown13; - - /// - /// Unknown - /// - public uint Unknown14; - - /// - /// Unknown - /// - public uint Unknown15; - - /// - /// Unknown (Always 0x0000000) - /// - public uint Unknown16; - - /// - /// Unknown (Always 0x00000007) - /// - public uint Unknown17; - - /// - /// Download track ID - /// - /// 0xFFFFFFFF if unset - public uint TrackID; - - /// - /// Track year -- UNCONFIRMED - /// - /// 0xFFFFFFFF if unset - public uint Year; - - /// - /// Track number - /// - public uint TrackNumber; - - /// - /// Unknown - /// - public uint Unknown18; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PlayJ/Constants.cs b/BinaryObjectScanner.Models/PlayJ/Constants.cs deleted file mode 100644 index 7c86a44a..00000000 --- a/BinaryObjectScanner.Models/PlayJ/Constants.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace BinaryObjectScanner.Models.PlayJ -{ - public static class Constants - { - public static readonly byte[] SignatureBytes = new byte[] { 0xFF, 0x9D, 0x53, 0x4B }; - - public const uint SignatureUInt32 = 0x4B539DFF; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PlayJ/DataFile.cs b/BinaryObjectScanner.Models/PlayJ/DataFile.cs deleted file mode 100644 index 8cccefce..00000000 --- a/BinaryObjectScanner.Models/PlayJ/DataFile.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace BinaryObjectScanner.Models.PlayJ -{ - /// - /// Embedded data file (V2 only?) - /// - public sealed class DataFile - { - /// - /// Length of the data file name - /// - public ushort FileNameLength; - - /// - /// Data file name - /// - public string FileName; - - /// - /// Length of the data - /// - public uint DataLength; - - /// - /// Data - /// - public byte[] Data; - - // Notes about Data: - // - Each data block in the samples contains a GIF header - // - Each GIF header contains an application extension: http://www.vurdalakov.net/misc/gif/application-extension - // - Each GIF doesn't always stretch to the end of the data - // - Remaining data seems to be padded as 0x00 (typically 8 bytes) - // - GIF data is fully formed and may be copied to a standalone file - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PlayJ/Enums.cs b/BinaryObjectScanner.Models/PlayJ/Enums.cs deleted file mode 100644 index 5712a3d5..00000000 --- a/BinaryObjectScanner.Models/PlayJ/Enums.cs +++ /dev/null @@ -1,122 +0,0 @@ -namespace BinaryObjectScanner.Models.PlayJ -{ - /// - public enum Genre - { - /// - /// Blues/Folk/Country - /// - BluesFolkCountry = 1, - - /// - /// Jazz - /// - Jazz = 5, - - /// - /// Reggae - /// - Reggae = 10, - - /// - /// Classical - /// - Classical = 12, - - /// - /// Electronic - /// - Electronic = 13, - - /// - /// Pop/Rock - /// - PopRock = 15, - - /// - /// World - /// - World = 16, - - /// - /// Urban - /// - Urban = 17, - - /// - /// Latin - /// - Latin = 18, - - /// - /// Soundtrack/Other - /// - SoundtrackOther = 20, - - /// - /// New Age - /// - NewAge = 21, - - /// - /// Spiritual - /// - Spiritual = 22, - - /// - /// Sway & Tech - /// - SwayAndTech = 23, - - /// - /// Jam Bands - /// - JamBands = 24, - - /// - /// Comedy - /// - Comedy = 25, - - /// - /// Brazilian - /// - Brazilian = 26, - } - - // TODO: Fill out the remaining subgenres from the wayback machine - /// - /// Every subgenre is uniquely associated with a genre - public enum Subgenre : byte - { - /// - /// Blues/Folk/Country > Blues (Modern/Electric) - /// - BluesModernElectric = 2, - - /// - /// Blues/Folk/Country > Blues (Modern/Acoustic) - /// - BluesModernAcoustic = 3, - - /// - /// Blues/Folk/Country > Blues (Traditional) - /// - BluesTraditional = 4, - - /// - /// Blues/Folk/Country > Folk (Traditional) - /// - FolkTraditional = 5, - - /// - /// Blues/Folk/Country > Folk (Contemporary) - /// - FolkContemporary = 6, - - /// - /// Blues/Folk/Country > Folk (Jazz) - /// - FolkJazz = 7, - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PlayJ/Playlist.cs b/BinaryObjectScanner.Models/PlayJ/Playlist.cs deleted file mode 100644 index 2d7e7edf..00000000 --- a/BinaryObjectScanner.Models/PlayJ/Playlist.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace BinaryObjectScanner.Models.PlayJ -{ - /// - /// PlayJ playlist file - /// - public sealed class Playlist - { - /// - /// Playlist header - /// - public PlaylistHeader Header { get; set; } - - /// - /// Embedded audio files / headers - /// - public AudioFile[] AudioFiles { get; set; } - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PlayJ/PlaylistHeader.cs b/BinaryObjectScanner.Models/PlayJ/PlaylistHeader.cs deleted file mode 100644 index fcaff27d..00000000 --- a/BinaryObjectScanner.Models/PlayJ/PlaylistHeader.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace BinaryObjectScanner.Models.PlayJ -{ - /// - /// PlayJ playlist header - /// - public sealed class PlaylistHeader - { - /// - /// Number of tracks contained within the playlist - /// - public uint TrackCount; - - /// - /// 52 bytes of unknown data - /// - public byte[] Data; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PlayJ/UnknownBlock1.cs b/BinaryObjectScanner.Models/PlayJ/UnknownBlock1.cs deleted file mode 100644 index 747aacb6..00000000 --- a/BinaryObjectScanner.Models/PlayJ/UnknownBlock1.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace BinaryObjectScanner.Models.PlayJ -{ - /// - /// Data referred to by or - /// - public sealed class UnknownBlock1 - { - /// - /// Length of the following data block - /// - public uint Length; - - /// - /// Unknown data - /// - public byte[] Data; - - // Notes about Data: - // - Might be UInt16 offset and UInt16 length pairs - // - Might be relevant to ad data - // - Might be relevant to encryption - // - Highly repeating patterns in the values with only a few differences - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PlayJ/UnknownBlock3.cs b/BinaryObjectScanner.Models/PlayJ/UnknownBlock3.cs deleted file mode 100644 index db594b4c..00000000 --- a/BinaryObjectScanner.Models/PlayJ/UnknownBlock3.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace BinaryObjectScanner.Models.PlayJ -{ - /// - /// Data referred to by - /// - public sealed class UnknownBlock3 - { - /// - /// Unknown data - /// - public byte[] Data; - - // Notes about Data: - // - This may be where the encrypted audio samples live - // - It is also possible that it's where the ad data lives and samples follow - // + See V2 for example of why this would be the case - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PortableExecutable/AcceleratorTableEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/AcceleratorTableEntry.cs deleted file mode 100644 index 82923f10..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/AcceleratorTableEntry.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Describes the data in an individual accelerator table resource. The structure definition - /// provided here is for explanation only; it is not present in any standard header file. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class AcceleratorTableEntry - { - /// - /// Describes keyboard accelerator characteristics. - /// - public AcceleratorTableFlags Flags; - - /// - /// An ANSI character value or a virtual-key code that identifies the accelerator key. - /// - public ushort Ansi; - - /// - /// An identifier for the keyboard accelerator. This is the value passed to the window - /// procedure when the user presses the specified key. - /// - public ushort Id; - - /// - /// The number of bytes inserted to ensure that the structure is aligned on a DWORD boundary. - /// - public ushort Padding; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/AssemblyManifest.cs b/BinaryObjectScanner.Models/PortableExecutable/AssemblyManifest.cs deleted file mode 100644 index 8ee05f4b..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/AssemblyManifest.cs +++ /dev/null @@ -1,390 +0,0 @@ -using System.Xml.Serialization; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - [XmlRoot(ElementName = "assembly", Namespace = "urn:schemas-microsoft-com:asm.v1")] - public sealed class AssemblyManifest - { - [XmlAttribute("manifestVersion")] - public string ManifestVersion; - - #region Group - - [XmlElement("assemblyIdentity")] - public AssemblyIdentity[] AssemblyIdentities; - - [XmlElement("noInheritable")] - public AssemblyNoInheritable[] NoInheritables; - - #endregion - - #region Group - - [XmlElement("description")] - public AssemblyDescription Description; - - [XmlElement("noInherit")] - public AssemblyNoInherit NoInherit; - - //[XmlElement("noInheritable")] - //public AssemblyNoInheritable NoInheritable; - - [XmlElement("comInterfaceExternalProxyStub")] - public AssemblyCOMInterfaceExternalProxyStub[] COMInterfaceExternalProxyStub; - - [XmlElement("dependency")] - public AssemblyDependency[] Dependency; - - [XmlElement("file")] - public AssemblyFile[] File; - - [XmlElement("clrClass")] - public AssemblyCommonLanguageRuntimeClass[] CLRClass; - - [XmlElement("clrSurrogate")] - public AssemblyCommonLanguageSurrogateClass[] CLRSurrogate; - - #endregion - - [XmlAnyElement] - public object[] EverythingElse; - } - - /// - public sealed class AssemblyActiveCodePage - { - [XmlText] - public string Value; - } - - /// - public sealed class AssemblyAutoElevate - { - [XmlText] - public string Value; - } - - /// - public sealed class AssemblyBindingRedirect - { - [XmlAttribute("oldVersion")] - public string OldVersion; - - [XmlAttribute("newVersion")] - public string NewVersion; - } - - /// - public sealed class AssemblyCOMClass - { - [XmlAttribute("clsid")] - public string CLSID; - - [XmlAttribute("threadingModel")] - public string ThreadingModel; - - [XmlAttribute("progid")] - public string ProgID; - - [XmlAttribute("tlbid")] - public string TLBID; - - [XmlAttribute("description")] - public string Description; - - [XmlElement("progid")] - public AssemblyProgID[] ProgIDs; - } - - /// - public sealed class AssemblyCOMInterfaceExternalProxyStub - { - [XmlAttribute("iid")] - public string IID; - - [XmlAttribute("name")] - public string Name; - - [XmlAttribute("tlbid")] - public string TLBID; - - [XmlAttribute("numMethods")] - public string NumMethods; - - [XmlAttribute("proxyStubClsid32")] - public string ProxyStubClsid32; - - [XmlAttribute("baseInterface")] - public string BaseInterface; - } - - /// - public sealed class AssemblyCOMInterfaceProxyStub - { - [XmlAttribute("iid")] - public string IID; - - [XmlAttribute("name")] - public string Name; - - [XmlAttribute("tlbid")] - public string TLBID; - - [XmlAttribute("numMethods")] - public string NumMethods; - - [XmlAttribute("proxyStubClsid32")] - public string ProxyStubClsid32; - - [XmlAttribute("baseInterface")] - public string BaseInterface; - } - - /// - public sealed class AssemblyCommonLanguageRuntimeClass - { - [XmlAttribute("name")] - public string Name; - - [XmlAttribute("clsid")] - public string CLSID; - - [XmlAttribute("progid")] - public string ProgID; - - [XmlAttribute("tlbid")] - public string TLBID; - - [XmlAttribute("description")] - public string Description; - - [XmlAttribute("runtimeVersion")] - public string RuntimeVersion; - - [XmlAttribute("threadingModel")] - public string ThreadingModel; - - [XmlElement("progid")] - public AssemblyProgID[] ProgIDs; - } - - /// - public sealed class AssemblyCommonLanguageSurrogateClass - { - [XmlAttribute("clsid")] - public string CLSID; - - [XmlAttribute("name")] - public string Name; - - [XmlAttribute("runtimeVersion")] - public string RuntimeVersion; - } - - /// - public sealed class AssemblyDependency - { - [XmlElement("dependentAssembly")] - public AssemblyDependentAssembly DependentAssembly; - - [XmlAttribute("optional")] - public string Optional; - } - - /// - public sealed class AssemblyDependentAssembly - { - [XmlElement("assemblyIdentity")] - public AssemblyIdentity AssemblyIdentity; - - [XmlElement("bindingRedirect")] - public AssemblyBindingRedirect[] BindingRedirect; - } - - /// - public sealed class AssemblyDescription - { - [XmlText] - public string Value; - } - - /// - public sealed class AssemblyDisableTheming - { - [XmlText] - public string Value; - } - - /// - public sealed class AssemblyDisableWindowFiltering - { - [XmlText] - public string Value; - } - - /// - public sealed class AssemblyDPIAware - { - [XmlText] - public string Value; - } - - /// - public sealed class AssemblyDPIAwareness - { - [XmlText] - public string Value; - } - - /// - public sealed class AssemblyFile - { - [XmlAttribute("name")] - public string Name; - - [XmlAttribute("hash")] - public string Hash; - - [XmlAttribute("hashalg")] - public string HashAlgorithm; - - [XmlAttribute("size")] - public string Size; - - #region Group - - [XmlElement("comClass")] - public AssemblyCOMClass[] COMClass; - - [XmlElement("comInterfaceProxyStub")] - public AssemblyCOMInterfaceProxyStub[] COMInterfaceProxyStub; - - [XmlElement("typelib")] - public AssemblyTypeLib[] Typelib; - - [XmlElement("windowClass")] - public AssemblyWindowClass[] WindowClass; - - #endregion - } - - /// - public sealed class AssemblyGDIScaling - { - [XmlText] - public string Value; - } - - /// - public sealed class AssemblyHeapType - { - [XmlText] - public string Value; - } - - /// - public sealed class AssemblyHighResolutionScrollingAware - { - [XmlText] - public string Value; - } - - /// - public sealed class AssemblyIdentity - { - [XmlAttribute("name")] - public string Name; - - [XmlAttribute("version")] - public string Version; - - [XmlAttribute("type")] - public string Type; - - [XmlAttribute("processorArchitecture")] - public string ProcessorArchitecture; - - [XmlAttribute("publicKeyToken")] - public string PublicKeyToken; - - [XmlAttribute("language")] - public string Language; - } - - /// - public sealed class AssemblyLongPathAware - { - [XmlText] - public string Value; - } - - /// - public sealed class AssemblyNoInherit - { - } - - /// - public sealed class AssemblyNoInheritable - { - } - - /// - public sealed class AssemblyPrinterDriverIsolation - { - [XmlText] - public string Value; - } - - /// - public sealed class AssemblyProgID - { - [XmlText] - public string Value; - } - - /// - public sealed class AssemblySupportedOS - { - [XmlAttribute("Id")] - public string Id; - } - - /// - public sealed class AssemblyTypeLib - { - [XmlElement("tlbid")] - public string TLBID; - - [XmlElement("version")] - public string Version; - - [XmlElement("helpdir")] - public string HelpDir; - - [XmlElement("resourceid")] - public string ResourceID; - - [XmlElement("flags")] - public string Flags; - } - - /// - public sealed class AssemblyUltraHighResolutionScrollingAware - { - [XmlText] - public string Value; - } - - /// - public sealed class AssemblyWindowClass - { - [XmlAttribute("versioned")] - public string Versioned; - - [XmlText] - public string Value; - } - - // TODO: Left off at -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/AttributeCertificateTableEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/AttributeCertificateTableEntry.cs deleted file mode 100644 index 8dff14a3..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/AttributeCertificateTableEntry.cs +++ /dev/null @@ -1,63 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Attribute certificates can be associated with an image by adding an attribute - /// certificate table. The attribute certificate table is composed of a set of - /// contiguous, quadword-aligned attribute certificate entries. Zero padding is - /// inserted between the original end of the file and the beginning of the attribute - /// certificate table to achieve this alignment. - /// - /// The virtual address value from the Certificate Table entry in the Optional - /// Header Data Directory is a file offset to the first attribute certificate - /// entry. Subsequent entries are accessed by advancing that entry's dwLength - /// bytes, rounded up to an 8-byte multiple, from the start of the current - /// attribute certificate entry. This continues until the sum of the rounded dwLength - /// values equals the Size value from the Certificates Table entry in the Optional - /// Header Data Directory. If the sum of the rounded dwLength values does not equal - /// the Size value, then either the attribute certificate table or the Size field - /// is corrupted. - /// - /// The first certificate starts at offset 0x5000 from the start of the file on disk. - /// To advance through all the attribute certificate entries: - /// - /// 1. Add the first attribute certificate's dwLength value to the starting offset. - /// 2. Round the value from step 1 up to the nearest 8-byte multiple to find the offset - /// of the second attribute certificate entry. - /// 3. Add the offset value from step 2 to the second attribute certificate entry's - /// dwLength value and round up to the nearest 8-byte multiple to determine the offset - /// of the third attribute certificate entry. - /// 4. Repeat step 3 for each successive certificate until the calculated offset equals - /// 0x6000 (0x5000 start + 0x1000 total size), which indicates that you've walked - /// the entire table. - /// - /// Attribute certificate table entries can contain any certificate type, as long as - /// the entry has the correct dwLength value, a unique wRevision value, and a unique - /// wCertificateType value. The most common type of certificate table entry is a - /// WIN_CERTIFICATE structure, which is documented in Wintrust.h and discussed in - /// the remainder of this section. - /// - /// - public sealed class AttributeCertificateTableEntry - { - /// - /// Specifies the length of the attribute certificate entry. - /// - public uint Length; - - /// - /// Contains the certificate version number. - /// - public WindowsCertificateRevision Revision; - - /// - /// Specifies the type of content in Certificate. - /// - public WindowsCertificateType CertificateType; - - /// - /// Contains a certificate, such as an Authenticode signature. - /// - /// - public byte[] Certificate; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/BaseRelocationBlock.cs b/BinaryObjectScanner.Models/PortableExecutable/BaseRelocationBlock.cs deleted file mode 100644 index 38df7612..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/BaseRelocationBlock.cs +++ /dev/null @@ -1,51 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The base relocation table contains entries for all base relocations in - /// the image. The Base Relocation Table field in the optional header data - /// directories gives the number of bytes in the base relocation table. For - /// more information, see Optional Header Data Directories (Image Only). - /// The base relocation table is divided into blocks. Each block represents - /// the base relocations for a 4K page. Each block must start on a 32-bit boundary. - /// - /// The loader is not required to process base relocations that are resolved by - /// the linker, unless the load image cannot be loaded at the image base that is - /// specified in the PE header. - /// - /// To apply a base relocation, the difference is calculated between the preferred - /// base address and the base where the image is actually loaded. If the image is - /// loaded at its preferred base, the difference is zero and thus the base - /// relocations do not have to be applied. - /// - /// - public sealed class BaseRelocationBlock - { - /// - /// The image base plus the page RVA is added to each offset to create - /// the VA where the base relocation must be applied. - /// - public uint PageRVA; - - /// - /// The total number of bytes in the base relocation block, including - /// the Page RVA and Block Size fields and the Type/Offset fields that - /// follow. - /// - public uint BlockSize; - - /// - /// The Block Size field is then followed by any number of Type or Offset - /// field entries. Each entry is a WORD (2 bytes) and has the following - /// structure: - /// - /// 4 bits - Type - Stored in the high 4 bits of the WORD, a value - /// that indicates the type of base relocation to be - /// applied. For more information, see - /// 12 bits - Offset - Stored in the remaining 12 bits of the WORD, an - /// offset from the starting address that was specified - /// in the Page RVA field for the block. This offset - /// specifies where the base relocation is to be applied. - /// - public BaseRelocationTypeOffsetFieldEntry[] TypeOffsetFieldEntries; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/BaseRelocationTypeOffsetFieldEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/BaseRelocationTypeOffsetFieldEntry.cs deleted file mode 100644 index b4a1e157..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/BaseRelocationTypeOffsetFieldEntry.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Type or Offset field entry is a WORD (2 bytes). - /// - /// - public sealed class BaseRelocationTypeOffsetFieldEntry - { - /// - /// Stored in the high 4 bits of the WORD, a value that indicates the type - /// of base relocation to be applied. For more information, see - /// - public BaseRelocationTypes BaseRelocationType; - - /// - /// Stored in the remaining 12 bits of the WORD, an offset from the starting - /// address that was specified in the Page RVA field for the block. This - /// offset specifies where the base relocation is to be applied. - /// - public ushort Offset; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/COFFFileHeader.cs b/BinaryObjectScanner.Models/PortableExecutable/COFFFileHeader.cs deleted file mode 100644 index 6d8e9fbd..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/COFFFileHeader.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// At the beginning of an object file, or immediately after the signature - /// of an image file, is a standard COFF file header in the following format. - /// Note that the Windows loader limits the number of sections to 96. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class COFFFileHeader - { - /// - /// The number that identifies the type of target machine. - /// - public MachineType Machine; - - /// - /// The number of sections. This indicates the size of the section table, - /// which immediately follows the headers. - /// - public ushort NumberOfSections; - - /// - /// The low 32 bits of the number of seconds since 00:00 January 1, 1970 - /// (a C run-time time_t value), which indicates when the file was created. - /// - public uint TimeDateStamp; - - /// - /// The file offset of the COFF symbol table, or zero if no COFF symbol table - /// is present. This value should be zero for an image because COFF debugging - /// information is deprecated. - /// - public uint PointerToSymbolTable; - - /// - /// The number of entries in the symbol table. This data can be used to locate - /// the string table, which immediately follows the symbol table. This value - /// should be zero for an image because COFF debugging information is deprecated. - /// - public uint NumberOfSymbols; - - /// - /// The size of the optional header, which is required for executable files but - /// not for object files. This value should be zero for an object file. - /// - public ushort SizeOfOptionalHeader; - - /// - /// The flags that indicate the attributes of the file. - /// - public Characteristics Characteristics; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/COFFLineNumber.cs b/BinaryObjectScanner.Models/PortableExecutable/COFFLineNumber.cs deleted file mode 100644 index f60b87fc..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/COFFLineNumber.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// COFF line numbers are no longer produced and, in the future, will - /// not be consumed. - /// - /// COFF line numbers indicate the relationship between code and line - /// numbers in source files. The Microsoft format for COFF line numbers - /// is similar to standard COFF, but it has been extended to allow a - /// single section to relate to line numbers in multiple source files. - /// - /// COFF line numbers consist of an array of fixed-length records. - /// The location (file offset) and size of the array are specified in - /// the section header. - /// - /// - [StructLayout(LayoutKind.Explicit)] - public sealed class COFFLineNumber - { - /// - /// Used when Linenumber is zero: index to symbol table entry for a function. - /// This format is used to indicate the function to which a group of - /// line-number records refers. - /// - [FieldOffset(0)] public uint SymbolTableIndex; - - /// - /// Used when Linenumber is non-zero: the RVA of the executable code that - /// corresponds to the source line indicated. In an object file, this - /// contains the VA within the section. - /// - [FieldOffset(0)] public uint VirtualAddress; - - /// - /// When nonzero, this field specifies a one-based line number. When zero, - /// the Type field is interpreted as a symbol table index for a function. - /// - [FieldOffset(4)] public ushort Linenumber; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/COFFRelocation.cs b/BinaryObjectScanner.Models/PortableExecutable/COFFRelocation.cs deleted file mode 100644 index ddf5624a..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/COFFRelocation.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Object files contain COFF relocations, which specify how the section data - /// should be modified when placed in the image file and subsequently loaded - /// into memory. - /// - /// Image files do not contain COFF relocations, because all referenced symbols - /// have already been assigned addresses in a flat address space. An image - /// contains relocation information in the form of base relocations in the - /// .reloc section (unless the image has the IMAGE_FILE_RELOCS_STRIPPED attribute). - /// - /// For each section in an object file, an array of fixed-length records holds - /// the section's COFF relocations. The position and length of the array are - /// specified in the section header. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class COFFRelocation - { - /// - /// The address of the item to which relocation is applied. This is the - /// offset from the beginning of the section, plus the value of the - /// section's RVA/Offset field. See Section Table (Section Headers). - /// For example, if the first byte of the section has an address of 0x10, - /// the third byte has an address of 0x12. - /// - public uint VirtualAddress; - - /// - /// A zero-based index into the symbol table. This symbol gives the address - /// that is to be used for the relocation. If the specified symbol has section - /// storage class, then the symbol's address is the address with the first - /// section of the same name. - /// - public uint SymbolTableIndex; - - /// - /// A value that indicates the kind of relocation that should be performed. - /// Valid relocation types depend on machine type. - /// - public RelocationType TypeIndicator; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/COFFStringTable.cs b/BinaryObjectScanner.Models/PortableExecutable/COFFStringTable.cs deleted file mode 100644 index 896bfee1..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/COFFStringTable.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Immediately following the COFF symbol table is the COFF string table. The - /// position of this table is found by taking the symbol table address in the - /// COFF header and adding the number of symbols multiplied by the size of a symbol. - /// - /// - public sealed class COFFStringTable - { - /// - /// At the beginning of the COFF string table are 4 bytes that contain the - /// total size (in bytes) of the rest of the string table. This size includes - /// the size field itself, so that the value in this location would be 4 if no - /// strings were present. - /// - public uint TotalSize; - - /// - /// Following the size are null-terminated strings that are pointed to by symbols - /// in the COFF symbol table. - /// - public string[] Strings; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/COFFSymbolTableEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/COFFSymbolTableEntry.cs deleted file mode 100644 index b7024f61..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/COFFSymbolTableEntry.cs +++ /dev/null @@ -1,315 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The symbol table in this section is inherited from the traditional - /// COFF format. It is distinct from Microsoft Visual C++ debug information. - /// A file can contain both a COFF symbol table and Visual C++ debug - /// information, and the two are kept separate. Some Microsoft tools use - /// the symbol table for limited but important purposes, such as - /// communicating COMDAT information to the linker. Section names and file - /// names, as well as code and data symbols, are listed in the symbol table. - /// - /// The location of the symbol table is indicated in the COFF header. - /// - /// The symbol table is an array of records, each 18 bytes long. Each record - /// is either a standard or auxiliary symbol-table record. A standard record - /// defines a symbol or name. - /// - /// - public sealed class COFFSymbolTableEntry - { - #region Standard COFF Symbol Table Entry - - #region Symbol Name - - /// - /// An array of 8 bytes. This array is padded with nulls on the right if - /// the name is less than 8 bytes long. - /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public byte[] ShortName; - - /// - /// A field that is set to all zeros if the name is longer than 8 bytes. - /// - public uint Zeroes; - - /// - /// An offset into the string table. - /// - public uint Offset; - - #endregion - - /// - /// The value that is associated with the symbol. The interpretation of this - /// field depends on SectionNumber and StorageClass. A typical meaning is the - /// relocatable address. - /// - public uint Value; - - /// - /// The signed integer that identifies the section, using a one-based index - /// into the section table. Some values have special meaning. - /// - public ushort SectionNumber; - - /// - /// A number that represents type. Microsoft tools set this field to 0x20 - /// (function) or 0x0 (not a function). - /// - public SymbolType SymbolType; - - /// - /// An enumerated value that represents storage class. - /// - public StorageClass StorageClass; - - /// - /// The number of auxiliary symbol table entries that follow this record. - /// - public byte NumberOfAuxSymbols; - - #endregion - - #region Auxiliary Symbol Records - - // Auxiliary symbol table records always follow, and apply to, some standard - // symbol table record. An auxiliary record can have any format that the tools - // can recognize, but 18 bytes must be allocated for them so that symbol table - // is maintained as an array of regular size. Currently, Microsoft tools - // recognize auxiliary formats for the following kinds of records: function - // definitions, function begin and end symbols (.bf and .ef), weak externals, - // file names, and section definitions. - // - // The traditional COFF design also includes auxiliary-record formats for arrays - // and structures.Microsoft tools do not use these, but instead place that - // symbolic information in Visual C++ debug format in the debug sections. - - #region Auxiliary Format 1: Function Definitions - - // A symbol table record marks the beginning of a function definition if it - // has all of the following: a storage class of EXTERNAL (2), a Type value - // that indicates it is a function (0x20), and a section number that is - // greater than zero. Note that a symbol table record that has a section - // number of UNDEFINED (0) does not define the function and does not have - // an auxiliary record. Function-definition symbol records are followed by - // an auxiliary record in the format described below: - - /// - /// The symbol-table index of the corresponding .bf (begin function) - /// symbol record. - /// - public uint AuxFormat1TagIndex; - - /// - /// The size of the executable code for the function itself. If the function - /// is in its own section, the SizeOfRawData in the section header is greater - /// or equal to this field, depending on alignment considerations. - /// - public uint AuxFormat1TotalSize; - - /// - /// The file offset of the first COFF line-number entry for the function, or - /// zero if none exists. - /// - public uint AuxFormat1PointerToLinenumber; - - /// - /// The symbol-table index of the record for the next function. If the function - /// is the last in the symbol table, this field is set to zero. - /// - public uint AuxFormat1PointerToNextFunction; - - /// - /// Unused - /// - public ushort AuxFormat1Unused; - - #endregion - - #region Auxiliary Format 2: .bf and .ef Symbols - - // For each function definition in the symbol table, three items describe - // the beginning, ending, and number of lines. Each of these symbols has - // storage class FUNCTION (101): - // - // A symbol record named .bf (begin function). The Value field is unused. - // - // A symbol record named .lf (lines in function). The Value field gives the - // number of lines in the function. - // - // A symbol record named .ef (end of function). The Value field has the same - // number as the Total Size field in the function-definition symbol record. - // - // The .bf and .ef symbol records (but not .lf records) are followed by an - // auxiliary record with the following format: - - /// - /// Unused - /// - public uint AuxFormat2Unused1; - - /// - /// The actual ordinal line number (1, 2, 3, and so on) within the source file, - /// corresponding to the .bf or .ef record. - /// - public ushort AuxFormat2Linenumber; - - /// - /// Unused - /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] - public byte[] AuxFormat2Unused2; - - /// - /// The symbol-table index of the next .bf symbol record. If the function is the - /// last in the symbol table, this field is set to zero. It is not used for - /// .ef records. - /// - public uint AuxFormat2PointerToNextFunction; - - /// - /// Unused - /// - public ushort AuxFormat2Unused3; - - #endregion - - #region Auxiliary Format 3: Weak Externals - - // "Weak externals" are a mechanism for object files that allows flexibility at - // link time. A module can contain an unresolved external symbol (sym1), but it - // can also include an auxiliary record that indicates that if sym1 is not - // present at link time, another external symbol (sym2) is used to resolve - // references instead. - // - // If a definition of sym1 is linked, then an external reference to the symbol - // is resolved normally. If a definition of sym1 is not linked, then all references - // to the weak external for sym1 refer to sym2 instead. The external symbol, sym2, - // must always be linked; typically, it is defined in the module that contains - // the weak reference to sym1. - // - // Weak externals are represented by a symbol table record with EXTERNAL storage - // class, UNDEF section number, and a value of zero. The weak-external symbol - // record is followed by an auxiliary record with the following format: - - /// - /// The symbol-table index of sym2, the symbol to be linked if sym1 is not found. - /// - public uint AuxFormat3TagIndex; - - /// - /// A value of IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY indicates that no library search - /// for sym1 should be performed. - /// A value of IMAGE_WEAK_EXTERN_SEARCH_LIBRARY indicates that a library search for - /// sym1 should be performed. - /// A value of IMAGE_WEAK_EXTERN_SEARCH_ALIAS indicates that sym1 is an alias for sym2. - /// - public uint AuxFormat3Characteristics; - - /// - /// Unused - /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] - public byte[] AuxFormat3Unused; - - #endregion - - #region Auxiliary Format 4: Files - - // This format follows a symbol-table record with storage class FILE (103). - // The symbol name itself should be .file, and the auxiliary record that - // follows it gives the name of a source-code file. - - /// - /// An ANSI string that gives the name of the source file. This is padded - /// with nulls if it is less than the maximum length. - /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 18)] - public byte[] AuxFormat4FileName; - - #endregion - - #region Auxiliary Format 5: Section Definitions - - // This format follows a symbol-table record that defines a section. Such a - // record has a symbol name that is the name of a section (such as .text or - // .drectve) and has storage class STATIC (3). The auxiliary record provides - // information about the section to which it refers. Thus, it duplicates some - // of the information in the section header. - - /// - /// The size of section data; the same as SizeOfRawData in the section header. - /// - public uint AuxFormat5Length; - - /// - /// The number of relocation entries for the section. - /// - public ushort AuxFormat5NumberOfRelocations; - - /// - /// The number of line-number entries for the section. - /// - public ushort AuxFormat5NumberOfLinenumbers; - - /// - /// The checksum for communal data. It is applicable if the IMAGE_SCN_LNK_COMDAT - /// flag is set in the section header. - /// - public uint AuxFormat5CheckSum; - - /// - /// One-based index into the section table for the associated section. This is - /// used when the COMDAT selection setting is 5. - /// - public ushort AuxFormat5Number; - - /// - /// The COMDAT selection number. This is applicable if the section is a - /// COMDAT section. - /// - public byte AuxFormat5Selection; - - /// - /// Unused - /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] - public byte[] AuxFormat5Unused; - - #endregion - - #region Auxiliary Format 6: CLR Token Definition (Object Only) - - // This auxiliary symbol generally follows the IMAGE_SYM_CLASS_CLR_TOKEN. It is - // used to associate a token with the COFF symbol table's namespace. - - /// - /// Must be IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF (1). - /// - public byte AuxFormat6AuxType; - - /// - /// Reserved, must be zero. - /// - public byte AuxFormat6Reserved1; - - /// - /// The symbol index of the COFF symbol to which this CLR token definition refers. - /// - public uint AuxFormat6SymbolTableIndex; - - /// - /// Reserved, must be zero. - /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] - public byte[] AuxFormat6Reserved2; - - #endregion - - #endregion - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/Constants.cs b/BinaryObjectScanner.Models/PortableExecutable/Constants.cs deleted file mode 100644 index dd8be394..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/Constants.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - public static class Constants - { - public static readonly byte[] SignatureBytes = new byte[] { 0x50, 0x45, 0x00, 0x00 }; - - public const string SignatureString = "PE\0\0"; - - public const uint SignatureUInt32 = 0x00004550; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/PortableExecutable/CursorAndIconResource.cs b/BinaryObjectScanner.Models/PortableExecutable/CursorAndIconResource.cs deleted file mode 100644 index 014a65a4..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/CursorAndIconResource.cs +++ /dev/null @@ -1,40 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The system handles each icon and cursor as a single file. However, these are stored in - /// .res files and in executable files as a group of icon resources or a group of cursor - /// resources. The file formats of icon and cursor resources are similar. In the .res file - /// a resource group header follows all of the individual icon or cursor group components. - /// - /// The format of each icon component closely resembles the format of the .ico file. Each - /// icon image is stored in a BITMAPINFO structure followed by the color device-independent - /// bitmap (DIB) bits of the icon's XOR mask. The monochrome DIB bits of the icon's AND - /// mask follow the color DIB bits. - /// - /// The format of each cursor component resembles the format of the .cur file. Each cursor - /// image is stored in a BITMAPINFO structure followed by the monochrome DIB bits of the - /// cursor's XOR mask, and then by the monochrome DIB bits of the cursor's AND mask. Note - /// that there is a difference in the bitmaps of the two resources: Unlike icons, cursor - /// XOR masks do not have color DIB bits. Although the bitmaps of the cursor masks are - /// monochrome and do not have DIB headers or color tables, the bits are still in DIB - /// format with respect to alignment and direction. Another significant difference - /// between cursors and icons is that cursors have a hotspot and icons do not. - /// - /// The group header for both icon and cursor resources consists of a NEWHEADER structure - /// plus one or more RESDIR structures. There is one RESDIR structure for each icon or - /// cursor. The group header contains the information an application needs to select the - /// correct icon or cursor to display. Both the group header and the data that repeats for - /// each icon or cursor in the group have a fixed length. This allows the application to - /// randomly access the information. - /// - /// - public sealed class CursorAndIconResource - { - /// - /// Describes keyboard accelerator characteristics. - /// - public NewHeader NEWHEADER; - - // TODO: Add array of entries in the resource - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/DataDirectory.cs b/BinaryObjectScanner.Models/PortableExecutable/DataDirectory.cs deleted file mode 100644 index b11ac4f7..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/DataDirectory.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Each data directory gives the address and size of a table or string that Windows uses. - /// These data directory entries are all loaded into memory so that the system can use them - /// at run time. - /// - /// Also, do not assume that the RVAs in this table point to the beginning of a section or - /// that the sections that contain specific tables have specific names. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class DataDirectory - { - /// - /// The first field, VirtualAddress, is actually the RVA of the table. The RVA - /// is the address of the table relative to the base address of the image when - /// the table is loaded. - /// - public uint VirtualAddress; - - /// - /// The second field gives the size in bytes. - /// - public uint Size; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/DebugDirectoryEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/DebugDirectoryEntry.cs deleted file mode 100644 index cf9e90d4..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/DebugDirectoryEntry.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Image files contain an optional debug directory that indicates what form - /// of debug information is present and where it is. This directory consists - /// of an array of debug directory entries whose location and size are indicated - /// in the image optional header. - /// - /// The debug directory can be in a discardable .debug section (if one exists), - /// or it can be included in any other section in the image file, or not be in - /// a section at all. - /// - /// Each debug directory entry identifies the location and size of a block of - /// debug information. The specified RVA can be zero if the debug information - /// is not covered by a section header (that is, it resides in the image file - /// and is not mapped into the run-time address space). If it is mapped, the - /// RVA is its address. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class DebugDirectoryEntry - { - /// - /// Reserved, must be zero. - /// - public uint Characteristics; - - /// - /// The time and date that the debug data was created. - /// - public uint TimeDateStamp; - - /// - /// The major version number of the debug data format. - /// - public ushort MajorVersion; - - /// - /// The minor version number of the debug data format. - /// - public ushort MinorVersion; - - /// - /// The format of debugging information. This field enables support - /// of multiple debuggers. - /// - public DebugType DebugType; - - /// - /// The size of the debug data (not including the debug directory itself). - /// - public uint SizeOfData; - - /// - /// The address of the debug data when loaded, relative to the image base. - /// - public uint AddressOfRawData; - - /// - /// The file pointer to the debug data. - /// - public uint PointerToRawData; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/DebugTable.cs b/BinaryObjectScanner.Models/PortableExecutable/DebugTable.cs deleted file mode 100644 index 31a35ca0..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/DebugTable.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The .debug section is used in object files to contain compiler-generated debug - /// information and in image files to contain all of the debug information that is - /// generated. This section describes the packaging of debug information in object - /// and image files. - /// - /// The next section describes the format of the debug directory, which can be - /// anywhere in the image. Subsequent sections describe the "groups" in object - /// files that contain debug information. - /// - /// The default for the linker is that debug information is not mapped into the - /// address space of the image. A .debug section exists only when debug information - /// is mapped in the address space. - /// - /// - public sealed class DebugTable - { - /// - /// Image files contain an optional debug directory that indicates what form - /// of debug information is present and where it is. This directory consists - /// of an array of debug directory entries whose location and size are - /// indicated in the image optional header. - /// - /// The debug directory can be in a discardable .debug section (if one exists), - /// or it can be included in any other section in the image file, or not be - /// in a section at all. - /// - /// Each debug directory entry identifies the location and size of a block of - /// debug information. The specified RVA can be zero if the debug information - /// is not covered by a section header (that is, it resides in the image - /// file and is not mapped into the run-time address space). If it is mapped, - /// the RVA is its address. - /// - public DebugDirectoryEntry[] DebugDirectoryTable; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/DelayLoadDirectoryTable.cs b/BinaryObjectScanner.Models/PortableExecutable/DelayLoadDirectoryTable.cs deleted file mode 100644 index f4587e35..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/DelayLoadDirectoryTable.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The delay-load directory table is the counterpart to the import directory - /// table. It can be retrieved through the Delay Import Descriptor entry in - /// the optional header data directories list (offset 200). - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class DelayLoadDirectoryTable - { - /// - /// Must be zero. - /// - /// - /// As yet, no attribute flags are defined. The linker sets this field to - /// zero in the image. This field can be used to extend the record by - /// indicating the presence of new fields, or it can be used to indicate - /// behaviors to the delay or unload helper functions. - /// - public uint Attributes; - - /// - /// The RVA of the name of the DLL to be loaded. The name resides in the - /// read-only data section of the image. - /// - /// - /// The name of the DLL to be delay-loaded resides in the read-only data - /// section of the image. It is referenced through the szName field. - /// - public uint Name; - - /// - /// The RVA of the module handle (in the data section of the image) of the DLL - /// to be delay-loaded. It is used for storage by the routine that is supplied - /// to manage delay-loading. - /// - /// - /// The handle of the DLL to be delay-loaded is in the data section of the image. - /// The phmod field points to the handle. The supplied delay-load helper uses - /// this location to store the handle to the loaded DLL. - /// - public uint ModuleHandle; - - /// - /// The RVA of the delay-load import address table. - /// - /// - /// The delay import address table (IAT) is referenced by the delay import - /// descriptor through the pIAT field. The delay-load helper updates these - /// pointers with the real entry points so that the thunks are no longer in - /// the calling loop. The function pointers are accessed by using the expression - /// pINT->u1.Function. - /// - public uint DelayImportAddressTable; - - /// - /// The RVA of the delay-load name table, which contains the names of the imports - /// that might need to be loaded. This matches the layout of the import name table. - /// - /// - /// The delay import name table (INT) contains the names of the imports that might - /// require loading. They are ordered in the same fashion as the function pointers - /// in the IAT. They consist of the same structures as the standard INT and are - /// accessed by using the expression pINT->u1.AddressOfData->Name[0]. - /// - public uint DelayImportNameTable; - - /// - /// The RVA of the bound delay-load address table, if it exists. - /// - /// - /// The delay bound import address table (BIAT) is an optional table of - /// IMAGE_THUNK_DATA items that is used along with the timestamp field of the - /// delay-load directory table by a post-process binding phase. - /// - public uint BoundDelayImportTable; - - /// - /// The RVA of the unload delay-load address table, if it exists. This is an exact - /// copy of the delay import address table. If the caller unloads the DLL, this - /// table should be copied back over the delay import address table so that - /// subsequent calls to the DLL continue to use the thunking mechanism correctly. - /// - /// - /// The delay unload import address table (UIAT) is an optional table of - /// IMAGE_THUNK_DATA items that the unload code uses to handle an explicit unload - /// request. It consists of initialized data in the read-only section that is an - /// exact copy of the original IAT that referred the code to the delay-load thunks. - /// On the unload request, the library can be freed, the *phmod cleared, and the - /// UIAT written over the IAT to restore everything to its preload state. - /// - public uint UnloadDelayImportTable; - - /// - /// The timestamp of the DLL to which this image has been bound. - /// - /// - /// The delay bound import address table (BIAT) is an optional table of - /// IMAGE_THUNK_DATA items that is used along with the timestamp field of the - /// delay-load directory table by a post-process binding phase. - /// - public uint TimeStamp; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/DialogBoxResource.cs b/BinaryObjectScanner.Models/PortableExecutable/DialogBoxResource.cs deleted file mode 100644 index 28f2a729..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/DialogBoxResource.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// A dialog box is also one resource entry in the resource file. It consists of one - /// DLGTEMPLATE dialog box header structure plus one DLGITEMTEMPLATE structure for each - /// control in the dialog box. The DLGTEMPLATEEX and the DLGITEMTEMPLATEEX structures - /// describe the format of extended dialog box resources. - /// - /// - public sealed class DialogBoxResource - { - #region Dialog template - - /// - /// Dialog box header structure - /// - public DialogTemplate DialogTemplate; - - /// - /// Dialog box extended header structure - /// - public DialogTemplateExtended ExtendedDialogTemplate; - - #endregion - - #region Dialog item templates - - /// - /// Following the DLGTEMPLATE header in a standard dialog box template are one or more - /// DLGITEMTEMPLATE structures that define the dimensions and style of the controls in the dialog - /// box. The cdit member specifies the number of DLGITEMTEMPLATE structures in the template. - /// These DLGITEMTEMPLATE structures must be aligned on DWORD boundaries. - /// - public DialogItemTemplate[] DialogItemTemplates; - - /// - /// Following the DLGTEMPLATEEX header in an extended dialog box template is one or more - /// DLGITEMTEMPLATEEX structures that describe the controls of the dialog box. The cDlgItems - /// member of the DLGITEMTEMPLATEEX structure specifies the number of DLGITEMTEMPLATEEX - /// structures that follow in the template. - /// - public DialogItemTemplateExtended[] ExtendedDialogItemTemplates; - - #endregion - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/DialogItemTemplate.cs b/BinaryObjectScanner.Models/PortableExecutable/DialogItemTemplate.cs deleted file mode 100644 index 2b31a82d..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/DialogItemTemplate.cs +++ /dev/null @@ -1,133 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Defines the dimensions and style of a control in a dialog box. One or more of these - /// structures are combined with a DLGTEMPLATE structure to form a standard template - /// for a dialog box. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class DialogItemTemplate - { - /// - /// The style of the control. This member can be a combination of window style values - /// (such as WS_BORDER) and one or more of the control style values (such as - /// BS_PUSHBUTTON and ES_LEFT). - /// - public WindowStyles Style; - - /// - /// The extended styles for a window. This member is not used to create dialog boxes, - /// but applications that use dialog box templates can use it to create other types - /// of windows. - /// - public ExtendedWindowStyles ExtendedStyle; - - /// - /// The x-coordinate, in dialog box units, of the upper-left corner of the control. - /// This coordinate is always relative to the upper-left corner of the dialog box's - /// client area. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values to screen - /// units (pixels) by using the MapDialogRect function. - /// - public short PositionX; - - /// - /// The y-coordinate, in dialog box units, of the upper-left corner of the control. - /// This coordinate is always relative to the upper-left corner of the dialog box's - /// client area. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values to screen - /// units (pixels) by using the MapDialogRect function. - /// - public short PositionY; - - /// - /// The width, in dialog box units, of the control. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values to screen - /// units (pixels) by using the MapDialogRect function. - /// - public short WidthX; - - /// - /// The height, in dialog box units, of the control. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values to screen - /// units (pixels) by using the MapDialogRect function. - /// - public short HeightY; - - /// - /// The control identifier. - /// - public ushort ID; - - // In a standard template for a dialog box, the DLGITEMTEMPLATE structure is always immediately - // followed by three variable-length arrays specifying the class, title, and creation data for - // the control. Each array consists of one or more 16-bit elements. - // - // Each DLGITEMTEMPLATE structure in the template must be aligned on a DWORD boundary. The class - // and title arrays must be aligned on WORD boundaries. The creation data array must be aligned - // on a WORD boundary. - - /// - /// Immediately following each DLGITEMTEMPLATE structure is a class array that specifies the window - /// class of the control. If the first element of this array is any value other than 0xFFFF, the - /// system treats the array as a null-terminated Unicode string that specifies the name of a - /// registered window class. If the first element is 0xFFFF, the array has one additional element - /// that specifies the ordinal value of a predefined system class. - /// - /// - /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the - /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. - /// - public string ClassResource; - - /// - /// The ordinal value of a predefined system class. - /// - public DialogItemTemplateOrdinal ClassResourceOrdinal; - - /// - /// Following the class array is a title array that contains the initial text or resource identifier - /// of the control. If the first element of this array is 0xFFFF, the array has one additional element - /// that specifies an ordinal value of a resource, such as an icon, in an executable file. You can use - /// a resource identifier for controls, such as static icon controls, that load and display an icon - /// or other resource rather than text. If the first element is any value other than 0xFFFF, the system - /// treats the array as a null-terminated Unicode string that specifies the initial text. - /// - /// - /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the - /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. - /// - public string TitleResource; - - /// - /// An ordinal value of a resource, such as an icon, in an executable file - /// - public ushort TitleResourceOrdinal; - - /// - /// The creation data array begins at the next WORD boundary after the title array. This creation data - /// can be of any size and format. If the first word of the creation data array is nonzero, it indicates - /// the size, in bytes, of the creation data (including the size word). - /// - public ushort CreationDataSize; - - /// - /// The creation data array begins at the next WORD boundary after the title array. This creation data - /// can be of any size and format. The control's window procedure must be able to interpret the data. - /// When the system creates the control, it passes a pointer to this data in the lParam parameter of the - /// WM_CREATE message that it sends to the control. - /// - public byte[] CreationData; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/DialogItemTemplateExtended.cs b/BinaryObjectScanner.Models/PortableExecutable/DialogItemTemplateExtended.cs deleted file mode 100644 index ae50537e..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/DialogItemTemplateExtended.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// A block of text used by an extended dialog box template to describe the extended dialog box. - /// For a description of the format of an extended dialog box template, see DLGTEMPLATEEX. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class DialogItemTemplateExtended - { - /// - /// The help context identifier for the control. When the system sends a WM_HELP message, - /// it passes the helpID value in the dwContextId member of the HELPINFO structure. - /// - public uint HelpID; - - /// - /// The extended styles for a window. This member is not used to create controls in dialog - /// boxes, but applications that use dialog box templates can use it to create other types - /// of windows. - /// - public ExtendedWindowStyles ExtendedStyle; - - /// - /// The style of the control. This member can be a combination of window style values - /// (such as WS_BORDER) and one or more of the control style values (such as - /// BS_PUSHBUTTON and ES_LEFT). - /// - public WindowStyles Style; - - /// - /// The x-coordinate, in dialog box units, of the upper-left corner of the control. - /// This coordinate is always relative to the upper-left corner of the dialog box's - /// client area. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values to screen - /// units (pixels) by using the MapDialogRect function. - /// - public short PositionX; - - /// - /// The y-coordinate, in dialog box units, of the upper-left corner of the control. - /// This coordinate is always relative to the upper-left corner of the dialog box's - /// client area. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values to screen - /// units (pixels) by using the MapDialogRect function. - /// - public short PositionY; - - /// - /// The width, in dialog box units, of the control. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values to screen - /// units (pixels) by using the MapDialogRect function. - /// - public short WidthX; - - /// - /// The height, in dialog box units, of the control. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values to screen - /// units (pixels) by using the MapDialogRect function. - /// - public short HeightY; - - /// - /// The control identifier. - /// - public uint ID; - - /// - /// A variable-length array of 16-bit elements that specifies the window class of the control. If - /// the first element of this array is any value other than 0xFFFF, the system treats the array as - /// a null-terminated Unicode string that specifies the name of a registered window class. - /// - /// If the first element is 0xFFFF, the array has one additional element that specifies the ordinal - /// value of a predefined system class. - /// - /// - /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the - /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. - /// - public string ClassResource; - - /// - /// The ordinal value of a predefined system class. - /// - public DialogItemTemplateOrdinal ClassResourceOrdinal; - - /// - /// A variable-length array of 16-bit elements that contains the initial text or resource identifier of the - /// control. If the first element of this array is 0xFFFF, the array has one additional element that - /// specifies the ordinal value of a resource, such as an icon, in an executable file. You can use a - /// resource identifier for controls, such as static icon controls, that load and display an icon or other - /// resource rather than text. If the first element is any value other than 0xFFFF, the system treats the - /// array as a null-terminated Unicode string that specifies the initial text. - /// - /// - /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the - /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. - /// - public string TitleResource; - - /// - /// An ordinal value of a resource, such as an icon, in an executable file - /// - public ushort TitleResourceOrdinal; - - /// - /// The creation data array begins at the next WORD boundary after the title array. This creation data - /// can be of any size and format. If the first word of the creation data array is nonzero, it indicates - /// the size, in bytes, of the creation data (including the size word). - /// - public ushort CreationDataSize; - - /// - /// The creation data array begins at the next WORD boundary after the title array. This creation data - /// can be of any size and format. The control's window procedure must be able to interpret the data. - /// When the system creates the control, it passes a pointer to this data in the lParam parameter of the - /// WM_CREATE message that it sends to the control. - /// - public byte[] CreationData; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/DialogTemplate.cs b/BinaryObjectScanner.Models/PortableExecutable/DialogTemplate.cs deleted file mode 100644 index d4cf2beb..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/DialogTemplate.cs +++ /dev/null @@ -1,163 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Defines the dimensions and style of a dialog box. This structure, always the first - /// in a standard template for a dialog box, also specifies the number of controls in - /// the dialog box and therefore specifies the number of subsequent DLGITEMTEMPLATE - /// structures in the template. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class DialogTemplate - { - /// - /// The style of the dialog box. This member can be a combination of window style - /// values (such as WS_CAPTION and WS_SYSMENU) and dialog box style values (such - /// as DS_CENTER). - /// - /// If the style member includes the DS_SETFONT style, the header of the dialog box - /// template contains additional data specifying the font to use for text in the - /// client area and controls of the dialog box. The font data begins on the WORD - /// boundary that follows the title array. The font data specifies a 16-bit point - /// size value and a Unicode font name string. If possible, the system creates a - /// font according to the specified values. Then the system sends a WM_SETFONT - /// message to the dialog box and to each control to provide a handle to the font. - /// If DS_SETFONT is not specified, the dialog box template does not include the - /// font data. - /// - /// The DS_SHELLFONT style is not supported in the DLGTEMPLATE header. - /// - public WindowStyles Style; - - /// - /// The extended styles for a window. This member is not used to create dialog boxes, - /// but applications that use dialog box templates can use it to create other types - /// of windows. - /// - public ExtendedWindowStyles ExtendedStyle; - - /// - /// The number of items in the dialog box. - /// - public ushort ItemCount; - - /// - /// The x-coordinate, in dialog box units, of the upper-left corner of the dialog box. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values - /// to screen units (pixels) by using the MapDialogRect function. - /// - public short PositionX; - - /// - /// The y-coordinate, in dialog box units, of the upper-left corner of the dialog box. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values - /// to screen units (pixels) by using the MapDialogRect function. - /// - public short PositionY; - - /// - /// The width, in dialog box units, of the dialog box. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values - /// to screen units (pixels) by using the MapDialogRect function. - /// - public short WidthX; - - /// - /// The height, in dialog box units, of the dialog box. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values - /// to screen units (pixels) by using the MapDialogRect function. - /// - public short HeightY; - - // In a standard template for a dialog box, the DLGTEMPLATE structure is always immediately - // followed by three variable-length arrays that specify the menu, class, and title for the - // dialog box. When the DS_SETFONT style is specified, these arrays are also followed by a - // 16-bit value specifying point size and another variable-length array specifying a - // typeface name. Each array consists of one or more 16-bit elements. The menu, class, title, - // and font arrays must be aligned on WORD boundaries. - - /// - /// Immediately following the DLGTEMPLATE structure is a menu array that identifies a menu - /// resource for the dialog box. If the first element of this array is 0x0000, the dialog box - /// has no menu and the array has no other elements. If the first element is 0xFFFF, the array - /// has one additional element that specifies the ordinal value of a menu resource in an - /// executable file. If the first element has any other value, the system treats the array as - /// a null-terminated Unicode string that specifies the name of a menu resource in an executable - /// file. - /// - /// - /// If you specify character strings in the menu, class, title, or typeface arrays, you must use - /// Unicode strings. - /// - public string MenuResource; - - /// - /// The ordinal value of a menu resource in an executable file. - /// - public ushort MenuResourceOrdinal; - - /// - /// Following the menu array is a class array that identifies the window class of the dialog box. - /// If the first element of the array is 0x0000, the system uses the predefined dialog box class - /// for the dialog box and the array has no other elements. If the first element is 0xFFFF, - /// the array has one additional element that specifies the ordinal value of a predefined system - /// window class. If the first element has any other value, the system treats the array as a - /// null-terminated Unicode string that specifies the name of a registered window class. - /// - /// - /// If you specify character strings in the menu, class, title, or typeface arrays, you must use - /// Unicode strings. - /// - public string ClassResource; - - /// - /// The ordinal value of a predefined system class. - /// - public ushort ClassResourceOrdinal; - - /// - /// Following the class array is a title array that specifies a null-terminated Unicode string - /// that contains the title of the dialog box. If the first element of this array is 0x0000, - /// the dialog box has no title and the array has no other elements. - /// - /// - /// If you specify character strings in the menu, class, title, or typeface arrays, you must use - /// Unicode strings. - /// - public string TitleResource; - - /// - /// The 16-bit point size value and the typeface array follow the title array, but only if the - /// style member specifies the DS_SETFONT style. The point size value specifies the point size - /// of the font to use for the text in the dialog box and its controls. When these values are - /// specified, the system creates a font having the specified size and typeface (if possible) - /// and sends a WM_SETFONT message to the dialog box procedure and the control window - /// procedures as it creates the dialog box and controls. - /// - public ushort PointSizeValue; - - /// - /// The 16-bit point size value and the typeface array follow the title array, but only if the - /// style member specifies the DS_SETFONT style. The typeface array is a null-terminated Unicode - /// string specifying the name of the typeface for the font. When these values are specified, - /// the system creates a font having the specified size and typeface (if possible) and sends a - /// WM_SETFONT message to the dialog box procedure and the control window procedures as it - /// creates the dialog box and controls. - /// - /// - /// If you specify character strings in the menu, class, title, or typeface arrays, you must use - /// Unicode strings. - /// - public string Typeface; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/DialogTemplateExtended.cs b/BinaryObjectScanner.Models/PortableExecutable/DialogTemplateExtended.cs deleted file mode 100644 index 28e9975b..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/DialogTemplateExtended.cs +++ /dev/null @@ -1,188 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// An extended dialog box template begins with a DLGTEMPLATEEX header that describes - /// the dialog box and specifies the number of controls in the dialog box. For each - /// control in a dialog box, an extended dialog box template has a block of data that - /// uses the DLGITEMTEMPLATEEX format to describe the control. - /// - /// The DLGTEMPLATEEX structure is not defined in any standard header file. The - /// structure definition is provided here to explain the format of an extended template - /// for a dialog box. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class DialogTemplateExtended - { - /// - /// The version number of the extended dialog box template. This member must be - /// set to 1. - /// - public ushort Version; - - /// - /// Indicates whether a template is an extended dialog box template. If signature - /// is 0xFFFF, this is an extended dialog box template. In this case, the dlgVer - /// member specifies the template version number. If signature is any value other - /// than 0xFFFF, this is a standard dialog box template that uses the DLGTEMPLATE - /// and DLGITEMTEMPLATE structures. - /// - public ushort Signature; - - /// - /// The help context identifier for the dialog box window. When the system sends a - /// WM_HELP message, it passes this value in the wContextId member of the HELPINFO - /// structure. - /// - public uint HelpID; - - /// - /// The extended windows styles. This member is not used when creating dialog boxes, - /// but applications that use dialog box templates can use it to create other types - /// of windows. - /// - public ExtendedWindowStyles ExtendedStyle; - - /// - /// The style of the dialog box. - /// - /// If style includes the DS_SETFONT or DS_SHELLFONT dialog box style, the DLGTEMPLATEEX - /// header of the extended dialog box template contains four additional members (pointsize, - /// weight, italic, and typeface) that describe the font to use for the text in the client - /// area and controls of the dialog box. If possible, the system creates a font according - /// to the values specified in these members. Then the system sends a WM_SETFONT message - /// to the dialog box and to each control to provide a handle to the font. - /// - public WindowStyles Style; - - /// - /// The number of controls in the dialog box. - /// - public ushort DialogItems; - - /// - /// The x-coordinate, in dialog box units, of the upper-left corner of the dialog box. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values - /// to screen units (pixels) by using the MapDialogRect function. - /// - public short PositionX; - - /// - /// The y-coordinate, in dialog box units, of the upper-left corner of the dialog box. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values - /// to screen units (pixels) by using the MapDialogRect function. - /// - public short PositionY; - - /// - /// The width, in dialog box units, of the dialog box. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values - /// to screen units (pixels) by using the MapDialogRect function. - /// - public short WidthX; - - /// - /// The height, in dialog box units, of the dialog box. - /// - /// - /// The x, y, cx, and cy members specify values in dialog box units. You can convert these values - /// to screen units (pixels) by using the MapDialogRect function. - /// - public short HeightY; - - /// - /// A variable-length array of 16-bit elements that identifies a menu resource for the dialog box. - /// If the first element of this array is 0x0000, the dialog box has no menu and the array has no - /// other elements. If the first element is 0xFFFF, the array has one additional element that - /// specifies the ordinal value of a menu resource in an executable file. If the first element has - /// any other value, the system treats the array as a null-terminated Unicode string that specifies - /// the name of a menu resource in an executable file. - /// - /// - /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the - /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. - /// - public string MenuResource; - - /// - /// The ordinal value of a menu resource in an executable file. - /// - public ushort MenuResourceOrdinal; - - /// A variable-length array of 16-bit elements that identifies the window class of the - /// dialog box. If the first element of the array is 0x0000, the system uses the predefined dialog - /// box class for the dialog box and the array has no other elements. If the first element is 0xFFFF, - /// the array has one additional element that specifies the ordinal value of a predefined system - /// window class. If the first element has any other value, the system treats the array as a - /// null-terminated Unicode string that specifies the name of a registered window class. - /// - /// - /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the - /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. - /// - public string ClassResource; - - /// - /// The ordinal value of a predefined system window class. - /// - public ushort ClassResourceOrdinal; - - /// - /// The title of the dialog box. If the first element of this array is 0x0000, the dialog box has no - /// title and the array has no other elements. - /// - /// - /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the - /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. - /// - public string TitleResource; - - /// - /// The point size of the font to use for the text in the dialog box and its controls. - /// - /// This member is present only if the style member specifies DS_SETFONT or DS_SHELLFONT. - /// - public ushort PointSize; - - /// - /// The weight of the font. Note that, although this can be any of the values listed for the lfWeight - /// member of the LOGFONT structure, any value that is used will be automatically changed to FW_NORMAL. - /// - /// This member is present only if the style member specifies DS_SETFONT or DS_SHELLFONT. - /// - public ushort Weight; - - /// - /// Indicates whether the font is italic. If this value is TRUE, the font is italic. - /// - /// This member is present only if the style member specifies DS_SETFONT or DS_SHELLFONT. - /// - public byte Italic; - - /// - /// The character set to be used. For more information, see the lfcharset member of LOGFONT. - /// - /// This member is present only if the style member specifies DS_SETFONT or DS_SHELLFONT. - /// - public byte CharSet; - - /// - /// The name of the typeface for the font. - /// - /// This member is present only if the style member specifies DS_SETFONT or DS_SHELLFONT. - /// - /// - /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the - /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. - /// - public string Typeface; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/DirEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/DirEntry.cs deleted file mode 100644 index 483acc12..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/DirEntry.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Contains the information necessary for an application to access a specific font. The structure - /// definition provided here is for explanation only; it is not present in any standard header file. - /// - /// - public sealed class DirEntry - { - /// - /// A unique ordinal identifier for an individual font in a font resource group. - /// - public ushort FontOrdinal; - - /// - /// The FONTDIRENTRY structure for the specified font directly follows the DIRENTRY structure - /// for that font. - /// - public FontDirEntry Entry; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/Enums.cs b/BinaryObjectScanner.Models/PortableExecutable/Enums.cs deleted file mode 100644 index 2802d90c..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/Enums.cs +++ /dev/null @@ -1,3373 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - [Flags] - public enum AcceleratorTableFlags : ushort - { - /// - /// The accelerator key is a virtual-key code. If this flag is not specified, - /// the accelerator key is assumed to specify an ASCII character code. - /// - FVIRTKEY = 0x01, - - /// - /// A menu item on the menu bar is not highlighted when an accelerator is used. - /// This attribute is obsolete and retained only for backward compatibility with - /// resource files designed for 16-bit Windows. - /// - FNOINVERT = 0x02, - - /// - /// The accelerator is activated only if the user presses the SHIFT key. This flag - /// applies only to virtual keys. - /// - FSHIFT = 0x04, - - /// - /// The accelerator is activated only if the user presses the CTRL key. This flag - /// applies only to virtual keys. - /// - FCONTROL = 0x08, - - /// - /// The accelerator is activated only if the user presses the ALT key. This flag - /// applies only to virtual keys. - /// - FALT = 0x10, - - /// - /// The entry is last in an accelerator table. - /// - LastEntry = 0x80, - } - - public enum BaseRelocationTypes : uint - { - /// - /// The base relocation is skipped. This type can be used to pad a block. - /// - IMAGE_REL_BASED_ABSOLUTE = 0, - - /// - /// The base relocation adds the high 16 bits of the difference to the 16-bit - /// field at offset. The 16-bit field represents the high value of a 32-bit word. - /// - IMAGE_REL_BASED_HIGH = 1, - - /// - /// The base relocation adds the low 16 bits of the difference to the 16-bit - /// field at offset. The 16-bit field represents the low half of a 32-bit word. - /// - IMAGE_REL_BASED_LOW = 2, - - /// - /// The base relocation applies all 32 bits of the difference to the 32-bit - /// field at offset. - /// - IMAGE_REL_BASED_HIGHLOW = 3, - - /// - /// The base relocation adds the high 16 bits of the difference to the 16-bit - /// field at offset. The 16-bit field represents the high value of a 32-bit word. - /// The low 16 bits of the 32-bit value are stored in the 16-bit word that follows - /// this base relocation. This means that this base relocation occupies two slots. - /// - IMAGE_REL_BASED_HIGHADJ = 4, - - /// - /// The relocation interpretation is dependent on the machine type. - /// When the machine type is MIPS, the base relocation applies to a MIPS jump - /// instruction. - /// - IMAGE_REL_BASED_MIPS_JMPADDR = 5, - - /// - /// This relocation is meaningful only when the machine type is ARM or Thumb. - /// The base relocation applies the 32-bit address of a symbol across a consecutive - /// MOVW/MOVT instruction pair. - /// - IMAGE_REL_BASED_ARM_MOV32 = 5, - - /// - /// This relocation is only meaningful when the machine type is RISC-V. The base - /// relocation applies to the high 20 bits of a 32-bit absolute address. - /// - IMAGE_REL_BASED_RISCV_HIGH20 = 5, - - /// - /// Reserved, must be zero. - /// - RESERVED6 = 6, - - /// - /// This relocation is meaningful only when the machine type is Thumb. The base - /// relocation applies the 32-bit address of a symbol to a consecutive MOVW/MOVT - /// instruction pair. - /// - IMAGE_REL_BASED_THUMB_MOV32 = 7, - - /// - /// This relocation is only meaningful when the machine type is RISC-V. The base - /// relocation applies to the low 12 bits of a 32-bit absolute address formed in - /// RISC-V I-type instruction format. - /// - IMAGE_REL_BASED_RISCV_LOW12I = 7, - - /// - /// This relocation is only meaningful when the machine type is RISC-V. The base - /// relocation applies to the low 12 bits of a 32-bit absolute address formed in - /// RISC-V S-type instruction format. - /// - IMAGE_REL_BASED_RISCV_LOW12S = 8, - - /// - /// This relocation is only meaningful when the machine type is LoongArch 32-bit. - /// The base relocation applies to a 32-bit absolute address formed in two - /// consecutive instructions. - /// - IMAGE_REL_BASED_LOONGARCH32_MARK_LA = 8, - - /// - /// This relocation is only meaningful when the machine type is LoongArch 64-bit. - /// The base relocation applies to a 64-bit absolute address formed in four - /// consecutive instructions. - /// - IMAGE_REL_BASED_LOONGARCH64_MARK_LA = 8, - - /// - /// The relocation is only meaningful when the machine type is MIPS. The base - /// relocation applies to a MIPS16 jump instruction. - /// - IMAGE_REL_BASED_MIPS_JMPADDR16 = 9, - - /// - /// The base relocation applies the difference to the 64-bit field at offset. - /// - IMAGE_REL_BASED_DIR64 = 10, - } - - public enum CallbackReason : ushort - { - /// - /// A new process has started, including the first thread. - /// - DLL_PROCESS_ATTACH = 1, - - /// - /// A new thread has been created. This notification sent for - /// all but the first thread. - /// - DLL_THREAD_ATTACH = 2, - - /// - /// A thread is about to be terminated. This notification sent - /// for all but the first thread. - /// - DLL_THREAD_DETACH = 3, - - /// - /// A process is about to terminate, including the original thread. - /// - DLL_PROCESS_DETACH = 0, - } - - [Flags] - public enum Characteristics : ushort - { - /// - /// Image only, Windows CE, and Microsoft Windows NT and later. - /// This indicates that the file does not contain base relocations - /// and must therefore be loaded at its preferred base address. - /// If the base address is not available, the loader reports an - /// error. The default behavior of the linker is to strip base - /// relocations from executable (EXE) files. - /// - IMAGE_FILE_RELOCS_STRIPPED = 0x0001, - - /// - /// Image only. This indicates that the image file is valid and - /// can be run. If this flag is not set, it indicates a linker error. - /// - IMAGE_FILE_EXECUTABLE_IMAGE = 0x0002, - - /// - /// COFF line numbers have been removed. This flag is deprecated - /// and should be zero. - /// - IMAGE_FILE_LINE_NUMS_STRIPPED = 0x0004, - - /// - /// COFF symbol table entries for local symbols have been removed. - /// This flag is deprecated and should be zero. - /// - IMAGE_FILE_LOCAL_SYMS_STRIPPED = 0x0008, - - /// - /// Obsolete. Aggressively trim working set. This flag is deprecated - /// for Windows 2000 and later and must be zero. - /// - IMAGE_FILE_AGGRESSIVE_WS_TRIM = 0x0010, - - /// - /// Application can handle > 2-GB addresses. - /// - IMAGE_FILE_LARGE_ADDRESS_AWARE = 0x0020, - - /// - /// This flag is reserved for future use. - /// - RESERVED = 0x0040, - - /// - /// Little endian: the least significant bit (LSB) precedes the most - /// significant bit (MSB) in memory. This flag is deprecated and - /// should be zero. - /// - IMAGE_FILE_BYTES_REVERSED_LO = 0x0080, - - /// - /// Machine is based on a 32-bit-word architecture. - /// - IMAGE_FILE_32BIT_MACHINE = 0x0100, - - /// - /// Debugging information is removed from the image file. - /// - IMAGE_FILE_DEBUG_STRIPPED = 0x0200, - - /// - /// If the image is on removable media, fully load it and - /// copy it to the swap file. - /// - IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP = 0x0400, - - /// - /// If the image is on network media, fully load it and copy - /// it to the swap file. - /// - IMAGE_FILE_NET_RUN_FROM_SWAP = 0x0800, - - /// - /// The image file is a system file, not a user program. - /// - IMAGE_FILE_SYSTEM = 0x1000, - - /// - /// The image file is a dynamic-link library (DLL). Such files - /// are considered executable files for almost all purposes, - /// although they cannot be directly run. - /// - IMAGE_FILE_DLL = 0x2000, - - /// - /// The file should be run only on a uniprocessor machine. - /// - IMAGE_FILE_UP_SYSTEM_ONLY = 0x4000, - - /// - /// Big endian: the MSB precedes the LSB in memory. This flag - /// is deprecated and should be zero. - /// - IMAGE_FILE_BYTES_REVERSED_HI = 0x8000, - } - - public enum COMDATSelect : byte - { - /// - /// If this symbol is already defined, the linker issues a "multiply - /// defined symbol" error. - /// - IMAGE_COMDAT_SELECT_NODUPLICATES = 0x01, - - /// - /// Any section that defines the same COMDAT symbol can be linked; - /// the rest are removed. - /// - IMAGE_COMDAT_SELECT_ANY = 0x02, - - /// - /// The linker chooses an arbitrary section among the definitions - /// for this symbol. If all definitions are not the same size, a - /// "multiply defined symbol" error is issued. - /// - IMAGE_COMDAT_SELECT_SAME_SIZE = 0x03, - - /// - /// The linker chooses an arbitrary section among the definitions - /// for this symbol. If all definitions do not match exactly, a - /// "multiply defined symbol" error is issued. - /// - IMAGE_COMDAT_SELECT_EXACT_MATCH = 0x04, - - /// - /// The section is linked if a certain other COMDAT section is linked. - /// This other section is indicated by the Number field of the - /// auxiliary symbol record for the section definition. This setting - /// is useful for definitions that have components in multiple sections - /// (for example, code in one and data in another), but where all must - /// be linked or discarded as a set. The other section this section is - /// associated with must be a COMDAT section, which can be another - /// associative COMDAT section. An associative COMDAT section's section - /// association chain can't form a loop. The section association chain - /// must eventually come to a COMDAT section that doesn't have - /// IMAGE_COMDAT_SELECT_ASSOCIATIVE set. - /// - IMAGE_COMDAT_SELECT_ASSOCIATIVE = 0x05, - - /// - /// The linker chooses the largest definition from among all of the - /// definitions for this symbol. If multiple definitions have this size, - /// the choice between them is arbitrary. - /// - IMAGE_COMDAT_SELECT_LARGEST = 0x06, - } - - public enum DebugType : uint - { - /// - /// An unknown value that is ignored by all tools. - /// - IMAGE_DEBUG_TYPE_UNKNOWN = 0, - - /// - /// The COFF debug information (line numbers, symbol table, and string table). - /// This type of debug information is also pointed to by fields in the file - /// headers. - /// - IMAGE_DEBUG_TYPE_COFF = 1, - - /// - /// The Visual C++ debug information. - /// - IMAGE_DEBUG_TYPE_CODEVIEW = 2, - - /// - /// The frame pointer omission (FPO) information. This information tells the - /// debugger how to interpret nonstandard stack frames, which use the EBP - /// register for a purpose other than as a frame pointer. - /// - IMAGE_DEBUG_TYPE_FPO = 3, - - /// - /// The location of DBG file. - /// - IMAGE_DEBUG_TYPE_MISC = 4, - - /// - /// A copy of .pdata section. - /// - IMAGE_DEBUG_TYPE_EXCEPTION = 5, - - /// - /// Reserved. - /// - IMAGE_DEBUG_TYPE_FIXUP = 6, - - /// - /// The mapping from an RVA in image to an RVA in source image. - /// - IMAGE_DEBUG_TYPE_OMAP_TO_SRC = 7, - - /// - /// The mapping from an RVA in source image to an RVA in image. - /// - IMAGE_DEBUG_TYPE_OMAP_FROM_SRC = 8, - - /// - /// Reserved for Borland. - /// - IMAGE_DEBUG_TYPE_BORLAND = 9, - - /// - /// Reserved. - /// - IMAGE_DEBUG_TYPE_RESERVED10 = 10, - - /// - /// Reserved. - /// - IMAGE_DEBUG_TYPE_CLSID = 11, - - /// - /// PE determinism or reproducibility. - /// - IMAGE_DEBUG_TYPE_REPRO = 16, - - /// - /// Extended DLL characteristics bits. - /// - IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS = 20, - } - - public enum DialogItemTemplateOrdinal : ushort - { - Button = 0x0080, - Edit = 0x0081, - Static = 0x0082, - ListBox = 0x0083, - ScrollBar = 0x0084, - ComboBox = 0x0085, - } - - [Flags] - public enum DllCharacteristics : ushort - { - /// - /// Reserved, must be zero. - /// - RESERVED0 = 0x0001, - - /// - /// Reserved, must be zero. - /// - RESERVED1 = 0x0002, - - /// - /// Reserved, must be zero. - /// - RESERVED2 = 0x0004, - - /// - /// Reserved, must be zero. - /// - RESERVED3 = 0x0008, - - /// - /// Image can handle a high entropy 64-bit virtual address space. - /// - IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA = 0x0020, - - /// - /// DLL can be relocated at load time. - /// - IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE = 0x0040, - - /// - /// Code Integrity checks are enforced. - /// - IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY = 0x0080, - - /// - /// Image is NX compatible. - /// - IMAGE_DLLCHARACTERISTICS_NX_COMPAT = 0x0100, - - /// - /// Isolation aware, but do not isolate the image. - /// - IMAGE_DLLCHARACTERISTICS_NO_ISOLATION = 0x0200, - - /// - /// Does not use structured exception (SE) handling. - /// No SE handler may be called in this image. - /// - IMAGE_DLLCHARACTERISTICS_NO_SEH = 0x0400, - - /// - /// Do not bind the image. - /// - IMAGE_DLLCHARACTERISTICS_NO_BIND = 0x0800, - - /// - /// Image must execute in an AppContainer. - /// - IMAGE_DLLCHARACTERISTICS_APPCONTAINER = 0x1000, - - /// - /// A WDM driver. - /// - IMAGE_DLLCHARACTERISTICS_WDM_DRIVER = 0x2000, - - /// - /// Image supports Control Flow Guard. - /// - IMAGE_DLLCHARACTERISTICS_GUARD_CF = 0x4000, - - /// - /// Terminal Server aware. - /// - IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE = 0x8000, - } - - [Flags] - public enum ExtendedDllCharacteristics : ushort - { - /// - /// Image is CET compatible. - /// - IMAGE_DLLCHARACTERISTICS_EX_CET_COMPAT = 0x0001, - } - - [Flags] - public enum ExtendedWindowStyles : uint - { - /// - /// The window has generic left-aligned properties. This is the default. - /// - WS_EX_LEFT = 0x00000000, - - /// - /// The window text is displayed using left-to-right reading-order properties. - /// This is the default. - /// - WS_EX_LTRREADING = 0x00000000, - - /// - /// The vertical scroll bar (if present) is to the right of the client area. - /// This is the default. - /// - WS_EX_RIGHTSCROLLBAR = 0x00000000, - - /// - /// The window has a double border; the window can, optionally, be created with - /// a title bar by specifying the WS_CAPTION style in the dwStyle parameter. - /// - WS_EX_DLGMODALFRAME = 0x00000001, - - /// - /// The child window created with this style does not send the WM_PARENTNOTIFY - /// message to its parent window when it is created or destroyed. - /// - WS_EX_NOPARENTNOTIFY = 0x00000004, - - /// - /// The window should be placed above all non-topmost windows and should stay above them, - /// even when the window is deactivated. To add or remove this style, use the - /// SetWindowPos function. - /// - WS_EX_TOPMOST = 0x00000008, - - /// - /// The window accepts drag-drop files. - /// - WS_EX_ACCEPTFILES = 0x00000010, - - /// - /// The window should not be painted until siblings beneath the window (that were created - /// by the same thread) have been painted. The window appears transparent because the bits - /// of underlying sibling windows have already been painted. - /// - /// To achieve transparency without these restrictions, use the SetWindowRgn function. - /// - WS_EX_TRANSPARENT = 0x00000020, - - /// - /// The window is a MDI child window. - /// - WS_EX_MDICHILD = 0x00000040, - - /// - /// The window is intended to be used as a floating toolbar. A tool window has a title - /// bar that is shorter than a normal title bar, and the window title is drawn using a - /// smaller font. A tool window does not appear in the taskbar or in the dialog that - /// appears when the user presses ALT+TAB. If a tool window has a system menu, its icon - /// is not displayed on the title bar. However, you can display the system menu by - /// right-clicking or by typing ALT+SPACE. - /// - WS_EX_TOOLWINDOW = 0x00000080, - - /// - /// The window has a border with a raised edge. - /// - WS_EX_WINDOWEDGE = 0x00000100, - - /// - /// The window has a border with a sunken edge. - /// - WS_EX_CLIENTEDGE = 0x00000200, - - /// - /// The title bar of the window includes a question mark. When the user clicks - /// the question mark, the cursor changes to a question mark with a pointer. If - /// the user then clicks a child window, the child receives a WM_HELP message. - /// The child window should pass the message to the parent window procedure, - /// which should call the WinHelp function using the HELP_WM_HELP command. The - /// Help application displays a pop-up window that typically contains help for - /// the child window. - /// - /// WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX - /// styles. - /// - WS_EX_CONTEXTHELP = 0x00000400, - - /// - /// The window has generic "right-aligned" properties. This depends on the window class. - /// This style has an effect only if the shell language is Hebrew, Arabic, or another - /// language that supports reading-order alignment; otherwise, the style is ignored. - /// - /// Using the WS_EX_RIGHT style for static or edit controls has the same effect as using - /// the SS_RIGHT or ES_RIGHT style, respectively. Using this style with button controls - /// has the same effect as using BS_RIGHT and BS_RIGHTBUTTON styles. - /// - WS_EX_RIGHT = 0x00001000, - - /// - /// If the shell language is Hebrew, Arabic, or another language that supports reading-order - /// alignment, the window text is displayed using right-to-left reading-order properties. - /// For other languages, the style is ignored. - /// - WS_EX_RTLREADING = 0x00002000, - - /// - /// If the shell language is Hebrew, Arabic, or another language that supports - /// reading order alignment, the vertical scroll bar (if present) is to the left - /// of the client area. For other languages, the style is ignored. - /// - WS_EX_LEFTSCROLLBAR = 0x00004000, - - /// - /// The window itself contains child windows that should take part in dialog box - /// navigation. If this style is specified, the dialog manager recurses into - /// children of this window when performing navigation operations such as handling - /// the TAB key, an arrow key, or a keyboard mnemonic. - /// - WS_EX_CONTROLPARENT = 0x00010000, - - /// - /// The window has a three-dimensional border style intended to be used for items that do - /// not accept user input. - /// - WS_EX_STATICEDGE = 0x00020000, - - /// - /// Forces a top-level window onto the taskbar when the window is visible. - /// - WS_EX_APPWINDOW = 0x00040000, - - /// - /// The window is a layered window. This style cannot be used if the window has a - /// class style of either CS_OWNDC or CS_CLASSDC. - /// - /// Windows 8: The WS_EX_LAYERED style is supported for top-level windows and child - /// windows. Previous Windows versions support WS_EX_LAYERED only for top-level windows. - /// - WS_EX_LAYERED = 0x00080000, - - /// - /// The window does not pass its window layout to its child windows. - /// - WS_EX_NOINHERITLAYOUT = 0x00100000, - - /// - /// The window does not render to a redirection surface. This is for windows that do not - /// have visible content or that use mechanisms other than surfaces to provide their visual. - /// - WS_EX_NOREDIRECTIONBITMAP = 0x00200000, - - /// - /// If the shell language is Hebrew, Arabic, or another language that supports reading - /// order alignment, the horizontal origin of the window is on the right edge. - /// Increasing horizontal values advance to the left. - /// - WS_EX_LAYOUTRTL = 0x00400000, - - /// - /// Paints all descendants of a window in bottom-to-top painting order using - /// double-buffering. Bottom-to-top painting order allows a descendent window - /// to have translucency (alpha) and transparency (color-key) effects, but only - /// if the descendent window also has the WS_EX_TRANSPARENT bit set. - /// Double-buffering allows the window and its descendents to be painted without - /// flicker. This cannot be used if the window has a class style of either - /// CS_OWNDC or CS_CLASSDC. - /// - /// Windows 2000: This style is not supported. - /// - WS_EX_COMPOSITED = 0x02000000, - - /// - /// A top-level window created with this style does not become the foreground window when - /// the user clicks it. The system does not bring this window to the foreground when the - /// user minimizes or closes the foreground window. - /// - /// The window should not be activated through programmatic access or via keyboard - /// navigation by accessible technology, such as Narrator. - /// - /// To activate the window, use the SetActiveWindow or SetForegroundWindow function. - /// - /// The window does not appear on the taskbar by default. To force the window to appear on - /// the taskbar, use the WS_EX_APPWINDOW style. - /// - WS_EX_NOACTIVATE = 0x08000000, - - /// - /// The window is an overlapped window. - /// - WS_EX_OVERLAPPEDWINDOW = WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE, - - /// - /// The window is palette window, which is a modeless dialog box that presents an array of - /// commands. - /// - WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST, - } - - public enum FixedFileInfoFileSubtype : uint - { - /// - /// The driver type is unknown by the system. - /// The font type is unknown by the system. - /// - VFT2_UNKNOWN = 0x00000000, - - #region VFT_DRV - - /// - /// The file contains a printer driver. - /// - VFT2_DRV_PRINTER = 0x00000001, - - /// - /// The file contains a keyboard driver. - /// - VFT2_DRV_KEYBOARD = 0x00000002, - - /// - /// The file contains a language driver. - /// - VFT2_DRV_LANGUAGE = 0x00000003, - - /// - /// The file contains a display driver. - /// - VFT2_DRV_DISPLAY = 0x00000004, - - /// - /// The file contains a mouse driver. - /// - VFT2_DRV_MOUSE = 0x00000005, - - /// - /// The file contains a network driver. - /// - VFT2_DRV_NETWORK = 0x00000006, - - /// - /// The file contains a system driver. - /// - VFT2_DRV_SYSTEM = 0x00000007, - - /// - /// The file contains an installable driver. - /// - VFT2_DRV_INSTALLABLE = 0x00000008, - - /// - /// The file contains a sound driver. - /// - VFT2_DRV_SOUND = 0x00000009, - - /// - /// The file contains a communications driver. - /// - VFT2_DRV_COMM = 0x0000000A, - - /// - /// The file contains a versioned printer driver. - /// - VFT2_DRV_VERSIONED_PRINTER = 0x0000000C, - - #endregion - - #region VFT_FONT - - /// - /// The file contains a raster font. - /// - VFT2_FONT_RASTER = 0x00000001, - - /// - /// The file contains a vector font. - /// - VFT2_FONT_VECTOR = 0x00000002, - - /// - /// The file contains a TrueType font. - /// - VFT2_FONT_TRUETYPE = 0x00000003, - - #endregion - } - - public enum FixedFileInfoFileType : uint - { - /// - /// The file type is unknown to the system. - /// - VFT_UNKNOWN = 0x00000000, - - /// - /// The file contains an application. - /// - VFT_APP = 0x00000001, - - /// - /// The file contains a DLL. - /// - VFT_DLL = 0x00000002, - - /// - /// The file contains a device driver. If FileType is VFT_DRV, FileSubtype - /// contains a more specific description of the driver. - /// - VFT_DRV = 0x00000003, - - /// - /// The file contains a font. If FileType is VFT_FONT, FileSubtype contains - /// a more specific description of the font file. - /// - VFT_FONT = 0x00000004, - - /// - /// The file contains a virtual device. - /// - VFT_VXD = 0x00000005, - - /// - /// The file contains a static-link library. - /// - VFT_STATIC_LIB = 0x00000007, - } - - [Flags] - public enum FixedFileInfoFlags : uint - { - /// - /// The file contains debugging information or is compiled with debugging - /// features enabled. - /// - VS_FF_DEBUG = 0x00000001, - - /// - /// The file is a development version, not a commercially released product. - /// - VS_FF_PRERELEASE = 0x00000002, - - /// - /// The file has been modified and is not identical to the original shipping - /// file of the same version number. - /// - VS_FF_PATCHED = 0x00000004, - - /// - /// The file was not built using standard release procedures. If this flag is - /// set, the StringFileInfo structure should contain a PrivateBuild entry. - /// - VS_FF_PRIVATEBUILD = 0x00000008, - - /// - /// The file's version structure was created dynamically; therefore, some - /// of the members in this structure may be empty or incorrect. This flag - /// should never be set in a file's VS_VERSIONINFO data. - /// - VS_FF_INFOINFERRED = 0x00000010, - - /// - /// The file was built by the original company using standard release - /// procedures but is a variation of the normal file of the same version number. - /// If this flag is set, the StringFileInfo structure should contain a SpecialBuild - /// entry. - /// - VS_FF_SPECIALBUILD = 0x00000020, - } - - [Flags] - public enum FixedFileInfoOS : uint - { - /// - /// The operating system for which the file was designed is - /// unknown to the system. - /// - VOS_UNKNOWN = 0x00000000, - - /// - /// The file was designed for 16-bit Windows. - /// - VOS__WINDOWS16 = 0x00000001, - - /// - /// The file was designed for 16-bit Presentation Manager. - /// - VOS__PM16 = 0x00000002, - - /// - /// The file was designed for 32-bit Presentation Manager. - /// - VOS__PM32 = 0x00000003, - - /// - /// The file was designed for 32-bit Windows. - /// - VOS__WINDOWS32 = 0x00000004, - - /// - /// The file was designed for MS-DOS. - /// - VOS_DOS = 0x00010000, - - /// - /// The file was designed for 16-bit OS/2. - /// - VOS_OS216 = 0x00020000, - - /// - /// The file was designed for 32-bit OS/2. - /// - VOS_OS232 = 0x00030000, - - /// - /// The file was designed for Windows NT. - /// - VOS_NT = 0x00040000, - } - - [Flags] - public enum GuardFlags : uint - { - /// - /// Module performs control flow integrity checks using - /// system-supplied support. - /// - IMAGE_GUARD_CF_INSTRUMENTED = 0x00000100, - - /// - /// Module performs control flow and write integrity checks. - /// - IMAGE_GUARD_CFW_INSTRUMENTED = 0x00000200, - - /// - /// Module contains valid control flow target metadata. - /// - IMAGE_GUARD_CF_FUNCTION_TABLE_PRESENT = 0x00000400, - - /// - /// Module does not make use of the /GS security cookie. - /// - IMAGE_GUARD_SECURITY_COOKIE_UNUSED = 0x00000800, - - /// - /// Module supports read only delay load IAT. - /// - IMAGE_GUARD_PROTECT_DELAYLOAD_IAT = 0x00001000, - - /// - /// Delayload import table in its own .didat section (with - /// nothing else in it) that can be freely reprotected. - /// - IMAGE_GUARD_DELAYLOAD_IAT_IN_ITS_OWN_SECTION = 0x00002000, - - /// - /// Module contains suppressed export information. This also - /// infers that the address taken IAT table is also present - /// in the load config. - /// - IMAGE_GUARD_CF_EXPORT_SUPPRESSION_INFO_PRESENT = 0x00004000, - - /// - /// Module enables suppression of exports. - /// - IMAGE_GUARD_CF_ENABLE_EXPORT_SUPPRESSION = 0x00008000, - - /// - /// Module contains longjmp target information. - /// - IMAGE_GUARD_CF_LONGJUMP_TABLE_PRESENT = 0x00010000, - - /// - /// Mask for the subfield that contains the stride of Control - /// Flow Guard function table entries (that is, the additional - /// count of bytes per table entry). - /// - IMAGE_GUARD_CF_FUNCTION_TABLE_SIZE_MASK = 0xF0000000, - - /// - /// Additionally, the Windows SDK winnt.h header defines this - /// macro for the amount of bits to right-shift the GuardFlags - /// value to right-justify the Control Flow Guard function table - /// stride: - /// - IMAGE_GUARD_CF_FUNCTION_TABLE_SIZE_SHIFT = 28, - } - - public enum ImportType : ushort - { - /// - /// Executable code. - /// - IMPORT_CODE = 0, - - /// - /// Data. - /// - IMPORT_DATA = 1, - - /// - /// Specified as CONST in the .def file. - /// - IMPORT_CONST = 2, - } - - // Actually 3 bits - public enum ImportNameType : ushort - { - /// - /// The import is by ordinal. This indicates that the value in the - /// Ordinal/Hint field of the import header is the import's ordinal. - /// If this constant is not specified, then the Ordinal/Hint field - /// should always be interpreted as the import's hint. - /// - IMPORT_ORDINAL = 0, - - /// - /// The import name is identical to the public symbol name. - /// - IMPORT_NAME = 1, - - /// - /// The import name is the public symbol name, but skipping the leading - /// ?, @, or optionally _. - /// - IMPORT_NAME_NOPREFIX = 2, - - /// - /// The import name is the public symbol name, but skipping the leading - /// ?, @, or optionally _, and truncating at the first @. - /// - IMPORT_NAME_UNDECORATE = 3, - } - - public enum MachineType : ushort - { - /// - /// The content of this field is assumed to be applicable to any machine type - /// - IMAGE_FILE_MACHINE_UNKNOWN = 0x0000, - - /// - /// Matsushita AM33 - /// - IMAGE_FILE_MACHINE_AM33 = 0x01D3, - - /// - /// x64 - /// - IMAGE_FILE_MACHINE_AMD64 = 0x8664, - - /// - /// ARM little endian - /// - IMAGE_FILE_MACHINE_ARM = 0x01C0, - - /// - /// ARM64 little endian - /// - IMAGE_FILE_MACHINE_ARM64 = 0xAA64, - - /// - /// ARM Thumb-2 little endian - /// - IMAGE_FILE_MACHINE_ARMNT = 0x01C4, - - /// - /// EFI byte code - /// - IMAGE_FILE_MACHINE_EBC = 0x0EBC, - - /// - /// Intel 386 or later processors and compatible processors - /// - IMAGE_FILE_MACHINE_I386 = 0x014C, - - /// - /// Intel Itanium processor family - /// - IMAGE_FILE_MACHINE_IA64 = 0x0200, - - /// - /// LoongArch 32-bit processor family - /// - IMAGE_FILE_MACHINE_LOONGARCH32 = 0x6232, - - /// - /// LoongArch 64-bit processor family - /// - IMAGE_FILE_MACHINE_LOONGARCH64 = 0x6264, - - /// - /// Mitsubishi M32R little endian - /// - IMAGE_FILE_MACHINE_M32R = 0x9041, - - /// - /// MIPS16 - /// - IMAGE_FILE_MACHINE_MIPS16 = 0x0266, - - /// - /// MIPS with FPU - /// - IMAGE_FILE_MACHINE_MIPSFPU = 0x0366, - - /// - /// MIPS16 with FPU - /// - IMAGE_FILE_MACHINE_MIPSFPU16 = 0x0466, - - /// - /// Power PC little endian - /// - IMAGE_FILE_MACHINE_POWERPC = 0x01F0, - - /// - /// Power PC with floating point support - /// - IMAGE_FILE_MACHINE_POWERPCFP = 0x01F1, - - /// - /// MIPS little endian - /// - IMAGE_FILE_MACHINE_R4000 = 0x0166, - - /// - /// RISC-V 32-bit address space - /// - IMAGE_FILE_MACHINE_RISCV32 = 0x5032, - - /// - /// RISC-V 64-bit address space - /// - IMAGE_FILE_MACHINE_RISCV64 = 0x5064, - - /// - /// RISC-V 128-bit address space - /// - IMAGE_FILE_MACHINE_RISCV128 = 0x5128, - - /// - /// Hitachi SH3 - /// - IMAGE_FILE_MACHINE_SH3 = 0x01A2, - - /// - /// Hitachi SH3 DSP - /// - IMAGE_FILE_MACHINE_SH3DSP = 0x01A3, - - /// - /// Hitachi SH4 - /// - IMAGE_FILE_MACHINE_SH4 = 0x01A6, - - /// - /// Hitachi SH5 - /// - IMAGE_FILE_MACHINE_SH5 = 0x01A8, - - /// - /// Thumb - /// - IMAGE_FILE_MACHINE_THUMB = 0x01C2, - - /// - /// MIPS little-endian WCE v2 - /// - IMAGE_FILE_MACHINE_WCEMIPSV2 = 0x0169, - } - - [Flags] - public enum MemoryFlags : ushort - { - // TODO: Validate the ~ statements - MOVEABLE = 0x0010, - FIXED = 0xFFEF, // ~MOVEABLE - - PURE = 0x0020, - IMPURE = 0xFFDF, // ~PURE - - PRELOAD = 0x0040, - LOADONCALL = 0xFFBF, // ~PRELOAD - - DISCARDABLE = 0x1000, - } - - [Flags] - public enum MenuFlags : uint - { - MF_INSERT = 0x00000000, - MF_CHANGE = 0x00000080, - MF_APPEND = 0x00000100, - MF_DELETE = 0x00000200, - MF_REMOVE = 0x00001000, - - MF_BYCOMMAND = 0x00000000, - MF_BYPOSITION = 0x00000400, - - MF_SEPARATOR = 0x00000800, - - MF_ENABLED = 0x00000000, - MF_GRAYED = 0x00000001, - MF_DISABLED = 0x00000002, - - MF_UNCHECKED = 0x00000000, - MF_CHECKED = 0x00000008, - MF_USECHECKBITMAPS = 0x00000200, - - MF_STRING = 0x00000000, - MF_BITMAP = 0x00000004, - MF_OWNERDRAW = 0x00000100, - - MF_POPUP = 0x00000010, - MF_MENUBARBREAK = 0x00000020, - MF_MENUBREAK = 0x00000040, - - MF_UNHILITE = 0x00000000, - MF_HILITE = 0x00000080, - - MF_DEFAULT = 0x00001000, - MF_SYSMENU = 0x00002000, - MF_HELP = 0x00004000, - MF_RIGHTJUSTIFY = 0x00004000, - - MF_MOUSESELECT = 0x00008000, - MF_END = 0x00000080, - - MFT_STRING = MF_STRING, - MFT_BITMAP = MF_BITMAP, - MFT_MENUBARBREAK = MF_MENUBARBREAK, - MFT_MENUBREAK = MF_MENUBREAK, - MFT_OWNERDRAW = MF_OWNERDRAW, - MFT_RADIOCHECK = 0x00000200, - MFT_SEPARATOR = MF_SEPARATOR, - MFT_RIGHTORDER = 0x00002000, - MFT_RIGHTJUSTIFY = MF_RIGHTJUSTIFY, - - MFS_GRAYED = 0x00000003, - MFS_DISABLED = MFS_GRAYED, - MFS_CHECKED = MF_CHECKED, - MFS_HILITE = MF_HILITE, - MFS_ENABLED = MF_ENABLED, - MFS_UNCHECKED = MF_UNCHECKED, - MFS_UNHILITE = MF_UNHILITE, - MFS_DEFAULT = MF_DEFAULT, - } - - public enum OptionalHeaderMagicNumber : ushort - { - ROMImage = 0x0107, - - PE32 = 0x010B, - - PE32Plus = 0x020B, - } - - public enum RelocationType : ushort - { - #region x64 Processors - - /// - /// The relocation is ignored. - /// - IMAGE_REL_AMD64_ABSOLUTE = 0x0000, - - /// - /// The 64-bit VA of the relocation target. - /// - IMAGE_REL_AMD64_ADDR64 = 0x0001, - - /// - /// The 32-bit VA of the relocation target. - /// - IMAGE_REL_AMD64_ADDR32 = 0x0002, - - /// - /// The 32-bit address without an image base (RVA). - /// - IMAGE_REL_AMD64_ADDR32NB = 0x0003, - - /// - /// The 32-bit relative address from the byte following the relocation. - /// - IMAGE_REL_AMD64_REL32 = 0x0004, - - /// - /// The 32-bit address relative to byte distance 1 from the relocation. - /// - IMAGE_REL_AMD64_REL32_1 = 0x0005, - - /// - /// The 32-bit address relative to byte distance 2 from the relocation. - /// - IMAGE_REL_AMD64_REL32_2 = 0x0006, - - /// - /// The 32-bit address relative to byte distance 3 from the relocation. - /// - IMAGE_REL_AMD64_REL32_3 = 0x0007, - - /// - /// The 32-bit address relative to byte distance 4 from the relocation. - /// - IMAGE_REL_AMD64_REL32_4 = 0x0008, - - /// - /// The 32-bit address relative to byte distance 5 from the relocation. - /// - IMAGE_REL_AMD64_REL32_5 = 0x0009, - - /// - /// The 16-bit section index of the section that contains the target. - /// This is used to support debugging information. - /// - IMAGE_REL_AMD64_SECTION = 0x000A, - - /// - /// The 32-bit offset of the target from the beginning of its section. - /// This is used to support debugging information and static thread - /// local storage. - /// - IMAGE_REL_AMD64_SECREL = 0x000B, - - /// - /// A 7-bit unsigned offset from the base of the section that contains - /// the target. - /// - IMAGE_REL_AMD64_SECREL7 = 0x000C, - - /// - /// CLR tokens. - /// - IMAGE_REL_AMD64_TOKEN = 0x000D, - - /// - /// A 32-bit signed span-dependent value emitted into the object. - /// - IMAGE_REL_AMD64_SREL32 = 0x000E, - - /// - /// A pair that must immediately follow every span-dependent value. - /// - IMAGE_REL_AMD64_PAIR = 0x000F, - - /// - /// A 32-bit signed span-dependent value that is applied at link time. - /// - IMAGE_REL_AMD64_SSPAN32 = 0x0010, - - #endregion - - #region ARM Processors - - /// - /// The relocation is ignored. - /// - IMAGE_REL_ARM_ABSOLUTE = 0x0000, - - /// - /// The 32-bit VA of the target. - /// - IMAGE_REL_ARM_ADDR32 = 0x0001, - - /// - /// The 32-bit RVA of the target. - /// - IMAGE_REL_ARM_ADDR32NB = 0x0002, - - /// - /// The 24-bit relative displacement to the target. - /// - IMAGE_REL_ARM_BRANCH24 = 0x0003, - - /// - /// The reference to a subroutine call. The reference - /// consists of two 16-bit instructions with 11-bit offsets. - /// - IMAGE_REL_ARM_BRANCH11 = 0x0004, - - /// - /// The 32-bit relative address from the byte following the relocation. - /// - IMAGE_REL_ARM_REL32 = 0x000A, - - /// - /// The 16-bit section index of the section that contains the target. - /// This is used to support debugging information. - /// - IMAGE_REL_ARM_SECTION = 0x000E, - - /// - /// The 32-bit offset of the target from the beginning of its section. - /// This is used to support debugging information and static thread - /// local storage. - /// - IMAGE_REL_ARM_SECREL = 0x000F, - - /// - /// The 32-bit VA of the target.This relocation is applied using a MOVW - /// instruction for the low 16 bits followed by a MOVT for the high 16 bits. - /// - IMAGE_REL_ARM_MOV32 = 0x0010, - - /// - /// The 32-bit VA of the target.This relocation is applied using a MOVW - /// instruction for the low 16 bits followed by a MOVT for the high 16 bits. - /// - IMAGE_REL_THUMB_MOV32 = 0x0011, - - /// - /// The instruction is fixed up with the 21 - bit relative displacement to - /// the 2-byte aligned target. The least significant bit of the displacement - /// is always zero and is not stored. This relocation corresponds to a - /// Thumb-2 32-bit conditional B instruction. - /// - IMAGE_REL_THUMB_BRANCH20 = 0x0012, - - Unused = 0x0013, - - /// - /// The instruction is fixed up with the 25-bit relative displacement to - /// the 2-byte aligned target. The least significant bit of the displacement - /// is zero and is not stored. This relocation corresponds to a Thumb-2 B - /// instruction. - /// - IMAGE_REL_THUMB_BRANCH24 = 0x0014, - - /// - /// The instruction is fixed up with the 25-bit relative displacement to - /// the 4-byte aligned target. The low 2 bits of the displacement are zero - /// and are not stored. This relocation corresponds to a Thumb-2 BLX instruction. - /// - IMAGE_REL_THUMB_BLX23 = 0x0015, - - /// - /// The relocation is valid only when it immediately follows a ARM_REFHI or - /// THUMB_REFHI. Its SymbolTableIndex contains a displacement and not an index - /// into the symbol table. - /// - IMAGE_REL_ARM_PAIR = 0x0016, - - #endregion - - #region ARM64 Processors - - /// - /// The relocation is ignored. - /// - IMAGE_REL_ARM64_ABSOLUTE = 0x0000, - - /// - /// The 32-bit VA of the target. - /// - IMAGE_REL_ARM64_ADDR32 = 0x0001, - - /// - /// The 32-bit RVA of the target. - /// - IMAGE_REL_ARM64_ADDR32NB = 0x0002, - - /// - /// The 26-bit relative displacement to the target, for B and BL instructions. - /// - IMAGE_REL_ARM64_BRANCH26 = 0x0003, - - /// - /// The page base of the target, for ADRP instruction. - /// - IMAGE_REL_ARM64_PAGEBASE_REL21 = 0x0004, - - /// - /// The 12-bit relative displacement to the target, for instruction ADR - /// - IMAGE_REL_ARM64_REL21 = 0x0005, - - /// - /// The 12-bit page offset of the target, for instructions ADD/ADDS (immediate) - /// with zero shift. - /// - IMAGE_REL_ARM64_PAGEOFFSET_12A = 0x0006, - - /// - /// The 12-bit page offset of the target, for instruction LDR (indexed, - /// unsigned immediate). - /// - IMAGE_REL_ARM64_PAGEOFFSET_12L = 0x0007, - - /// - /// The 32-bit offset of the target from the beginning of its section. - /// This is used to support debugging information and static thread local storage. - /// - IMAGE_REL_ARM64_SECREL = 0x0008, - - /// - /// Bit 0:11 of section offset of the target, for instructions ADD/ADDS(immediate) - /// with zero shift. - /// - IMAGE_REL_ARM64_SECREL_LOW12A = 0x0009, - - /// - /// Bit 12:23 of section offset of the target, for instructions ADD/ADDS(immediate) - /// with zero shift. - /// - IMAGE_REL_ARM64_SECREL_HIGH12A = 0x000A, - - /// - /// Bit 0:11 of section offset of the target, for instruction LDR(indexed, - /// unsigned immediate). - /// - IMAGE_REL_ARM64_SECREL_LOW12L = 0x000B, - - /// - /// CLR token. - /// - IMAGE_REL_ARM64_TOKEN = 0x000C, - - /// - /// The 16-bit section index of the section that contains the target. - /// This is used to support debugging information. - /// - IMAGE_REL_ARM64_SECTION = 0x000D, - - /// - /// The 64-bit VA of the relocation target. - /// - IMAGE_REL_ARM64_ADDR64 = 0x000E, - - /// - /// The 19-bit offset to the relocation target, for conditional B instruction. - /// - IMAGE_REL_ARM64_BRANCH19 = 0x000F, - - /// - /// The 14-bit offset to the relocation target, for instructions TBZ and TBNZ. - /// - IMAGE_REL_ARM64_BRANCH14 = 0x0010, - - /// - /// The 32-bit relative address from the byte following the relocation. - /// - IMAGE_REL_ARM64_REL32 = 0x0011, - - #endregion - - #region Hitachi SuperH Processors - - /// - /// The relocation is ignored. - /// - IMAGE_REL_SH3_ABSOLUTE = 0x0000, - - /// - /// A reference to the 16-bit location that contains the VA of - /// the target symbol. - /// - IMAGE_REL_SH3_DIRECT16 = 0x0001, - - /// - /// The 32-bit VA of the target symbol. - /// - IMAGE_REL_SH3_DIRECT32 = 0x0002, - - /// - /// A reference to the 8-bit location that contains the VA of - /// the target symbol. - /// - IMAGE_REL_SH3_DIRECT8 = 0x0003, - - /// - /// A reference to the 8-bit instruction that contains the - /// effective 16-bit VA of the target symbol. - /// - IMAGE_REL_SH3_DIRECT8_WORD = 0x0004, - - /// - /// A reference to the 8-bit instruction that contains the - /// effective 32-bit VA of the target symbol. - /// - IMAGE_REL_SH3_DIRECT8_LONG = 0x0005, - - /// - /// A reference to the 8-bit location whose low 4 bits contain - /// the VA of the target symbol. - /// - IMAGE_REL_SH3_DIRECT4 = 0x0006, - - /// - /// A reference to the 8-bit instruction whose low 4 bits contain - /// the effective 16-bit VA of the target symbol. - /// - IMAGE_REL_SH3_DIRECT4_WORD = 0x0007, - - /// - /// A reference to the 8-bit instruction whose low 4 bits contain - /// the effective 32-bit VA of the target symbol. - /// - IMAGE_REL_SH3_DIRECT4_LONG = 0x0008, - - /// - /// A reference to the 8-bit instruction that contains the - /// effective 16-bit relative offset of the target symbol. - /// - IMAGE_REL_SH3_PCREL8_WORD = 0x0009, - - /// - /// A reference to the 8-bit instruction that contains the - /// effective 32-bit relative offset of the target symbol. - /// - IMAGE_REL_SH3_PCREL8_LONG = 0x000A, - - /// - /// A reference to the 16-bit instruction whose low 12 bits contain - /// the effective 16-bit relative offset of the target symbol. - /// - IMAGE_REL_SH3_PCREL12_WORD = 0x000B, - - /// - /// A reference to a 32-bit location that is the VA of the - /// section that contains the target symbol. - /// - IMAGE_REL_SH3_STARTOF_SECTION = 0x000C, - - /// - /// A reference to the 32-bit location that is the size of the - /// section that contains the target symbol. - /// - IMAGE_REL_SH3_SIZEOF_SECTION = 0x000D, - - /// - /// The 16-bit section index of the section that contains the target. - /// This is used to support debugging information. - /// - IMAGE_REL_SH3_SECTION = 0x000E, - - /// - /// The 32-bit offset of the target from the beginning of its section. - /// This is used to support debugging information and static thread - /// local storage. - /// - IMAGE_REL_SH3_SECREL = 0x000F, - - /// - /// The 32-bit RVA of the target symbol. - /// - IMAGE_REL_SH3_DIRECT32_NB = 0x0010, - - /// - /// GP relative. - /// - IMAGE_REL_SH3_GPREL4_LONG = 0x0011, - - /// - /// CLR token. - /// - IMAGE_REL_SH3_TOKEN = 0x0012, - - /// - /// The offset from the current instruction in longwords. If the NOMODE - /// bit is not set, insert the inverse of the low bit at bit 32 to - /// select PTA or PTB. - /// - IMAGE_REL_SHM_PCRELPT = 0x0013, - - /// - /// The low 16 bits of the 32-bit address. - /// - IMAGE_REL_SHM_REFLO = 0x0014, - - /// - /// The high 16 bits of the 32-bit address. - /// - IMAGE_REL_SHM_REFHALF = 0x0015, - - /// - /// The low 16 bits of the relative address. - /// - IMAGE_REL_SHM_RELLO = 0x0016, - - /// - /// The high 16 bits of the relative address. - /// - IMAGE_REL_SHM_RELHALF = 0x0017, - - /// - /// The relocation is valid only when it immediately follows a REFHALF, - /// RELHALF, or RELLO relocation. The SymbolTableIndex field of the - /// relocation contains a displacement and not an index into the symbol table. - /// - IMAGE_REL_SHM_PAIR = 0x0018, - - /// - /// The relocation ignores section mode. - /// - IMAGE_REL_SHM_NOMODE = 0x8000, - - #endregion - - #region IBM PowerPC Processors - - /// - /// The relocation is ignored. - /// - IMAGE_REL_PPC_ABSOLUTE = 0x0000, - - /// - /// The 64-bit VA of the target. - /// - IMAGE_REL_PPC_ADDR64 = 0x0001, - - /// - /// The 32-bit VA of the target. - /// - IMAGE_REL_PPC_ADDR32 = 0x0002, - - /// - /// The low 24 bits of the VA of the target. This is valid only when - /// the target symbol is absolute and can be sign-extended to its - /// original value. - /// - IMAGE_REL_PPC_ADDR24 = 0x0003, - - /// - /// The low 16 bits of the target's VA. - /// - IMAGE_REL_PPC_ADDR16 = 0x0004, - - /// - /// The low 14 bits of the target's VA. This is valid only when the - /// target symbol is absolute and can be sign-extended to its original - /// value. - /// - IMAGE_REL_PPC_ADDR14 = 0x0005, - - /// - /// A 24-bit PC-relative offset to the symbol's location. - /// - IMAGE_REL_PPC_REL24 = 0x0006, - - /// - /// A 14-bit PC-relative offset to the symbol's location. - /// - IMAGE_REL_PPC_REL14 = 0x0007, - - /// - /// The 32-bit RVA of the target. - /// - IMAGE_REL_PPC_ADDR32NB = 0x000A, - - /// - /// The 32-bit offset of the target from the beginning of its section. - /// This is used to support debugging information and static thread - /// local storage. - /// - IMAGE_REL_PPC_SECREL = 0x000B, - - /// - /// The 16-bit section index of the section that contains the target. - /// This is used to support debugging information. - /// - IMAGE_REL_PPC_SECTION = 0x000C, - - /// - /// The 16-bit offset of the target from the beginning of its section. - /// This is used to support debugging information and static thread - /// local storage. - /// - IMAGE_REL_PPC_SECREL16 = 0x000F, - - /// - /// The high 16 bits of the target's 32-bit VA. This is used for the - /// first instruction in a two-instruction sequence that loads a full - /// address. This relocation must be immediately followed by a PAIR - /// relocation whose SymbolTableIndex contains a signed 16-bit - /// displacement that is added to the upper 16 bits that was taken - /// from the location that is being relocated. - /// - IMAGE_REL_PPC_REFHI = 0x0010, - - /// - /// The low 16 bits of the target's VA. - /// - IMAGE_REL_PPC_REFLO = 0x0011, - - /// - /// A relocation that is valid only when it immediately follows a REFHI - /// or SECRELHI relocation. Its SymbolTableIndex contains a displacement - /// and not an index into the symbol table. - /// - IMAGE_REL_PPC_PAIR = 0x0012, - - /// - /// The low 16 bits of the 32-bit offset of the target from the beginning - /// of its section. - /// - IMAGE_REL_PPC_SECRELLO = 0x0013, - - /// - /// The 16-bit signed displacement of the target relative to the GP register. - /// - IMAGE_REL_PPC_GPREL = 0x0015, - - /// - /// The CLR token. - /// - IMAGE_REL_PPC_TOKEN = 0x0016, - - #endregion - - #region Intel 386 Processors - - /// - /// The relocation is ignored. - /// - IMAGE_REL_I386_ABSOLUTE = 0x0000, - - /// - /// Not supported. - /// - IMAGE_REL_I386_DIR16 = 0x0001, - - /// - /// Not supported. - /// - IMAGE_REL_I386_REL16 = 0x0002, - - /// - /// The target's 32-bit VA. - /// - IMAGE_REL_I386_DIR32 = 0x0006, - - /// - /// The target's 32-bit RVA. - /// - IMAGE_REL_I386_DIR32NB = 0x0007, - - /// - /// Not supported. - /// - IMAGE_REL_I386_SEG12 = 0x0009, - - /// - /// The 16-bit section index of the section that contains the target. - /// This is used to support debugging information. - /// - IMAGE_REL_I386_SECTION = 0x000A, - - /// - /// The 32-bit offset of the target from the beginning of its section. - /// This is used to support debugging information and static thread - /// local storage. - /// - IMAGE_REL_I386_SECREL = 0x000B, - - /// - /// The CLR token. - /// - IMAGE_REL_I386_TOKEN = 0x000C, - - /// - /// A 7-bit offset from the base of the section that contains the target. - /// - IMAGE_REL_I386_SECREL7 = 0x000D, - - /// - /// The 32-bit relative displacement to the target.This supports the x86 relative branch and call instructions. - /// - IMAGE_REL_I386_REL32 = 0x0014, - - #endregion - - #region Intel Itanium Processor Family (IPF) - - /// - /// The relocation is ignored. - /// - IMAGE_REL_IA64_ABSOLUTE = 0x0000, - - /// - /// The instruction relocation can be followed by an ADDEND relocation whose value is - /// added to the target address before it is inserted into the specified slot in the - /// IMM14 bundle. The relocation target must be absolute or the image must be fixed. - /// - IMAGE_REL_IA64_IMM14 = 0x0001, - - /// - /// The instruction relocation can be followed by an ADDEND relocation whose value is - /// added to the target address before it is inserted into the specified slot in the - /// IMM22 bundle. The relocation target must be absolute or the image must be fixed. - /// - IMAGE_REL_IA64_IMM22 = 0x0002, - - /// - /// The slot number of this relocation must be one (1). The relocation can be followed - /// by an ADDEND relocation whose value is added to the target address before it is - /// stored in all three slots of the IMM64 bundle. - /// - IMAGE_REL_IA64_IMM64 = 0x0003, - - /// - /// The target's 32-bit VA. This is supported only for /LARGEADDRESSAWARE:NO images. - /// - IMAGE_REL_IA64_DIR32 = 0x0004, - - /// - /// The target's 64-bit VA. - /// - IMAGE_REL_IA64_DIR64 = 0x0005, - - /// - /// The instruction is fixed up with the 25-bit relative displacement to the 16-bit - /// aligned target. The low 4 bits of the displacement are zero and are not stored. - /// - IMAGE_REL_IA64_PCREL21B = 0x0006, - - /// - /// The instruction is fixed up with the 25-bit relative displacement to the 16-bit - /// aligned target. The low 4 bits of the displacement, which are zero, are not stored. - /// - IMAGE_REL_IA64_PCREL21M = 0x0007, - - /// - /// The LSBs of this relocation's offset must contain the slot number whereas the rest - /// is the bundle address. The bundle is fixed up with the 25-bit relative displacement - /// to the 16-bit aligned target. The low 4 bits of the displacement are zero and are - /// not stored. - /// - IMAGE_REL_IA64_PCREL21F = 0x0008, - - /// - /// The instruction relocation can be followed by an ADDEND relocation whose value is - /// added to the target address and then a 22-bit GP-relative offset that is calculated - /// and applied to the GPREL22 bundle. - /// - IMAGE_REL_IA64_GPREL22 = 0x0009, - - /// - /// The instruction is fixed up with the 22-bit GP-relative offset to the target symbol's - /// literal table entry. The linker creates this literal table entry based on this - /// relocation and the ADDEND relocation that might follow. - /// - IMAGE_REL_IA64_LTOFF22 = 0x000A, - - /// - /// The 16-bit section index of the section contains the target. This is used to support - /// debugging information. - /// - IMAGE_REL_IA64_SECTION = 0x000B, - - /// - /// The instruction is fixed up with the 22-bit offset of the target from the beginning of - /// its section.This relocation can be followed immediately by an ADDEND relocation, - /// whose Value field contains the 32-bit unsigned offset of the target from the beginning - /// of the section. - /// - IMAGE_REL_IA64_SECREL22 = 0x000C, - - /// - /// The slot number for this relocation must be one (1). The instruction is fixed up with - /// the 64-bit offset of the target from the beginning of its section. This relocation can - /// be followed immediately by an ADDEND relocation whose Value field contains the 32-bit - /// unsigned offset of the target from the beginning of the section. - /// - IMAGE_REL_IA64_SECREL64I = 0x000D, - - /// - /// The address of data to be fixed up with the 32-bit offset of the target from the beginning - /// of its section. - /// - IMAGE_REL_IA64_SECREL32 = 0x000E, - - /// - /// The target's 32-bit RVA. - /// - IMAGE_REL_IA64_DIR32NB = 0x0010, - - /// - /// This is applied to a signed 14-bit immediate that contains the difference between two - /// relocatable targets. This is a declarative field for the linker that indicates that the - /// compiler has already emitted this value. - /// - IMAGE_REL_IA64_SREL14 = 0x0011, - - /// - /// This is applied to a signed 22-bit immediate that contains the difference between two - /// relocatable targets. This is a declarative field for the linker that indicates that the - /// compiler has already emitted this value. - /// - IMAGE_REL_IA64_SREL22 = 0x0012, - - /// - /// This is applied to a signed 32-bit immediate that contains the difference between two - /// relocatable values.This is a declarative field for the linker that indicates that the - /// compiler has already emitted this value. - /// - IMAGE_REL_IA64_SREL32 = 0x0013, - - /// - /// This is applied to an unsigned 32-bit immediate that contains the difference between - /// two relocatable values. This is a declarative field for the linker that indicates that - /// the compiler has already emitted this value. - /// - IMAGE_REL_IA64_UREL32 = 0x0014, - - /// - /// A 60-bit PC-relative fixup that always stays as a BRL instruction of an MLX bundle. - /// - IMAGE_REL_IA64_PCREL60X = 0x0015, - - /// - /// A 60-bit PC-relative fixup. If the target displacement fits in a signed 25-bit field, - /// convert the entire bundle to an MBB bundle with NOP. B in slot 1 and a 25-bit BR - /// instruction (with the 4 lowest bits all zero and dropped) in slot 2. - /// - IMAGE_REL_IA64_PCREL60B = 0x0016, - - /// - /// A 60-bit PC-relative fixup. If the target displacement fits in a signed 25-bit field, - /// convert the entire bundle to an MFB bundle with NOP. F in slot 1 and a 25-bit - /// (4 lowest bits all zero and dropped) BR instruction in slot 2. - /// - IMAGE_REL_IA64_PCREL60F = 0x0017, - - /// - /// A 60-bit PC-relative fixup. If the target displacement fits in a signed 25-bit field, - /// convert the entire bundle to an MIB bundle with NOP. I in slot 1 and a 25-bit - /// (4 lowest bits all zero and dropped) BR instruction in slot 2. - /// - IMAGE_REL_IA64_PCREL60I = 0x0018, - - /// - /// A 60-bit PC-relative fixup. If the target displacement fits in a signed 25-bit field, - /// convert the entire bundle to an MMB bundle with NOP. M in slot 1 and a 25-bit - /// (4 lowest bits all zero and dropped) BR instruction in slot 2. - /// - IMAGE_REL_IA64_PCREL60M = 0x0019, - - /// - /// A 64-bit GP-relative fixup. - /// - IMAGE_REL_IA64_IMMGPREL64 = 0x001a, - - /// - /// A CLR token. - /// - IMAGE_REL_IA64_TOKEN = 0x001b, - - /// - /// A 32-bit GP-relative fixup. - /// - IMAGE_REL_IA64_GPREL32 = 0x001c, - - /// - /// The relocation is valid only when it immediately follows one of the following relocations: - /// IMM14, IMM22, IMM64, GPREL22, LTOFF22, LTOFF64, SECREL22, SECREL64I, or SECREL32. - /// Its value contains the addend to apply to instructions within a bundle, not for data. - /// - IMAGE_REL_IA64_ADDEND = 0x001F, - - #endregion - - #region MIPS Processors - - /// - /// The relocation is ignored. - /// - IMAGE_REL_MIPS_ABSOLUTE = 0x0000, - - /// - /// The high 16 bits of the target's 32-bit VA. - /// - IMAGE_REL_MIPS_REFHALF = 0x0001, - - /// - /// The target's 32-bit VA. - /// - IMAGE_REL_MIPS_REFWORD = 0x0002, - - /// - /// The low 26 bits of the target's VA. This supports the MIPS J and JAL instructions. - /// - IMAGE_REL_MIPS_JMPADDR = 0x0003, - - /// - /// The high 16 bits of the target's 32-bit VA. This is used for the first instruction in a - /// two-instruction sequence that loads a full address. This relocation must be immediately - /// followed by a PAIR relocation whose SymbolTableIndex contains a signed 16-bit displacement - /// that is added to the upper 16 bits that are taken from the location that is being relocated. - /// - IMAGE_REL_MIPS_REFHI = 0x0004, - - /// - /// The low 16 bits of the target's VA. - /// - IMAGE_REL_MIPS_REFLO = 0x0005, - - /// - /// A 16-bit signed displacement of the target relative to the GP register. - /// - IMAGE_REL_MIPS_GPREL = 0x0006, - - /// - /// The same as IMAGE_REL_MIPS_GPREL. - /// - IMAGE_REL_MIPS_LITERAL = 0x0007, - - /// - /// The 16-bit section index of the section contains the target. - /// This is used to support debugging information. - /// - IMAGE_REL_MIPS_SECTION = 0x000A, - - /// - /// The 32-bit offset of the target from the beginning of its section. - /// This is used to support debugging information and static thread local storage. - /// - IMAGE_REL_MIPS_SECREL = 0x000B, - - /// - /// The low 16 bits of the 32-bit offset of the target from the beginning of its section. - /// - IMAGE_REL_MIPS_SECRELLO = 0x000C, - - /// - /// The high 16 bits of the 32-bit offset of the target from the beginning of its section. - /// An IMAGE_REL_MIPS_PAIR relocation must immediately follow this one. The SymbolTableIndex - /// of the PAIR relocation contains a signed 16-bit displacement that is added to the upper - /// 16 bits that are taken from the location that is being relocated. - /// - IMAGE_REL_MIPS_SECRELHI = 0x000D, - - /// - /// The low 26 bits of the target's VA. This supports the MIPS16 JAL instruction. - /// - IMAGE_REL_MIPS_JMPADDR16 = 0x0010, - - /// - /// The target's 32-bit RVA. - /// - IMAGE_REL_MIPS_REFWORDNB = 0x0022, - - /// - /// The relocation is valid only when it immediately follows a REFHI or SECRELHI relocation. - /// Its SymbolTableIndex contains a displacement and not an index into the symbol table. - /// - IMAGE_REL_MIPS_PAIR = 0x0025, - - #endregion - - #region Mitsubishi M32R - - /// - /// The relocation is ignored. - /// - IMAGE_REL_M32R_ABSOLUTE = 0x0000, - - /// - /// The target's 32-bit VA. - /// - IMAGE_REL_M32R_ADDR32 = 0x0001, - - /// - /// The target's 32-bit RVA. - /// - IMAGE_REL_M32R_ADDR32NB = 0x0002, - - /// - /// The target's 24-bit VA. - /// - IMAGE_REL_M32R_ADDR24 = 0x0003, - - /// - /// The target's 16-bit offset from the GP register. - /// - IMAGE_REL_M32R_GPREL16 = 0x0004, - - /// - /// The target's 24-bit offset from the program counter (PC), shifted left by - /// 2 bits and sign-extended - /// - IMAGE_REL_M32R_PCREL24 = 0x0005, - - /// - /// The target's 16-bit offset from the PC, shifted left by 2 bits and - /// sign-extended - /// - IMAGE_REL_M32R_PCREL16 = 0x0006, - - /// - /// The target's 8-bit offset from the PC, shifted left by 2 bits and - /// sign-extended - /// - IMAGE_REL_M32R_PCREL8 = 0x0007, - - /// - /// The 16 MSBs of the target VA. - /// - IMAGE_REL_M32R_REFHALF = 0x0008, - - /// - /// The 16 MSBs of the target VA, adjusted for LSB sign extension. This is used for - /// the first instruction in a two-instruction sequence that loads a full 32-bit address. - /// This relocation must be immediately followed by a PAIR relocation whose SymbolTableIndex - /// contains a signed 16-bit displacement that is added to the upper 16 bits that are - /// taken from the location that is being relocated. - /// - IMAGE_REL_M32R_REFHI = 0x0009, - - /// - /// The 16 LSBs of the target VA. - /// - IMAGE_REL_M32R_REFLO = 0x000A, - - /// - /// The relocation must follow the REFHI relocation.Its SymbolTableIndex contains a displacement - /// and not an index into the symbol table. - /// - IMAGE_REL_M32R_PAIR = 0x000B, - - /// - /// The 16-bit section index of the section that contains the target. This is used to support - /// debugging information. - /// - IMAGE_REL_M32R_SECTION = 0x000C, - - /// - /// The 32-bit offset of the target from the beginning of its section.This is used to support - /// debugging information and static thread local storage. - /// - IMAGE_REL_M32R_SECREL = 0x000D, - - /// - /// The CLR token. - /// - IMAGE_REL_M32R_TOKEN = 0x000E, - - #endregion - } - - public enum ResourceType : uint - { - RT_NEWRESOURCE = 0x2000, - RT_ERROR = 0x7FFF, - - /// - /// Hardware-dependent cursor resource. - /// - RT_CURSOR = 1, - - /// - /// Bitmap resource. - /// - RT_BITMAP = 2, - - /// - /// Hardware-dependent icon resource. - /// - RT_ICON = 3, - - /// - /// Menu resource. - /// - RT_MENU = 4, - - /// - /// Dialog box. - /// - RT_DIALOG = 5, - - /// - /// String-table entry. - /// - RT_STRING = 6, - - /// - /// Font directory resource. - /// - RT_FONTDIR = 7, - - /// - /// Font resource. - /// - RT_FONT = 8, - - /// - /// Accelerator table. - /// - RT_ACCELERATOR = 9, - - /// - /// Application-defined resource (raw data). - /// - RT_RCDATA = 10, - - /// - /// Message-table entry. - /// - RT_MESSAGETABLE = 11, - - /// - /// Hardware-independent cursor resource. - /// - RT_GROUP_CURSOR = RT_CURSOR + 11, - - /// - /// Hardware-independent icon resource. - /// - RT_GROUP_ICON = RT_ICON + 11, - - /// - /// Version resource. - /// - RT_VERSION = 16, - - /// - /// Allows a resource editing tool to associate a string with an .rc file. - /// Typically, the string is the name of the header file that provides symbolic - /// names. The resource compiler parses the string but otherwise ignores the - /// value. For example, `1 DLGINCLUDE "MyFile.h"` - /// - RT_DLGINCLUDE = 17, - - /// - /// Plug and Play resource. - /// - RT_PLUGPLAY = 19, - - /// - /// VXD. - /// - RT_VXD = 20, - - /// - /// Animated cursor. - /// - RT_ANICURSOR = 21, - - /// - /// Animated icon. - /// - RT_ANIICON = 22, - - /// - /// HTML resource. - /// - RT_HTML = 23, - - /// - /// Side-by-Side Assembly Manifest. - /// - RT_MANIFEST = 24, - - RT_NEWBITMAP = (RT_BITMAP | RT_NEWRESOURCE), - RT_NEWMENU = (RT_MENU | RT_NEWRESOURCE), - RT_NEWDIALOG = (RT_DIALOG | RT_NEWRESOURCE), - } - - [Flags] - public enum SectionFlags : uint - { - /// - /// Reserved for future use. - /// - RESERVED0 = 0x00000001, - - /// - /// Reserved for future use. - /// - RESERVED1 = 0x00000002, - - /// - /// Reserved for future use. - /// - RESERVED2 = 0x00000004, - - /// - /// The section should not be padded to the next boundary. - /// This flag is obsolete and is replaced by IMAGE_SCN_ALIGN_1BYTES. - /// This is valid only for object files. - /// - IMAGE_SCN_TYPE_NO_PAD = 0x00000008, - - /// - /// Reserved for future use. - /// - RESERVED4 = 0x00000010, - - /// - /// The section contains executable code. - /// - IMAGE_SCN_CNT_CODE = 0x00000020, - - /// - /// The section contains initialized data. - /// - IMAGE_SCN_CNT_INITIALIZED_DATA = 0x00000040, - - /// - /// The section contains uninitialized data. - /// - IMAGE_SCN_CNT_UNINITIALIZED_DATA = 0x00000080, - - /// - /// Reserved for future use. - /// - IMAGE_SCN_LNK_OTHER = 0x00000100, - - /// - /// The section contains comments or other information. The .drectve - /// section has this type. This is valid for object files only. - /// - IMAGE_SCN_LNK_INFO = 0x00000200, - - /// - /// Reserved for future use. - /// - RESERVED10 = 0x00000400, - - /// - /// The section will not become part of the image. This is valid - /// only for object files. - /// - IMAGE_SCN_LNK_REMOVE = 0x00000800, - - /// - /// The section contains COMDAT data. For more information, see COMDAT Sections - /// (Object Only). This is valid only for object files. - /// - IMAGE_SCN_LNK_COMDAT = 0x00001000, - - /// - /// The section contains data referenced through the global pointer (GP). - /// - IMAGE_SCN_GPREL = 0x00008000, - - /// - /// Reserved for future use. - /// - IMAGE_SCN_MEM_PURGEABLE = 0x00010000, - - /// - /// Reserved for future use. - /// - IMAGE_SCN_MEM_16BIT = 0x00020000, - - /// - /// Reserved for future use. - /// - IMAGE_SCN_MEM_LOCKED = 0x00040000, - - /// - /// Reserved for future use. - /// - IMAGE_SCN_MEM_PRELOAD = 0x00080000, - - /// - /// Align data on a 1-byte boundary. Valid only for object files. - /// - IMAGE_SCN_ALIGN_1BYTES = 0x00100000, - - /// - /// Align data on a 2-byte boundary. Valid only for object files. - /// - IMAGE_SCN_ALIGN_2BYTES = 0x00200000, - - /// - /// Align data on a 4-byte boundary. Valid only for object files. - /// - IMAGE_SCN_ALIGN_4BYTES = 0x00300000, - - /// - /// Align data on an 8-byte boundary. Valid only for object files. - /// - IMAGE_SCN_ALIGN_8BYTES = 0x00400000, - - /// - /// Align data on a 16-byte boundary. Valid only for object files. - /// - IMAGE_SCN_ALIGN_16BYTES = 0x00500000, - - /// - /// Align data on a 32-byte boundary. Valid only for object files. - /// - IMAGE_SCN_ALIGN_32BYTES = 0x00600000, - - /// - /// Align data on a 64-byte boundary. Valid only for object files. - /// - IMAGE_SCN_ALIGN_64BYTES = 0x00700000, - - /// - /// Align data on a 128-byte boundary. Valid only for object files. - /// - IMAGE_SCN_ALIGN_128BYTES = 0x00800000, - - /// - /// Align data on a 256-byte boundary. Valid only for object files. - /// - IMAGE_SCN_ALIGN_256BYTES = 0x00900000, - - /// - /// Align data on a 512-byte boundary. Valid only for object files. - /// - IMAGE_SCN_ALIGN_512BYTES = 0x00A00000, - - /// - /// Align data on a 1024-byte boundary. Valid only for object files. - /// - IMAGE_SCN_ALIGN_1024BYTES = 0x00B00000, - - /// - /// Align data on a 2048-byte boundary. Valid only for object files. - /// - IMAGE_SCN_ALIGN_2048BYTES = 0x00C00000, - - /// - /// Align data on a 4096-byte boundary. Valid only for object files. - /// - IMAGE_SCN_ALIGN_4096BYTES = 0x00D00000, - - /// - /// Align data on an 8192-byte boundary. Valid only for object files. - /// - IMAGE_SCN_ALIGN_8192BYTES = 0x00E00000, - - /// - /// The section contains extended relocations. - /// - IMAGE_SCN_LNK_NRELOC_OVFL = 0x01000000, - - /// - /// The section can be discarded as needed. - /// - IMAGE_SCN_MEM_DISCARDABLE = 0x02000000, - - /// - /// The section cannot be cached. - /// - IMAGE_SCN_MEM_NOT_CACHED = 0x04000000, - - /// - /// The section is not pageable. - /// - IMAGE_SCN_MEM_NOT_PAGED = 0x08000000, - - /// - /// The section can be shared in memory. - /// - IMAGE_SCN_MEM_SHARED = 0x10000000, - - /// - /// The section can be executed as code. - /// - IMAGE_SCN_MEM_EXECUTE = 0x20000000, - - /// - /// The section can be read. - /// - IMAGE_SCN_MEM_READ = 0x40000000, - - /// - /// The section can be written to. - /// - IMAGE_SCN_MEM_WRITE = 0x80000000, - } - - public enum SectionNumber - { - /// - /// The symbol record is not yet assigned a section. A value of - /// zero indicates that a reference to an external symbol is - /// defined elsewhere. A value of non-zero is a common symbol - /// with a size that is specified by the value. - /// - IMAGE_SYM_UNDEFINED = 0, - - /// - /// The symbol has an absolute (non-relocatable) value and - /// is not an address. - /// - IMAGE_SYM_ABSOLUTE = -1, - - /// - /// The symbol provides general type or debugging information - /// but does not correspond to a section. Microsoft tools use - /// this setting along with .file records (storage class FILE). - /// - IMAGE_SYM_DEBUG = -2, - } - - public enum StorageClass : byte - { - /// - /// A special symbol that represents the end of function, for debugging purposes. - /// - IMAGE_SYM_CLASS_END_OF_FUNCTION = 0xFF, - - /// - /// No assigned storage class. - /// - IMAGE_SYM_CLASS_NULL = 0x00, - - /// - /// The automatic (stack) variable.The Value field specifies the stack frame offset. - /// - IMAGE_SYM_CLASS_AUTOMATIC = 0x01, - - /// - /// A value that Microsoft tools use for external symbols. The Value field indicates - /// the size if the section number is IMAGE_SYM_UNDEFINED (0). If the section number - /// is not zero, then the Value field specifies the offset within the section. - /// - IMAGE_SYM_CLASS_EXTERNAL = 0x02, - - /// - /// The offset of the symbol within the section. If the Value field is zero, then - /// the symbol represents a section name. - /// - IMAGE_SYM_CLASS_STATIC = 0x03, - - /// - /// A register variable.The Value field specifies the register number. - /// - IMAGE_SYM_CLASS_REGISTER = 0x04, - - /// - /// A symbol that is defined externally. - /// - IMAGE_SYM_CLASS_EXTERNAL_DEF = 0x05, - - /// - /// A code label that is defined within the module. The Value field specifies the - /// offset of the symbol within the section. - /// - IMAGE_SYM_CLASS_LABEL = 0x06, - - /// - /// A reference to a code label that is not defined. - /// - IMAGE_SYM_CLASS_UNDEFINED_LABEL = 0x07, - - /// - /// The structure member. The Value field specifies the n th member. - /// - IMAGE_SYM_CLASS_MEMBER_OF_STRUCT = 0x08, - - /// - /// A formal argument (parameter) of a function. The Value field specifies the - /// n th argument. - /// - IMAGE_SYM_CLASS_ARGUMENT = 0x09, - - /// - /// The structure tag-name entry. - /// - IMAGE_SYM_CLASS_STRUCT_TAG = 0x0A, - - /// - /// A union member. The Value field specifies the n th member. - /// - IMAGE_SYM_CLASS_MEMBER_OF_UNION = 0x0B, - - /// - /// The Union tag-name entry. - /// - IMAGE_SYM_CLASS_UNION_TAG = 0x0C, - - /// - /// A Typedef entry. - /// - IMAGE_SYM_CLASS_TYPE_DEFINITION = 0x0D, - - /// - /// A static data declaration. - /// - IMAGE_SYM_CLASS_UNDEFINED_STATIC = 0x0E, - - /// - /// An enumerated type tagname entry. - /// - IMAGE_SYM_CLASS_ENUM_TAG = 0x0F, - - /// - /// A member of an enumeration. The Value field specifies the - /// n th member. - /// - IMAGE_SYM_CLASS_MEMBER_OF_ENUM = 0x10, - - /// - /// A register parameter. - /// - IMAGE_SYM_CLASS_REGISTER_PARAM = 0x11, - - /// - /// A bit-field reference. The Value field specifies the - /// n th bit in the bit field. - /// - IMAGE_SYM_CLASS_BIT_FIELD = 0x12, - - /// - /// A .bb (beginning of block) or .eb (end of block) record. - /// The Value field is the relocatable address of the code location. - /// - IMAGE_SYM_CLASS_BLOCK = 0x64, - - /// - /// A value that Microsoft tools use for symbol records that define the extent - /// of a function: begin function (.bf ), end function (.ef), and lines in - /// function (.lf). For .lf records, the Value field gives the number of source - /// lines in the function. For .ef records, the Value field gives the size of - /// the function code. - /// - IMAGE_SYM_CLASS_FUNCTION = 0x65, - - /// - /// An end-of-structure entry. - /// - IMAGE_SYM_CLASS_END_OF_STRUCT = 0x66, - - /// - /// A value that Microsoft tools, as well as traditional COFF format, use for the - /// source-file symbol record. The symbol is followed by auxiliary records that - /// name the file. - /// - IMAGE_SYM_CLASS_FILE = 0x67, - - /// - /// A definition of a section (Microsoft tools use STATIC storage class instead). - /// - IMAGE_SYM_CLASS_SECTION = 0x68, - - /// - /// A weak external.For more information, see Auxiliary Format 3: Weak Externals. - /// - IMAGE_SYM_CLASS_WEAK_EXTERNAL = 0x69, - - /// - /// A CLR token symbol. The name is an ASCII string that consists of the hexadecimal - /// value of the token. For more information, see CLR Token Definition (Object Only). - /// - IMAGE_SYM_CLASS_CLR_TOKEN = 0x6A, - } - - public enum SymbolType : ushort - { - /// - /// No type information or unknown base type. Microsoft tools use this setting - /// - IMAGE_SYM_TYPE_NULL = 0x00, - - /// - /// No valid type; used with void pointers and functions - /// - IMAGE_SYM_TYPE_VOID = 0x01, - - /// - /// A character (signed byte) - /// - IMAGE_SYM_TYPE_CHAR = 0x02, - - /// - /// A 2-byte signed integer - /// - IMAGE_SYM_TYPE_SHORT = 0x03, - - /// - /// A natural integer type (normally 4 bytes in Windows) - /// - IMAGE_SYM_TYPE_INT = 0x04, - - /// - /// A 4-byte signed integer - /// - IMAGE_SYM_TYPE_LONG = 0x05, - - /// - /// A 4-byte floating-point number - /// - IMAGE_SYM_TYPE_FLOAT = 0x06, - - /// - /// An 8-byte floating-point number - /// - IMAGE_SYM_TYPE_DOUBLE = 0x07, - - /// - /// A structure - /// - IMAGE_SYM_TYPE_STRUCT = 0x08, - - /// - /// A union - /// - IMAGE_SYM_TYPE_UNION = 0x09, - - /// - /// An enumerated type - /// - IMAGE_SYM_TYPE_ENUM = 0x0A, - - /// - /// A member of enumeration (a specific value) - /// - IMAGE_SYM_TYPE_MOE = 0x0B, - - /// - /// A byte; unsigned 1-byte integer - /// - IMAGE_SYM_TYPE_BYTE = 0x0C, - - /// - /// A word; unsigned 2-byte integer - /// - IMAGE_SYM_TYPE_WORD = 0x0D, - - /// - /// An unsigned integer of natural size (normally, 4 bytes) - /// - IMAGE_SYM_TYPE_UINT = 0x0E, - - /// - /// An unsigned 4-byte integer - /// - IMAGE_SYM_TYPE_DWORD = 0x0F, - - /// - /// A function pointer - /// - IMAGE_SYM_TYPE_FUNC = 0x20, - } - - public enum SymbolDerivedType : byte - { - /// - /// No derived type; the symbol is a simple scalar variable. - /// - IMAGE_SYM_DTYPE_NULL = 0x00, - - /// - /// The symbol is a pointer to base type. - /// - IMAGE_SYM_DTYPE_POINTER = 0x01, - - /// - /// The symbol is a function that returns a base type. - /// - IMAGE_SYM_DTYPE_FUNCTION = 0x02, - - /// - /// The symbol is an array of base type. - /// - IMAGE_SYM_DTYPE_ARRAY = 0x03, - } - - public enum VersionResourceType : ushort - { - BinaryData = 0, - TextData = 1, - } - - [Flags] - public enum WindowStyles : uint - { - #region Standard Styles - - /// - /// The window is an overlapped window. An overlapped window has a title - /// bar and a border. Same as the WS_TILED style. - /// - WS_OVERLAPPED = 0x00000000, - - /// - /// The window is an overlapped window. An overlapped window has a title bar - /// and a border. Same as the WS_OVERLAPPED style. - /// - WS_TILED = 0x00000000, - - /// - /// The window has a maximize button. Cannot be combined with the - /// WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified. - /// - WS_MAXIMIZEBOX = 0x00010000, - - /// - /// The window is a control that can receive the keyboard focus when the user - /// presses the TAB key. Pressing the TAB key changes the keyboard focus to - /// the next control with the WS_TABSTOP style. - /// - /// You can turn this style on and off to change dialog box navigation. To - /// change this style after a window has been created, use the SetWindowLong - /// function. For user-created windows and modeless dialogs to work with tab - /// stops, alter the message loop to call the IsDialogMessage function. - /// - WS_TABSTOP = 0x00010000, - - /// - /// The window has a minimize button. Cannot be combined with the - /// WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified. - /// - WS_MINIMIZEBOX = 0x00020000, - - /// - /// The window is the first control of a group of controls. The group consists - /// of this first control and all controls defined after it, up to the next - /// control with the WS_GROUP style. The first control in each group usually - /// has the WS_TABSTOP style so that the user can move from group to group. - /// The user can subsequently change the keyboard focus from one control in - /// the group to the next control in the group by using the direction keys. - /// - /// You can turn this style on and off to change dialog box navigation. To - /// change this style after a window has been created, use the SetWindowLong - /// function. - /// - WS_GROUP = 0x00020000, - - /// - /// The window has a sizing border. Same as the WS_THICKFRAME style. - /// - WS_SIZEBOX = 0x00040000, - - /// - /// The window has a sizing border. Same as the WS_SIZEBOX style. - /// - WS_THICKFRAME = 0x00040000, - - /// - /// The window has a window menu on its title bar. The WS_CAPTION style must - /// also be specified. - /// - WS_SYSMENU = 0x00080000, - - /// - /// The window has a horizontal scroll bar. - /// - WS_HSCROLL = 0x00100000, - - /// - /// The window has a vertical scroll bar. - /// - WS_VSCROLL = 0x00200000, - - /// - /// The window has a border of a style typically used with dialog boxes. A - /// window with this style cannot have a title bar. - /// - WS_DLGFRAME = 0x00400000, - - /// - /// The window has a thin-line border - /// - WS_BORDER = 0x00800000, - - /// - /// The window has a title bar - /// - WS_CAPTION = 0x00C00000, - - /// - /// The window is initially maximized. - /// - WS_MAXIMIZE = 0x01000000, - - /// - /// Excludes the area occupied by child windows when drawing occurs within the - /// parent window. This style is used when creating the parent window. - /// - WS_CLIPCHILDREN = 0x02000000, - - /// - /// Clips child windows relative to each other; that is, when a particular child - /// window receives a WM_PAINT message, the WS_CLIPSIBLINGS style clips all other - /// overlapping child windows out of the region of the child window to be updated. - /// If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, - /// when drawing within the client area of a child window, to draw within the - /// client area of a neighboring child window. - /// - WS_CLIPSIBLINGS = 0x04000000, - - /// - /// The window is initially disabled. A disabled window cannot receive input from - /// the user. To change this after a window has been created, use the EnableWindow - /// function. - /// - WS_DISABLED = 0x08000000, - - /// - /// The window is initially visible. - /// This style can be turned on and off by using the ShowWindow or SetWindowPos - /// function. - /// - WS_VISIBLE = 0x10000000, - - /// - /// The window is initially minimized. Same as the WS_MINIMIZE style. - /// - WS_ICONIC = 0x20000000, - - /// - /// The window is initially minimized. Same as the WS_ICONIC style. - /// - WS_MINIMIZE = 0x20000000, - - /// - /// The window is a child window. A window with this style cannot have a menu - /// bar. This style cannot be used with the WS_POPUP style. - /// - WS_CHILD = 0x40000000, - - /// - /// Same as the WS_CHILD style. - /// - WS_CHILDWINDOW = 0x40000000, - - /// - /// The window is a pop-up window. This style cannot be used with the WS_CHILD style. - /// - WS_POPUP = 0x80000000, - - /// - /// The window is an overlapped window. Same as the WS_TILEDWINDOW style. - /// - WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, - - /// - /// The window is a pop-up window. The WS_CAPTION and WS_POPUPWINDOW styles must be - /// combined to make the window menu visible. - /// - WS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENU, - - /// - /// The window is an overlapped window. Same as the WS_OVERLAPPEDWINDOW style. - /// - WS_TILEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, - - #endregion - - #region Common Control Styles - - /// - /// Causes the control to position itself at the top of the parent window's - /// client area and sets the width to be the same as the parent window's width. - /// Toolbars have this style by default. - /// - CCS_TOP = 0x00000001, - - /// - /// Causes the control to resize and move itself horizontally, but not vertically, - /// in response to a WM_SIZE message. If CCS_NORESIZE is used, this style does not - /// apply. Header windows have this style by default. - /// - CCS_NOMOVEY = 0x00000002, - - /// - /// Causes the control to position itself at the bottom of the parent window's - /// client area and sets the width to be the same as the parent window's width. - /// Status windows have this style by default. - /// - CCS_BOTTOM = 0x00000003, - - /// - /// Prevents the control from using the default width and height when setting its - /// initial size or a new size. Instead, the control uses the width and height - /// specified in the request for creation or sizing. - /// - CCS_NORESIZE = 0x00000004, - - /// - /// Prevents the control from automatically moving to the top or bottom of the parent - /// window. Instead, the control keeps its position within the parent window despite - /// changes to the size of the parent. If CCS_TOP or CCS_BOTTOM is also used, the - /// height is adjusted to the default, but the position and width remain unchanged. - /// - CCS_NOPARENTALIGN = 0x00000008, - - /// - /// Enables a toolbar's built-in customization features, which let the user to drag a - /// button to a new position or to remove a button by dragging it off the toolbar. - /// In addition, the user can double-click the toolbar to display the Customize Toolbar - /// dialog box, which enables the user to add, delete, and rearrange toolbar buttons. - /// - CCS_ADJUSTABLE = 0x00000020, - - /// - /// Prevents a two-pixel highlight from being drawn at the top of the control. - /// - CCS_NODIVIDER = 0x00000040, - - /// - /// Version 4.70. Causes the control to be displayed vertically. - /// - CCS_VERT = 0x00000080, - - /// - /// Version 4.70. Causes the control to be displayed vertically on the left side of the - /// parent window. - /// - CCS_LEFT = CCS_VERT | CCS_TOP, - - /// - /// Version 4.70. Causes the control to be displayed vertically on the right side of the - /// parent window. - /// - CCS_RIGHT = CCS_VERT | CCS_BOTTOM, - - /// - /// Version 4.70. Causes the control to resize and move itself vertically, but not - /// horizontally, in response to a WM_SIZE message. If CCS_NORESIZE is used, this style - /// does not apply. - /// - CCS_NOMOVEX = CCS_VERT | CCS_NOMOVEY, - - #endregion - - #region Dialog Box Styles - - /// - /// Indicates that the coordinates of the dialog box are screen coordinates. - /// If this style is not specified, the coordinates are client coordinates. - /// - DS_ABSALIGN = 0x00000001, - - /// - /// This style is obsolete and is included for compatibility with 16-bit versions - /// of Windows. If you specify this style, the system creates the dialog box with - /// the WS_EX_TOPMOST style. This style does not prevent the user from accessing - /// other windows on the desktop. - /// - /// Do not combine this style with the DS_CONTROL style. - /// - DS_SYSMODAL = 0x00000002, - - /// - /// Obsolete. The system automatically applies the three-dimensional look to dialog - /// boxes created by applications. - /// - DS_3DLOOK = 0x00000004, - - /// - /// Causes the dialog box to use the SYSTEM_FIXED_FONT instead of the default - /// SYSTEM_FONT. This is a monospace font compatible with the System font in 16-bit - /// versions of Windows earlier than 3.0. - /// - DS_FIXEDSYS = 0x00000008, - - /// - /// Creates the dialog box even if errors occur for example, if a child window cannot - /// be created or if the system cannot create a special data segment for an edit control. - /// - DS_NOFAILCREATE = 0x00000010, - - /// - /// Applies to 16-bit applications only. This style directs edit controls in the - /// dialog box to allocate memory from the application's data segment. Otherwise, - /// edit controls allocate storage from a global memory object. - /// - DS_LOCALEDIT = 0x00000020, - - /// - /// Indicates that the header of the dialog box template (either standard or extended) - /// contains additional data specifying the font to use for text in the client area - /// and controls of the dialog box. If possible, the system selects a font according - /// to the specified font data. The system passes a handle to the font to the dialog - /// box and to each control by sending them the WM_SETFONT message. For descriptions - /// of the format of this font data, see DLGTEMPLATE and DLGTEMPLATEEX. - /// - /// If neither DS_SETFONT nor DS_SHELLFONT is specified, the dialog box template does - /// not include the font data. - /// - DS_SETFONT = 0x00000040, - - /// - /// Creates a dialog box with a modal dialog-box frame that can be combined with a - /// title bar and window menu by specifying the WS_CAPTION and WS_SYSMENU styles. - /// - DS_MODALFRAME = 0x00000080, - - /// - /// Suppresses WM_ENTERIDLE messages that the system would otherwise send to the owner - /// of the dialog box while the dialog box is displayed. - /// - DS_NOIDLEMSG = 0x00000100, - - /// - /// Causes the system to use the SetForegroundWindow function to bring the dialog box - /// to the foreground. This style is useful for modal dialog boxes that require immediate - /// attention from the user regardless of whether the owner window is the foreground - /// window. - /// - /// The system restricts which processes can set the foreground window. For more - /// information, see Foreground and Background Windows. - /// - DS_SETFOREGROUND = 0x00000200, - - /// - /// Creates a dialog box that works well as a child window of another dialog box, much like - /// a page in a property sheet. This style allows the user to tab among the control windows - /// of a child dialog box, use its accelerator keys, and so on. - /// - DS_CONTROL = 0x00000400, - - /// - /// Centers the dialog box in the working area of the monitor that contains the owner window. - /// If no owner window is specified, the dialog box is centered in the working area of a - /// monitor determined by the system. The working area is the area not obscured by the taskbar - /// or any appbars. - /// - DS_CENTER = 0x00000800, - - /// - /// Centers the dialog box on the mouse cursor. - /// - DS_CENTERMOUSE = 0x00001000, - - /// - /// Includes a question mark in the title bar of the dialog box. When the user clicks the - /// question mark, the cursor changes to a question mark with a pointer. If the user then clicks - /// a control in the dialog box, the control receives a WM_HELP message. The control should pass - /// the message to the dialog box procedure, which should call the function using the - /// HELP_WM_HELP command. The help application displays a pop-up window that typically contains - /// help for the control. - /// - /// Note that DS_CONTEXTHELP is only a placeholder. When the dialog box is created, the system - /// checks for DS_CONTEXTHELP and, if it is there, adds WS_EX_CONTEXTHELP to the extended style - /// of the dialog box. WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX - /// styles. - /// - DS_CONTEXTHELP = 0x00002000, - - /// - /// Windows CE Version 5.0 and later - /// - DS_USEPIXELS = 0x00008000, - - /// - /// Indicates that the dialog box should use the system font. The typeface member of the extended - /// dialog box template must be set to MS Shell Dlg. Otherwise, this style has no effect. It is - /// also recommended that you use the DIALOGEX Resource, rather than the DIALOG Resource. For - /// more information, see Dialog Box Fonts. - /// - /// The system selects a font using the font data specified in the pointsize, weight, and italic - /// members. The system passes a handle to the font to the dialog box and to each control by - /// sending them the WM_SETFONT message. For descriptions of the format of this font data, see - /// DLGTEMPLATEEX. - /// - /// If neither DS_SHELLFONT nor DS_SETFONT is specified, the extended dialog box template does - /// not include the font data. - /// - DS_SHELLFONT = DS_SETFONT | DS_FIXEDSYS, - - #endregion - } - - public enum WindowsCertificateRevision : ushort - { - /// - /// Version 1, legacy version of the Win_Certificate structure. It is supported - /// only for purposes of verifying legacy Authenticode signatures - /// - WIN_CERT_REVISION_1_0 = 0x0100, - - /// - /// Version 2 is the current version of the Win_Certificate structure. - /// - WIN_CERT_REVISION_2_0 = 0x0200, - } - - public enum WindowsCertificateType : ushort - { - /// - /// bCertificate contains an X.509 Certificate - /// - /// - /// Not Supported - /// - WIN_CERT_TYPE_X509 = 0x0001, - - /// - /// bCertificate contains a PKCS#7 SignedData structure - /// - WIN_CERT_TYPE_PKCS_SIGNED_DATA = 0x0002, - - /// - /// Reserved - /// - WIN_CERT_TYPE_RESERVED_1 = 0x0003, - - /// - /// Terminal Server Protocol Stack Certificate signing - /// - /// - /// Not Supported - /// - WIN_CERT_TYPE_TS_STACK_SIGNED = 0x0004, - } - - public enum WindowsSubsystem : ushort - { - /// - /// An unknown subsystem - /// - IMAGE_SUBSYSTEM_UNKNOWN = 0x0000, - - /// - /// Device drivers and native Windows processes - /// - IMAGE_SUBSYSTEM_NATIVE = 0x0001, - - /// - /// The Windows graphical user interface (GUI) subsystem - /// - IMAGE_SUBSYSTEM_WINDOWS_GUI = 0x0002, - - /// - /// The Windows character subsystem - /// - IMAGE_SUBSYSTEM_WINDOWS_CUI = 0x0003, - - /// - /// The OS/2 character subsystem - /// - IMAGE_SUBSYSTEM_OS2_CUI = 0x0005, - - /// - /// The Posix character subsystem - /// - IMAGE_SUBSYSTEM_POSIX_CUI = 0x0007, - - /// - /// Native Win9x driver - /// - IMAGE_SUBSYSTEM_NATIVE_WINDOWS = 0x0008, - - /// - /// Windows CE - /// - IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 0x0009, - - /// - /// An Extensible Firmware Interface (EFI) application - /// - IMAGE_SUBSYSTEM_EFI_APPLICATION = 0x000A, - - /// - /// An EFI driver with boot services - /// - IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 0x000B, - - /// - /// An EFI driver with run-time services - /// - IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 0x000C, - - /// - /// An EFI ROM image - /// - IMAGE_SUBSYSTEM_EFI_ROM = 0x000D, - - /// - /// XBOX - /// - IMAGE_SUBSYSTEM_XBOX = 0x000E, - - /// - /// Windows boot application. - /// - IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 0x0010, - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/Executable.cs b/BinaryObjectScanner.Models/PortableExecutable/Executable.cs deleted file mode 100644 index 5ea9d54a..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/Executable.cs +++ /dev/null @@ -1,139 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The following list describes the Microsoft PE executable format, with the - /// base of the image header at the top. The section from the MS-DOS 2.0 - /// Compatible EXE Header through to the unused section just before the PE header - /// is the MS-DOS 2.0 Section, and is used for MS-DOS compatibility only. - /// - /// - public sealed class Executable - { - /// - /// MS-DOS executable stub - /// - public MSDOS.Executable Stub { get; set; } - - /// - /// After the MS-DOS stub, at the file offset specified at offset 0x3c, is a 4-byte - /// signature that identifies the file as a PE format image file. This signature is "PE\0\0" - /// (the letters "P" and "E" followed by two null bytes). - /// - public string Signature { get; set; } - - /// - /// COFF file header - /// - public COFFFileHeader COFFFileHeader { get; set; } - - /// - /// Optional header - /// - public OptionalHeader OptionalHeader { get; set; } - - // TODO: Support grouped sections in section reading and parsing - // https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#grouped-sections-object-only - // Grouped sections are ordered and mean that the data in the sections contributes - // to the "base" section (the one without the "$X" suffix). This may negatively impact - // the use of some of the different types of executables. - - /// - /// Section table - /// - public SectionHeader[] SectionTable { get; set; } - - /// - /// COFF symbol table - /// - public COFFSymbolTableEntry[] COFFSymbolTable { get; set; } - - /// - /// COFF string table - /// - public COFFStringTable COFFStringTable { get; set; } - - /// - /// Attribute certificate table - /// - public AttributeCertificateTableEntry[] AttributeCertificateTable { get; set; } - - /// - /// Delay-load directory table - /// - public DelayLoadDirectoryTable DelayLoadDirectoryTable { get; set; } - - #region Named Sections - - // .cormeta - CLR metadata is stored in this section. It is used to indicate that - // the object file contains managed code. The format of the metadata is not - // documented, but can be handed to the CLR interfaces for handling metadata. - - /// - /// Base relocation table (.reloc) - /// - public BaseRelocationBlock[] BaseRelocationTable { get; set; } - - /// - /// Debug table (.debug*) - /// - public DebugTable DebugTable { get; set; } - - // .drectve - A section is a directive section if it has the IMAGE_SCN_LNK_INFO - // flag set in the section header and has the .drectve section name. The linker - // removes a .drectve section after processing the information, so the section - // does not appear in the image file that is being linked. - // - // A .drectve section consists of a string of text that can be encoded as ANSI - // or UTF-8. If the UTF-8 byte order marker (BOM, a three-byte prefix that - // consists of 0xEF, 0xBB, and 0xBF) is not present, the directive string is - // interpreted as ANSI. The directive string is a series of linker options that - // are separated by spaces. Each option contains a hyphen, the option name, and - // any appropriate attribute. If an option contains spaces, the option must be - // enclosed in quotes. The .drectve section must not have relocations or line - // numbers. - // - // TODO: Can we implement reading/parsing the .drectve section? - - /// - /// Export table (.edata) - /// - public ExportTable ExportTable { get; set; } - - /// - /// Import table (.idata) - /// - public ImportTable ImportTable { get; set; } - - /// - /// Resource directory table (.rsrc) - /// - public ResourceDirectoryTable ResourceDirectoryTable { get; set; } - - // .sxdata - The valid exception handlers of an object are listed in the .sxdata - // section of that object. The section is marked IMAGE_SCN_LNK_INFO. It contains - // the COFF symbol index of each valid handler, using 4 bytes per index. - // - // Additionally, the compiler marks a COFF object as registered SEH by emitting - // the absolute symbol "@feat.00" with the LSB of the value field set to 1. A - // COFF object with no registered SEH handlers would have the "@feat.00" symbol, - // but no .sxdata section. - // - // TODO: Can we implement reading/parsing the .sxdata section? - - #endregion - - // TODO: Implement and/or document the following non-modeled parts: - // - Delay-Load Import Tables - // - [The Delay-Load Directory Table] - // - Delay Import Address Table - // - Delay Import Name Table - // - Delay Bound Import Address Table - // - Delay Unload Import Address Table - // - The .pdata Section [Multiple formats per entry] - // - The .tls Section - // - TLS Callback Functions - // - [The Load Configuration Structure (Image Only)] - - // TODO: Determine if "Archive (Library) File Format" is worth modelling - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/ExportAddressTableEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/ExportAddressTableEntry.cs deleted file mode 100644 index 6febd4ed..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/ExportAddressTableEntry.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The export address table contains the address of exported entry points - /// and exported data and absolutes. An ordinal number is used as an index - /// into the export address table. - /// - /// Each entry in the export address table is a field that uses one of two - /// formats in the following table. If the address specified is not within - /// the export section (as defined by the address and length that are - /// indicated in the optional header), the field is an export RVA, which is - /// an actual address in code or data. Otherwise, the field is a forwarder RVA, - /// which names a symbol in another DLL. - /// - /// - [StructLayout(LayoutKind.Explicit)] - public sealed class ExportAddressTableEntry - { - /// - /// The address of the exported symbol when loaded into memory, relative to - /// the image base. For example, the address of an exported function. - /// - [FieldOffset(0)] public uint ExportRVA; - - /// - /// The pointer to a null-terminated ASCII string in the export section. This - /// string must be within the range that is given by the export table data - /// directory entry. See Optional Header Data Directories (Image Only). This - /// string gives the DLL name and the name of the export (for example, - /// "MYDLL.expfunc") or the DLL name and the ordinal number of the export - /// (for example, "MYDLL.#27"). - /// - [FieldOffset(0)] public uint ForwarderRVA; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/ExportDirectoryTable.cs b/BinaryObjectScanner.Models/PortableExecutable/ExportDirectoryTable.cs deleted file mode 100644 index 08d0a059..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/ExportDirectoryTable.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The export symbol information begins with the export directory table, - /// which describes the remainder of the export symbol information. The - /// export directory table contains address information that is used to resolve - /// imports to the entry points within this image. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ExportDirectoryTable - { - /// - /// Reserved, must be 0. - /// - public uint ExportFlags; - - /// - /// The time and date that the export data was created. - /// - public uint TimeDateStamp; - - /// - /// The major version number. The major and minor version numbers can be set - /// by the user. - /// - public ushort MajorVersion; - - /// - /// The minor version number. - /// - public ushort MinorVersion; - - /// - /// The address of the ASCII string that contains the name of the DLL. This - /// address is relative to the image base. - /// - public uint NameRVA; - - /// - /// ASCII string that contains the name of the DLL. - /// - public string Name; - - /// - /// The starting ordinal number for exports in this image. This field specifies - /// the starting ordinal number for the export address table. It is usually set - /// to 1. - /// - public uint OrdinalBase; - - /// - /// The number of entries in the export address table. - /// - public uint AddressTableEntries; - - /// - /// The number of entries in the name pointer table. This is also the number of - /// entries in the ordinal table. - /// - public uint NumberOfNamePointers; - - /// - /// The address of the export address table, relative to the image base. - /// - public uint ExportAddressTableRVA; - - /// - /// The address of the export name pointer table, relative to the image base. - /// The table size is given by the Number of Name Pointers field. - /// - public uint NamePointerRVA; - - /// - /// The address of the ordinal table, relative to the image base. - /// - public uint OrdinalTableRVA; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/ExportNamePointerTable.cs b/BinaryObjectScanner.Models/PortableExecutable/ExportNamePointerTable.cs deleted file mode 100644 index 2f1ae585..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/ExportNamePointerTable.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The export name pointer table is an array of addresses (RVAs) into the export name table. - /// The pointers are 32 bits each and are relative to the image base. The pointers are ordered - /// lexically to allow binary searches. - /// - /// An export name is defined only if the export name pointer table contains a pointer to it. - /// - /// - public sealed class ExportNamePointerTable - { - /// - /// The pointers are 32 bits each and are relative to the image base. - /// - public uint[] Pointers; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/ExportNameTable.cs b/BinaryObjectScanner.Models/PortableExecutable/ExportNameTable.cs deleted file mode 100644 index f017de3d..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/ExportNameTable.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The export name table contains the actual string data that was pointed to by the export - /// name pointer table. The strings in this table are public names that other images can use - /// to import the symbols. These public export names are not necessarily the same as the - /// private symbol names that the symbols have in their own image file and source code, - /// although they can be. - /// - /// Every exported symbol has an ordinal value, which is just the index into the export - /// address table. Use of export names, however, is optional. Some, all, or none of the - /// exported symbols can have export names. For exported symbols that do have export names, - /// corresponding entries in the export name pointer table and export ordinal table work - /// together to associate each name with an ordinal. - /// - /// The structure of the export name table is a series of null-terminated ASCII strings - /// of variable length. - /// - /// - public sealed class ExportNameTable - { - /// - /// A series of null-terminated ASCII strings of variable length. - /// - public string[] Strings; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/ExportOrdinalTable.cs b/BinaryObjectScanner.Models/PortableExecutable/ExportOrdinalTable.cs deleted file mode 100644 index 183a64b6..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/ExportOrdinalTable.cs +++ /dev/null @@ -1,42 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The export ordinal table is an array of 16-bit unbiased indexes into the export address table. - /// Ordinals are biased by the Ordinal Base field of the export directory table. In other words, - /// the ordinal base must be subtracted from the ordinals to obtain true indexes into the export - /// address table. - /// - /// The export name pointer table and the export ordinal table form two parallel arrays that are - /// separated to allow natural field alignment. These two tables, in effect, operate as one table, - /// in which the Export Name Pointer column points to a public (exported) name and the Export - /// Ordinal column gives the corresponding ordinal for that public name. A member of the export - /// name pointer table and a member of the export ordinal table are associated by having the same - /// position (index) in their respective arrays. - /// - /// Thus, when the export name pointer table is searched and a matching string is found at position - /// i, the algorithm for finding the symbol's RVA and biased ordinal is: - /// - /// i = Search_ExportNamePointerTable(name); - /// ordinal = ExportOrdinalTable[i]; - /// - /// rva = ExportAddressTable[ordinal]; - /// biased_ordinal = ordinal + OrdinalBase; - /// - /// When searching for a symbol by(biased) ordinal, the algorithm for finding the symbol's RVA - /// and name is: - /// - /// ordinal = biased_ordinal - OrdinalBase; - /// i = Search_ExportOrdinalTable(ordinal); - /// - /// rva = ExportAddressTable[ordinal]; - /// name = ExportNameTable[i]; - /// - /// - public sealed class ExportOrdinalTable - { - /// - /// An array of 16-bit unbiased indexes into the export address table - /// - public ushort[] Indexes; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/ExportTable.cs b/BinaryObjectScanner.Models/PortableExecutable/ExportTable.cs deleted file mode 100644 index fd8baa83..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/ExportTable.cs +++ /dev/null @@ -1,53 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The export data section, named .edata, contains information about symbols that other images - /// can access through dynamic linking. Exported symbols are generally found in DLLs, but DLLs - /// can also import symbols. - /// - /// An overview of the general structure of the export section is described below. The tables - /// described are usually contiguous in the file in the order shown (though this is not - /// required). Only the export directory table and export address table are required to export - /// symbols as ordinals. (An ordinal is an export that is accessed directly by its export - /// address table index.) The name pointer table, ordinal table, and export name table all - /// exist to support use of export names. - /// - /// - public sealed class ExportTable - { - /// - /// A table with just one row (unlike the debug directory). This table indicates the - /// locations and sizes of the other export tables. - /// - public ExportDirectoryTable ExportDirectoryTable; - - /// - /// An array of RVAs of exported symbols. These are the actual addresses of the exported - /// functions and data within the executable code and data sections. Other image files - /// can import a symbol by using an index to this table (an ordinal) or, optionally, by - /// using the public name that corresponds to the ordinal if a public name is defined. - /// - public ExportAddressTableEntry[] ExportAddressTable; - - /// - /// An array of pointers to the public export names, sorted in ascending order. - /// - public ExportNamePointerTable NamePointerTable; - - /// - /// An array of the ordinals that correspond to members of the name pointer table. The - /// correspondence is by position; therefore, the name pointer table and the ordinal table - /// must have the same number of members. Each ordinal is an index into the export address - /// table. - /// - public ExportOrdinalTable OrdinalTable; - - /// - /// A series of null-terminated ASCII strings. Members of the name pointer table point into - /// this area. These names are the public names through which the symbols are imported and - /// exported; they are not necessarily the same as the private names that are used within - /// the image file. - /// - public ExportNameTable ExportNameTable; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/FixedFileInfo.cs b/BinaryObjectScanner.Models/PortableExecutable/FixedFileInfo.cs deleted file mode 100644 index 9044d509..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/FixedFileInfo.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Contains version information for a file. This information is language and - /// code page independent. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class FixedFileInfo - { - /// - /// Contains the value 0xFEEF04BD. This is used with the szKey member of the VS_VERSIONINFO - /// structure when searching a file for the FixedFileInfo structure. - /// - public uint Signature; - - /// - /// The binary version number of this structure. The high-order word of this member contains - /// the major version number, and the low-order word contains the minor version number. - /// - public uint StrucVersion; - - /// - /// The most significant 32 bits of the file's binary version number. This member is used with - /// FileVersionLS to form a 64-bit value used for numeric comparisons. - /// - public uint FileVersionMS; - - /// - /// The least significant 32 bits of the file's binary version number. This member is used with - /// FileVersionMS to form a 64-bit value used for numeric comparisons. - /// - public uint FileVersionLS; - - /// - /// The most significant 32 bits of the binary version number of the product with which this file - /// was distributed. This member is used with ProductVersionLS to form a 64-bit value used for - /// numeric comparisons. - /// - public uint ProductVersionMS; - - /// - /// The least significant 32 bits of the binary version number of the product with which this file - /// was distributed. This member is used with ProductVersionMS to form a 64-bit value used for - /// numeric comparisons. - /// - public uint ProductVersionLS; - - /// - /// Contains a bitmask that specifies the valid bits in FileFlags. A bit is valid only if it was - /// defined when the file was created. - /// - public uint FileFlagsMask; - - /// - /// Contains a bitmask that specifies the Boolean attributes of the file. - /// - public FixedFileInfoFlags FileFlags; - - /// - /// The operating system for which this file was designed. - /// - public FixedFileInfoOS FileOS; - - /// - /// The general type of file. - /// - public FixedFileInfoFileType FileType; - - /// - /// The function of the file. The possible values depend on the value of FileType. For all values - /// of FileType not described in the following list, FileSubtype is zero. - /// - public FixedFileInfoFileSubtype FileSubtype; - - /// - /// The most significant 32 bits of the file's 64-bit binary creation date and time stamp. - /// - public uint FileDateMS; - - /// - /// The least significant 32 bits of the file's 64-bit binary creation date and time stamp. - /// - public uint FileDateLS; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/FontDirEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/FontDirEntry.cs deleted file mode 100644 index d25abf00..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/FontDirEntry.cs +++ /dev/null @@ -1,174 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Contains information about an individual font in a font resource group. The structure definition - /// provided here is for explanation only; it is not present in any standard header file. - /// - /// - public sealed class FontDirEntry - { - /// - /// A user-defined version number for the resource data that tools can use to read and write - /// resource files. - /// - public ushort Version; - - /// - /// The size of the file, in bytes. - /// - public uint Size; - - /// - /// The font supplier's copyright information. - /// - /// 60 characters - public byte[] Copyright; - - /// - /// The type of font file. - /// - public ushort Type; - - /// - /// The point size at which this character set looks best. - /// - public ushort Points; - - /// - /// The vertical resolution, in dots per inch, at which this character set was digitized. - /// - public ushort VertRes; - - /// - /// The horizontal resolution, in dots per inch, at which this character set was digitized. - /// - public ushort HorizRes; - - /// - /// The distance from the top of a character definition cell to the baseline of the typographical - /// font. - /// - public ushort Ascent; - - /// - /// The amount of leading inside the bounds set by the PixHeight member. Accent marks and other - /// diacritical characters can occur in this area. - /// - public ushort InternalLeading; - - /// - /// The amount of extra leading that the application adds between rows. - /// - public ushort ExternalLeading; - - /// - /// An italic font if not equal to zero. - /// - public byte Italic; - - /// - /// An underlined font if not equal to zero. - /// - public byte Underline; - - /// - /// A strikeout font if not equal to zero. - /// - public byte StrikeOut; - - /// - /// The weight of the font in the range 0 through 1000. For example, 400 is roman and 700 is bold. - /// If this value is zero, a default weight is used. For additional defined values, see the - /// description of the LOGFONT structure. - /// - public ushort Weight; - - /// - /// The character set of the font. For predefined values, see the description of the LOGFONT - /// structure. - /// - public byte CharSet; - - /// - /// The width of the grid on which a vector font was digitized. For raster fonts, if the member - /// is not equal to zero, it represents the width for all the characters in the bitmap. If the - /// member is equal to zero, the font has variable-width characters. - /// - public ushort PixWidth; - - /// - /// The height of the character bitmap for raster fonts or the height of the grid on which a - /// vector font was digitized. - /// - public ushort PixHeight; - - /// - /// The pitch and the family of the font. For additional information, see the description of - /// the LOGFONT structure. - /// - public byte PitchAndFamily; - - /// - /// The average width of characters in the font (generally defined as the width of the letter x). - /// This value does not include the overhang required for bold or italic characters. - /// - public ushort AvgWidth; - - /// - /// The width of the widest character in the font. - /// - public ushort MaxWidth; - - /// - /// The first character code defined in the font. - /// - public byte FirstChar; - - /// - /// The last character code defined in the font. - /// - public byte LastChar; - - /// - /// The character to substitute for characters not in the font. - /// - public byte DefaultChar; - - /// - /// The character that will be used to define word breaks for text justification. - /// - public byte BreakChar; - - /// - /// The number of bytes in each row of the bitmap. This value is always even so that the rows - /// start on word boundaries. For vector fonts, this member has no meaning. - /// - public ushort WidthBytes; - - /// - /// The offset in the file to a null-terminated string that specifies a device name. For a - /// generic font, this value is zero. - /// - public uint Device; - - /// - /// The offset in the file to a null-terminated string that names the typeface. - /// - public uint Face; - - /// - /// This member is reserved. - /// - public uint Reserved; - - /// - /// The name of the device if this font file is designated for a specific device. - /// - public string DeviceName; - - /// - /// The typeface name of the font. - /// - public string FaceName; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/FontGroupHeader.cs b/BinaryObjectScanner.Models/PortableExecutable/FontGroupHeader.cs deleted file mode 100644 index b3248c34..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/FontGroupHeader.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Contains the information necessary for an application to access a specific font. The structure - /// definition provided here is for explanation only; it is not present in any standard header file. - /// - /// - public sealed class FontGroupHeader - { - /// - /// The number of individual fonts associated with this resource. - /// - public ushort NumberOfFonts; - - /// - /// A structure that contains a unique ordinal identifier for each font in the resource. The DE - /// member is a placeholder for the variable-length array of DIRENTRY structures. - /// - public DirEntry[] DE; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/HintNameTableEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/HintNameTableEntry.cs deleted file mode 100644 index 081d9b60..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/HintNameTableEntry.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// One hint/name table suffices for the entire import section. - /// - /// - public sealed class HintNameTableEntry - { - /// - /// An index into the export name pointer table. A match is attempted first - /// with this value. If it fails, a binary search is performed on the DLL's - /// export name pointer table. - /// - public ushort Hint; - - /// - /// An ASCII string that contains the name to import. This is the string that - /// must be matched to the public name in the DLL. This string is case sensitive - /// and terminated by a null byte. - /// - public string Name; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/ImportAddressTableEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/ImportAddressTableEntry.cs deleted file mode 100644 index 5167a3b3..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/ImportAddressTableEntry.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The structure and content of the import address table are identical to those of - /// the import lookup table, until the file is bound. During binding, the entries in - /// the import address table are overwritten with the 32-bit (for PE32) or 64-bit - /// (for PE32+) addresses of the symbols that are being imported. These addresses are - /// the actual memory addresses of the symbols, although technically they are still - /// called "virtual addresses." The loader typically processes the binding. - /// - /// - public sealed class ImportAddressTableEntry - { - /// - /// If this bit is set, import by ordinal. Otherwise, import by name. Bit is - /// masked as 0x80000000 for PE32, 0x8000000000000000 for PE32+. - /// - /// Bit 31/63 - public bool OrdinalNameFlag; - - /// - /// A 16-bit ordinal number. This field is used only if the Ordinal/Name Flag - /// bit field is 1 (import by ordinal). Bits 30-15 or 62-15 must be 0. - /// - /// Bits 15-0 - public ushort OrdinalNumber; - - /// - /// A 31-bit RVA of a hint/name table entry. This field is used only if the - /// Ordinal/Name Flag bit field is 0 (import by name). For PE32+ bits 62-31 - /// must be zero. - /// - /// Bits 30-0 - public uint HintNameTableRVA; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/ImportDirectoryTableEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/ImportDirectoryTableEntry.cs deleted file mode 100644 index d29891c0..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/ImportDirectoryTableEntry.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The import information begins with the import directory table, which - /// describes the remainder of the import information. The import directory - /// table contains address information that is used to resolve fixup references - /// to the entry points within a DLL image. The import directory table consists - /// of an array of import directory entries, one entry for each DLL to which - /// the image refers. The last directory entry is empty (filled with null values), - /// which indicates the end of the directory table. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ImportDirectoryTableEntry - { - /// - /// The RVA of the import lookup table. This table contains a name or ordinal - /// for each import. (The name "Characteristics" is used in Winnt.h, but no - /// longer describes this field.) - /// - public uint ImportLookupTableRVA; - - /// - /// The stamp that is set to zero until the image is bound. After the image is - /// bound, this field is set to the time/data stamp of the DLL. - /// - public uint TimeDateStamp; - - /// - /// The index of the first forwarder reference. - /// - public uint ForwarderChain; - - /// - /// The address of an ASCII string that contains the name of the DLL. This address - /// is relative to the image base. - /// - public uint NameRVA; - - /// - /// ASCII string that contains the name of the DLL. - /// - public string Name; - - /// - /// The RVA of the import address table. The contents of this table are identical - /// to the contents of the import lookup table until the image is bound. - /// - public uint ImportAddressTableRVA; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/ImportLookupTableEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/ImportLookupTableEntry.cs deleted file mode 100644 index a457358c..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/ImportLookupTableEntry.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// An import lookup table is an array of 32-bit numbers for PE32 or an array of - /// 64-bit numbers for PE32+. Each entry uses the bit-field format that is described - /// in the following table. In this format, bit 31 is the most significant bit for - /// PE32 and bit 63 is the most significant bit for PE32+. The collection of these - /// entries describes all imports from a given DLL. The last entry is set to zero - /// (NULL) to indicate the end of the table. - /// - /// - public sealed class ImportLookupTableEntry - { - /// - /// If this bit is set, import by ordinal. Otherwise, import by name. Bit is - /// masked as 0x80000000 for PE32, 0x8000000000000000 for PE32+. - /// - /// Bit 31/63 - public bool OrdinalNameFlag; - - /// - /// A 16-bit ordinal number. This field is used only if the Ordinal/Name Flag - /// bit field is 1 (import by ordinal). Bits 30-15 or 62-15 must be 0. - /// - /// Bits 15-0 - public ushort OrdinalNumber; - - /// - /// A 31-bit RVA of a hint/name table entry. This field is used only if the - /// Ordinal/Name Flag bit field is 0 (import by name). For PE32+ bits 62-31 - /// must be zero. - /// - /// Bits 30-0 - public uint HintNameTableRVA; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/ImportTable.cs b/BinaryObjectScanner.Models/PortableExecutable/ImportTable.cs deleted file mode 100644 index 31b480a1..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/ImportTable.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.Collections.Generic; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// All image files that import symbols, including virtually all executable (EXE) files, - /// have an .idata section. A typical file layout for the import information follows: - /// - /// - Directory Table - /// Null Directory Entry - /// - DLL1 Import Lookup Table - /// Null - /// - DLL2 Import Lookup Table - /// Null - /// - DLL3 Import Lookup Table - /// Null - /// - Hint-Name Table - /// - /// - public sealed class ImportTable - { - /// - /// The import information begins with the import directory table, which describes the - /// remainder of the import information. - /// - public ImportDirectoryTableEntry[] ImportDirectoryTable; - - /// - /// An import lookup table is an array of 32-bit numbers for PE32 or an array of 64-bit - /// numbers for PE32+. - /// - public Dictionary ImportLookupTables; - - /// - /// These addresses are the actual memory addresses of the symbols, although technically - /// they are still called "virtual addresses". - /// - public Dictionary ImportAddressTables; - - /// - /// One hint/name table suffices for the entire import section. - /// - public HintNameTableEntry[] HintNameTable; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/LoadConfigurationDirectory.cs b/BinaryObjectScanner.Models/PortableExecutable/LoadConfigurationDirectory.cs deleted file mode 100644 index 15a8ed9a..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/LoadConfigurationDirectory.cs +++ /dev/null @@ -1,343 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The data directory entry for a pre-reserved SEH load configuration - /// structure must specify a particular size of the load configuration - /// structure because the operating system loader always expects it to - /// be a certain value. In that regard, the size is really only a - /// version check. For compatibility with Windows XP and earlier versions - /// of Windows, the size must be 64 for x86 images. - /// - /// - public sealed class LoadConfigurationDirectory - { - /// - /// Flags that indicate attributes of the file, currently unused. - /// - public uint Characteristics; - - /// - /// Date and time stamp value. The value is represented in the number of - /// seconds that have elapsed since midnight (00:00:00), January 1, 1970, - /// Universal Coordinated Time, according to the system clock. The time - /// stamp can be printed by using the C runtime (CRT) time function. - /// - public uint TimeDateStamp; - - /// - /// Major version number. - /// - public ushort MajorVersion; - - /// - /// Minor version number. - /// - public ushort MinorVersion; - - /// - /// The global loader flags to clear for this process as the loader starts - /// the process. - /// - public uint GlobalFlagsClear; - - /// - /// The global loader flags to set for this process as the loader starts - /// the process. - /// - public uint GlobalFlagsSet; - - /// - /// The default timeout value to use for this process's critical sections - /// that are abandoned. - /// - public uint CriticalSectionDefaultTimeout; - - #region DeCommitFreeBlockThreshold - - /// - /// Memory that must be freed before it is returned to the system, in bytes. - /// - public uint DeCommitFreeBlockThreshold_PE32; - - /// - /// Memory that must be freed before it is returned to the system, in bytes. - /// - public ulong DeCommitFreeBlockThreshold_PE32Plus; - - #endregion - - #region DeCommitTotalFreeThreshold - - /// - /// Total amount of free memory, in bytes. - /// - public uint DeCommitTotalFreeThreshold_PE32; - - /// - /// Total amount of free memory, in bytes. - /// - public ulong DeCommitTotalFreeThreshold_PE32Plus; - - #endregion - - #region LockPrefixTable - - /// - /// [x86 only] The VA of a list of addresses where the LOCK prefix is used so - /// that they can be replaced with NOP on single processor machines. - /// - public uint LockPrefixTable_PE32; - - /// - /// [x86 only] The VA of a list of addresses where the LOCK prefix is used so - /// that they can be replaced with NOP on single processor machines. - /// - public ulong LockPrefixTable_PE32Plus; - - #endregion - - #region MaximumAllocationSize - - /// - /// Maximum allocation size, in bytes. - /// - public uint MaximumAllocationSize_PE32; - - /// - /// Maximum allocation size, in bytes. - /// - public ulong MaximumAllocationSize_PE32Plus; - - #endregion - - #region VirtualMemoryThreshold - - /// - /// Maximum virtual memory size, in bytes. - /// - public uint VirtualMemoryThreshold_PE32; - - /// - /// Maximum virtual memory size, in bytes. - /// - public ulong VirtualMemoryThreshold_PE32Plus; - - #endregion - - #region ProcessAffinityMask - - /// - /// Setting this field to a non-zero value is equivalent to calling - /// SetProcessAffinityMask with this value during process startup (.exe only) - /// - public uint ProcessAffinityMask_PE32; - - /// - /// Setting this field to a non-zero value is equivalent to calling - /// SetProcessAffinityMask with this value during process startup (.exe only) - /// - public ulong ProcessAffinityMask_PE32Plus; - - #endregion - - /// - /// Process heap flags that correspond to the first argument of the - /// HeapCreate function. These flags apply to the process heap that - /// is created during process startup. - /// - public uint ProcessHeapFlags; - - /// - /// The service pack version identifier. - /// - public ushort CSDVersion; - - /// - /// Must be zero. - /// - public ushort Reserved; - - #region EditList - - /// - /// Reserved for use by the system. - /// - public uint EditList_PE32; - - /// - /// Reserved for use by the system. - /// - public ulong EditList_PE32Plus; - - #endregion - - #region SecurityCookie - - /// - /// A pointer to a cookie that is used by Visual C++ or GS implementation. - /// - public uint SecurityCookie_PE32; - - /// - /// A pointer to a cookie that is used by Visual C++ or GS implementation. - /// - public ulong SecurityCookie_PE32Plus; - - #endregion - - #region SEHandlerTable - - /// - /// [x86 only] The VA of the sorted table of RVAs of each valid, unique - /// SE handler in the image. - /// - public uint SEHandlerTable_PE32; - - /// - /// [x86 only] The VA of the sorted table of RVAs of each valid, unique - /// SE handler in the image. - /// - public ulong SEHandlerTable_PE32Plus; - - #endregion - - #region SEHandlerCount - - /// - /// [x86 only] The count of unique handlers in the table. - /// - public uint SEHandlerCount_PE32; - - /// - /// [x86 only] The count of unique handlers in the table. - /// - public ulong SEHandlerCount_PE32Plus; - - #endregion - - #region GuardCFCheckFunctionPointer - - /// - /// The VA where Control Flow Guard check-function pointer is stored. - /// - public uint GuardCFCheckFunctionPointer_PE32; - - /// - /// The VA where Control Flow Guard check-function pointer is stored. - /// - public ulong GuardCFCheckFunctionPointer_PE32Plus; - - #endregion - - #region GuardCFDispatchFunctionPointer - - /// - /// The VA where Control Flow Guard dispatch-function pointer is stored. - /// - public uint GuardCFDispatchFunctionPointer_PE32; - - /// - /// The VA where Control Flow Guard dispatch-function pointer is stored. - /// - public ulong GuardCFDispatchFunctionPointer_PE32Plus; - - #endregion - - #region GuardCFFunctionTable - - /// - /// The VA of the sorted table of RVAs of each Control Flow Guard - /// function in the image. - /// - public uint GuardCFFunctionTable_PE32; - - /// - /// The VA of the sorted table of RVAs of each Control Flow Guard - /// function in the image. - /// - public ulong GuardCFFunctionTable_PE32Plus; - - #endregion - - #region GuardCFFunctionCount - - /// - /// The count of unique RVAs in the above table. - /// - public uint GuardCFFunctionCount_PE32; - - /// - /// The count of unique RVAs in the above table. - /// - public ulong GuardCFFunctionCount_PE32Plus; - - #endregion - - /// - /// Control Flow Guard related flags. - /// - public GuardFlags GuardFlags; - - /// - /// Code integrity information. - /// - /// 12 bytes - public byte[] CodeIntegrity; - - #region GuardAddressTakenIatEntryTable - - /// - /// The VA where Control Flow Guard address taken IAT table is stored. - /// - public uint GuardAddressTakenIatEntryTable_PE32; - - /// - /// The VA where Control Flow Guard address taken IAT table is stored. - /// - public ulong GuardAddressTakenIatEntryTable_PE32Plus; - - #endregion - - #region GuardAddressTakenIatEntryCount - - /// - /// The count of unique RVAs in the above table. - /// - public uint GuardAddressTakenIatEntryCount_PE32; - - /// - /// The count of unique RVAs in the above table. - /// - public ulong GuardAddressTakenIatEntryCount_PE32Plus; - - #endregion - - #region GuardLongJumpTargetTable - - /// - /// The VA where Control Flow Guard long jump target table is stored. - /// - public uint GuardLongJumpTargetTable_PE32; - - /// - /// The VA where Control Flow Guard long jump target table is stored. - /// - public ulong GuardLongJumpTargetTable_PE32Plus; - - #endregion - - #region GuardLongJumpTargetCount - - /// - /// The count of unique RVAs in the above table. - /// - public uint GuardLongJumpTargetCount_PE32; - - /// - /// The count of unique RVAs in the above table. - /// - public ulong GuardLongJumpTargetCount_PE32Plus; - - #endregion - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/MenuHeader.cs b/BinaryObjectScanner.Models/PortableExecutable/MenuHeader.cs deleted file mode 100644 index 2d2ebe0a..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/MenuHeader.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Contains version information for the menu resource. The structure definition provided - /// here is for explanation only; it is not present in any standard header file. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class MenuHeader - { - /// - /// The version number of the menu template. This member must be equal to zero to indicate - /// that this is an RT_MENU created with a standard menu template. - /// - public ushort Version; - - /// - /// The size of the menu template header. This value is zero for menus you create with a - /// standard menu template. - /// - public ushort HeaderSize; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/MenuHeaderExtended.cs b/BinaryObjectScanner.Models/PortableExecutable/MenuHeaderExtended.cs deleted file mode 100644 index 5719124b..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/MenuHeaderExtended.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Defines the header for an extended menu template. This structure definition is for - /// explanation only; it is not present in any standard header file. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class MenuHeaderExtended - { - /// - /// The template version number. This member must be 1 for extended menu templates. - /// - public ushort Version; - - /// - /// The offset to the first MENUEX_TEMPLATE_ITEM structure, relative to the end of - /// this structure member. If the first item definition immediately follows the - /// dwHelpId member, this member should be 4. - /// - public ushort Offset; - - /// - /// The help identifier of menu bar. - /// - public uint HelpID; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/MenuItem.cs b/BinaryObjectScanner.Models/PortableExecutable/MenuItem.cs deleted file mode 100644 index 2f0f4017..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/MenuItem.cs +++ /dev/null @@ -1,62 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Contains information about each item in a menu resource that does not open a menu - /// or a submenu. The structure definition provided here is for explanation only; it - /// is not present in any standard header file. - /// - /// Contains information about the menu items in a menu resource that open a menu - /// or a submenu. The structure definition provided here is for explanation only; - /// it is not present in any standard header file. - /// - /// - /// - public sealed class MenuItem - { - #region NORMALMENUITEM - - /// - /// The type of menu item. - /// - public MenuFlags NormalResInfo; - - /// - /// A null-terminated Unicode string that contains the text for this menu item. - /// There is no fixed limit on the size of this string. - /// - public string NormalMenuText; - - #endregion - - #region POPUPMENUITEM - - /// - /// Describes the menu item. - /// - public MenuFlags PopupItemType; - - /// - /// Describes the menu item. - /// - public MenuFlags PopupState; - - /// - /// A numeric expression that identifies the menu item that is passed in the - /// WM_COMMAND message. - /// - public uint PopupID; - - /// - /// A set of bit flags that specify the type of menu item. - /// - public MenuFlags PopupResInfo; - - /// - /// A null-terminated Unicode string that contains the text for this menu item. - /// There is no fixed limit on the size of this string. - /// - public string PopupMenuText; - - #endregion - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/MenuItemExtended.cs b/BinaryObjectScanner.Models/PortableExecutable/MenuItemExtended.cs deleted file mode 100644 index 57ee4a8e..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/MenuItemExtended.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Defines a menu item in an extended menu template. This structure definition is for - /// explanation only; it is not present in any standard header file. - /// - /// - public sealed class MenuItemExtended - { - /// - /// Describes the menu item. - /// - public MenuFlags ItemType; - - /// - /// Describes the menu item. - /// - public MenuFlags State; - - /// - /// A numeric expression that identifies the menu item that is passed in the - /// WM_COMMAND message. - /// - public uint ID; - - /// - /// A set of bit flags that specify the type of menu item. - /// - public MenuFlags Flags; - - /// - /// A null-terminated Unicode string that contains the text for this menu item. - /// There is no fixed limit on the size of this string. - /// - public string MenuText; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/MenuResource.cs b/BinaryObjectScanner.Models/PortableExecutable/MenuResource.cs deleted file mode 100644 index a6c1bed0..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/MenuResource.cs +++ /dev/null @@ -1,40 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// A menu resource consists of a MENUHEADER structure followed by one or more - /// NORMALMENUITEM or POPUPMENUITEM structures, one for each menu item in the menu - /// template. The MENUEX_TEMPLATE_HEADER and the MENUEX_TEMPLATE_ITEM structures - /// describe the format of extended menu resources. - /// - /// - public sealed class MenuResource - { - #region Menu header - - /// - /// Menu header structure - /// - public MenuHeader MenuHeader; - - /// - /// Menu extended header structure - /// - public MenuHeaderExtended ExtendedMenuHeader; - - #endregion - - #region Menu items - - /// - /// Menu items - /// - public MenuItem[] MenuItems; - - /// - /// Extended menu items - /// - public MenuItemExtended[] ExtendedMenuItems; - - #endregion - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/MessageResourceBlock.cs b/BinaryObjectScanner.Models/PortableExecutable/MessageResourceBlock.cs deleted file mode 100644 index 3a79b716..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/MessageResourceBlock.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Contains information about message strings with identifiers in the range indicated - /// by the LowId and HighId members. - /// - /// - public sealed class MessageResourceBlock - { - /// - /// The lowest message identifier contained within this structure. - /// - public uint LowId; - - /// - /// The highest message identifier contained within this structure. - /// - public uint HighId; - - /// - /// The offset, in bytes, from the beginning of the MESSAGE_RESOURCE_DATA structure to the - /// MESSAGE_RESOURCE_ENTRY structures in this MESSAGE_RESOURCE_BLOCK. The MESSAGE_RESOURCE_ENTRY - /// structures contain the message strings. - /// - public uint OffsetToEntries; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/MessageResourceData.cs b/BinaryObjectScanner.Models/PortableExecutable/MessageResourceData.cs deleted file mode 100644 index 9f699ae5..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/MessageResourceData.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Collections.Generic; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Contains information about formatted text for display as an error message or in a message - /// box in a message table resource. - /// - /// - public sealed class MessageResourceData - { - /// - /// The number of MESSAGE_RESOURCE_BLOCK structures. - /// - public uint NumberOfBlocks; - - /// - /// An array of structures. The array is the size indicated by the NumberOfBlocks member. - /// - public MessageResourceBlock[] Blocks; - - /// - /// Message resource entries - /// - public Dictionary Entries; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/MessageResourceEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/MessageResourceEntry.cs deleted file mode 100644 index 531ec7ba..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/MessageResourceEntry.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Contains the error message or message box display text for a message table resource. - /// - /// - public sealed class MessageResourceEntry - { - /// - /// The length, in bytes, of the MESSAGE_RESOURCE_ENTRY structure. - /// - public ushort Length; - - /// - /// Indicates that the string is encoded in Unicode, if equal to the value 0x0001. - /// Indicates that the string is encoded in ANSI, if equal to the value 0x0000. - /// - public ushort Flags; - - /// - /// Pointer to an array that contains the error message or message box display text. - /// - public string Text; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/NB10ProgramDatabase.cs b/BinaryObjectScanner.Models/PortableExecutable/NB10ProgramDatabase.cs deleted file mode 100644 index 1fab0b37..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/NB10ProgramDatabase.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// PDB 2.0 files - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class NB10ProgramDatabase - { - /// - /// "CodeView signature, equal to “NB10” - /// - public uint Signature; - - /// - /// CodeView offset. Set to 0, because debug information - /// is stored in a separate file. - /// - public uint Offset; - - /// - /// The time when debug information was created (in seconds - /// since 01.01.1970) - /// - public uint Timestamp; - - /// - /// Ever-incrementing value, which is initially set to 1 and - /// incremented every time when a part of the PDB file is updated - /// without rewriting the whole file. - /// - public uint Age; - - /// - /// Null-terminated name of the PDB file. It can also contain full - /// or partial path to the file. - /// - public string PdbFileName; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/NewHeader.cs b/BinaryObjectScanner.Models/PortableExecutable/NewHeader.cs deleted file mode 100644 index 19d1044c..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/NewHeader.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Contains the number of icon or cursor components in a resource group. The - /// structure definition provided here is for explanation only; it is not present - /// in any standard header file. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class NewHeader - { - /// - /// Reserved; must be zero. - /// - public ushort Reserved; - - /// - /// The resource type. This member must have one of the following values. - /// - RES_ICON (1): Icon resource type. - /// - RES_CURSOR (2): Cursor resource type. - /// - public ushort ResType; - - /// - /// The number of icon or cursor components in the resource group. - /// - public ushort ResCount; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/OptionalHeader.cs b/BinaryObjectScanner.Models/PortableExecutable/OptionalHeader.cs deleted file mode 100644 index ecf7ed70..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/OptionalHeader.cs +++ /dev/null @@ -1,358 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Every image file has an optional header that provides information to the loader. - /// This header is optional in the sense that some files (specifically, object files) - /// do not have it. For image files, this header is required. An object file can have - /// an optional header, but generally this header has no function in an object file - /// except to increase its size. - /// - /// Note that the size of the optional header is not fixed. The SizeOfOptionalHeader - /// field in the COFF header must be used to validate that a probe into the file for - /// a particular data directory does not go beyond SizeOfOptionalHeader. - /// - /// The NumberOfRvaAndSizes field of the optional header should also be used to ensure - /// that no probe for a particular data directory entry goes beyond the optional header. - /// In addition, it is important to validate the optional header magic number for format - /// compatibility. - /// - /// The optional header magic number determines whether an image is a PE32 or - /// PE32+ executable. - /// - /// PE32+ images allow for a 64-bit address space while limiting the image size to - /// 2 gigabytes. Other PE32+ modifications are addressed in their respective sections. - /// - /// The first eight fields of the optional header are standard fields that are defined - /// for every implementation of COFF. These fields contain general information that is - /// useful for loading and running an executable file. They are unchanged for the - /// PE32+ format. - /// - /// - public sealed class OptionalHeader - { - #region Standard Fields (Image Only) - - /// - /// The unsigned integer that identifies the state of the image file. The most - /// common number is 0x10B, which identifies it as a normal executable file. - /// 0x107 identifies it as a ROM image, and 0x20B identifies it as a PE32+ executable. - /// - public OptionalHeaderMagicNumber Magic; - - /// - /// The linker major version number. - /// - public byte MajorLinkerVersion; - - /// - /// The linker minor version number. - /// - public byte MinorLinkerVersion; - - /// - /// The size of the code (text) section, or the sum of all code sections if there - /// are multiple sections. - /// - public uint SizeOfCode; - - /// - /// The size of the initialized data section, or the sum of all such sections if - /// there are multiple data sections. - /// - public uint SizeOfInitializedData; - - /// - /// The size of the uninitialized data section (BSS), or the sum of all such sections - /// if there are multiple BSS sections. - /// - public uint SizeOfUninitializedData; - - /// - /// The address of the entry point relative to the image base when the executable file - /// is loaded into memory. For program images, this is the starting address. For - /// device drivers, this is the address of the initialization function. An entry point - /// is optional for DLLs. When no entry point is present, this field must be zero. - /// - public uint AddressOfEntryPoint; - - /// - /// The address that is relative to the image base of the beginning-of-code section when - /// it is loaded into memory. - /// - public uint BaseOfCode; - - #region PE32-Only - - /// - /// The address that is relative to the image base of the beginning-of-data section when - /// it is loaded into memory. - /// - public uint BaseOfData; - - #endregion - - #endregion - - #region Windows-Specific Fields (Image Only) - - #region ImageBase - - /// - /// The preferred address of the first byte of image when loaded into memory; - /// must be a multiple of 64 K. The default for DLLs is 0x10000000. The default - /// for Windows CE EXEs is 0x00010000. The default for Windows NT, Windows 2000, - /// Windows XP, Windows 95, Windows 98, and Windows Me is 0x00400000. - /// - public uint ImageBase_PE32; - - /// - /// The preferred address of the first byte of image when loaded into memory; - /// must be a multiple of 64 K. The default for DLLs is 0x10000000. The default - /// for Windows CE EXEs is 0x00010000. The default for Windows NT, Windows 2000, - /// Windows XP, Windows 95, Windows 98, and Windows Me is 0x00400000. - /// - public ulong ImageBase_PE32Plus; - - #endregion - - /// - /// The alignment (in bytes) of sections when they are loaded into memory. It must - /// be greater than or equal to FileAlignment. The default is the page size for - /// the architecture. - /// - public uint SectionAlignment; - - /// - /// The alignment factor (in bytes) that is used to align the raw data of sections - /// in the image file. The value should be a power of 2 between 512 and 64 K, - /// inclusive. The default is 512. If the SectionAlignment is less than the - /// architecture's page size, then FileAlignment must match SectionAlignment. - /// - public uint FileAlignment; - - /// - /// The major version number of the required operating system. - /// - public ushort MajorOperatingSystemVersion; - - /// - /// The minor version number of the required operating system. - /// - public ushort MinorOperatingSystemVersion; - - /// - /// The major version number of the image. - /// - public ushort MajorImageVersion; - - /// - /// The minor version number of the image. - /// - public ushort MinorImageVersion; - - /// - /// The major version number of the subsystem. - /// - public ushort MajorSubsystemVersion; - - /// - /// The minor version number of the subsystem. - /// - public ushort MinorSubsystemVersion; - - /// - /// Reserved, must be zero. - /// - public uint Win32VersionValue; - - /// - /// The size (in bytes) of the image, including all headers, as the image - /// is loaded in memory. It must be a multiple of SectionAlignment. - /// - public uint SizeOfImage; - - /// - /// The combined size of an MS-DOS stub, PE header, and section headers rounded - /// up to a multiple of FileAlignment. - /// - public uint SizeOfHeaders; - - /// - /// The image file checksum. The algorithm for computing the checksum is - /// incorporated into IMAGHELP.DLL. The following are checked for validation at - /// load time: all drivers, any DLL loaded at boot time, and any DLL that is - /// loaded into a critical Windows process. - /// - public uint CheckSum; - - /// - /// The subsystem that is required to run this image. - /// - public WindowsSubsystem Subsystem; - - /// - /// DLL characteristics - /// - public DllCharacteristics DllCharacteristics; - - #region SizeOfStackReserve - - /// - /// The size of the stack to reserve. Only SizeOfStackCommit is committed; the rest - /// is made available one page at a time until the reserve size is reached. - /// - public uint SizeOfStackReserve_PE32; - - /// - /// The size of the stack to reserve. Only SizeOfStackCommit is committed; the rest - /// is made available one page at a time until the reserve size is reached. - /// - public ulong SizeOfStackReserve_PE32Plus; - - #endregion - - #region SizeOfStackCommit - - /// - /// The size of the stack to commit. - /// - public uint SizeOfStackCommit_PE32; - - /// - /// The size of the stack to commit. - /// - public ulong SizeOfStackCommit_PE32Plus; - - #endregion - - #region SizeOfHeapReserve - - /// - /// The size of the local heap space to reserve. Only SizeOfHeapCommit is - /// committed; the rest is made available one page at a time until the reserve - /// size is reached. - /// - public uint SizeOfHeapReserve_PE32; - - /// - /// The size of the local heap space to reserve. Only SizeOfHeapCommit is - /// committed; the rest is made available one page at a time until the reserve - /// size is reached. - /// - public ulong SizeOfHeapReserve_PE32Plus; - - #endregion - - #region SizeOfHeapCommit - - /// - /// The size of the local heap space to commit. - /// - public uint SizeOfHeapCommit_PE32; - - /// - /// The size of the local heap space to commit. - /// - public ulong SizeOfHeapCommit_PE32Plus; - - #endregion - - /// - /// Reserved, must be zero. - /// - public uint LoaderFlags; - - /// - /// The number of data-directory entries in the remainder of the optional header. - /// Each describes a location and size. - /// - public uint NumberOfRvaAndSizes; - - #endregion - - #region Data Directories (Image Only) - - /// - /// The export table address and size. - /// - public DataDirectory ExportTable; - - /// - /// The import table address and size. - /// - public DataDirectory ImportTable; - - /// - /// The resource table address and size. - /// - public DataDirectory ResourceTable; - - /// - /// The exception table address and size. - /// - public DataDirectory ExceptionTable; - - /// - /// The attribute certificate table address and size. - /// - public DataDirectory CertificateTable; - - /// - /// The base relocation table address and size. - /// - public DataDirectory BaseRelocationTable; - - /// - /// The debug data starting address and size. - /// - public DataDirectory Debug; - - /// - /// Reserved, must be 0 - /// - public ulong Architecture; - - /// - /// The RVA of the value to be stored in the global pointer register. - /// The size member of this structure must be set to zero. - /// - public DataDirectory GlobalPtr; - - /// - /// The thread local storage (TLS) table address and size. - /// - public DataDirectory ThreadLocalStorageTable; - - /// - /// The load configuration table address and size. - /// - public DataDirectory LoadConfigTable; - - /// - /// The bound import table address and size. - /// - public DataDirectory BoundImport; - - /// - /// The import address table address and size - /// - public DataDirectory ImportAddressTable; - - /// - /// The delay import descriptor address and size. - /// - public DataDirectory DelayImportDescriptor; - - /// - /// The CLR runtime header address and size. - /// - public DataDirectory CLRRuntimeHeader; - - /// - /// Reserved, must be zero - /// - public ulong Reserved; - - #endregion - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/RSDSProgramDatabase.cs b/BinaryObjectScanner.Models/PortableExecutable/RSDSProgramDatabase.cs deleted file mode 100644 index 485b5877..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/RSDSProgramDatabase.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// This file describes the format of the pdb (Program Database) files of the "RSDS" - /// or "DS" type which are emitted by Miscrosoft's link.exe from version 7 and above. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class RSDSProgramDatabase - { - /// - /// "RSDS" signature - /// - public uint Signature; - - /// - /// 16-byte Globally Unique Identifier - /// - public Guid GUID; - - /// - /// Ever-incrementing value, which is initially set to 1 and - /// incremented every time when a part of the PDB file is updated - /// without rewriting the whole file. - /// - public uint Age; - - /// - /// zero terminated UTF8 path and file name - /// - public string PathAndFileName; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/ResourceDataEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/ResourceDataEntry.cs deleted file mode 100644 index 504b771f..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/ResourceDataEntry.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The resource directory string area consists of Unicode strings, which - /// are word-aligned. These strings are stored together after the last - /// Resource Directory entry and before the first Resource Data entry. - /// This minimizes the impact of these variable-length strings on the - /// alignment of the fixed-size directory entries. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ResourceDataEntry - { - /// - /// The address of a unit of resource data in the Resource Data area. - /// - public uint DataRVA; - - /// - /// The size, in bytes, of the resource data that is pointed to by the - /// Data RVA field. - /// - public uint Size; - - /// - /// The resource data that is pointed to by the Data RVA field. - /// - public byte[] Data; - - /// - /// The code page that is used to decode code point values within the - /// resource data. Typically, the code page would be the Unicode code page. - /// - public uint Codepage; - - /// - /// Reserved, must be 0. - /// - public uint Reserved; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/ResourceDirectoryEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/ResourceDirectoryEntry.cs deleted file mode 100644 index 7521fc15..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/ResourceDirectoryEntry.cs +++ /dev/null @@ -1,68 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// A leaf's Type, Name, and Language IDs are determined by the path that is - /// taken through directory tables to reach the leaf. The first table - /// determines Type ID, the second table (pointed to by the directory entry - /// in the first table) determines Name ID, and the third table determines - /// Language ID. - /// - /// The directory entries make up the rows of a table. Each resource directory - /// entry has the following format. Whether the entry is a Name or ID entry - /// is indicated by the resource directory table, which indicates how many - /// Name and ID entries follow it (remember that all the Name entries precede - /// all the ID entries for the table). All entries for the table are sorted - /// in ascending order: the Name entries by case-sensitive string and the ID - /// entries by numeric value. Offsets are relative to the address in the - /// IMAGE_DIRECTORY_ENTRY_RESOURCE DataDirectory. - /// - /// - public sealed class ResourceDirectoryEntry - { - #region Offset 0x00 - - /// - /// The offset of a string that gives the Type, Name, or Language ID entry, - /// depending on level of table. - /// - public uint NameOffset; - - /// - /// A string that gives the Type, Name, or Language ID entry, depending on - /// level of table. - /// - public ResourceDirectoryString Name; - - /// - /// A 32-bit integer that identifies the Type, Name, or Language ID entry. - /// - public uint IntegerID; - - #endregion - - #region Offset 0x04 - - /// - /// High bit 0. Address of a Resource Data entry (a leaf). - /// - public uint DataEntryOffset; - - /// - /// Resource data entry (a leaf). - /// - public ResourceDataEntry DataEntry; - - /// - /// High bit 1. The lower 31 bits are the address of another resource - /// directory table (the next level down). - /// - public uint SubdirectoryOffset; - - /// - /// Another resource directory table (the next level down). - /// - public ResourceDirectoryTable Subdirectory; - - #endregion - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/ResourceDirectoryString.cs b/BinaryObjectScanner.Models/PortableExecutable/ResourceDirectoryString.cs deleted file mode 100644 index 6c97bed2..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/ResourceDirectoryString.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// The resource directory string area consists of Unicode strings, which - /// are word-aligned. These strings are stored together after the last - /// Resource Directory entry and before the first Resource Data entry. - /// This minimizes the impact of these variable-length strings on the - /// alignment of the fixed-size directory entries. - /// - /// - public sealed class ResourceDirectoryString - { - /// - /// The size of the string, not including length field itself. - /// - public ushort Length; - - /// - /// The variable-length Unicode string data, word-aligned. - /// - public byte[] UnicodeString; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/ResourceDirectoryTable.cs b/BinaryObjectScanner.Models/PortableExecutable/ResourceDirectoryTable.cs deleted file mode 100644 index ae0fdf16..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/ResourceDirectoryTable.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Each directory table is followed by a series of directory entries that - /// give the name or identifier (ID) for that level (Type, Name, or Language - /// level) and an address of either a data description or another directory - /// table. If the address points to a data description, then the data is a - /// leaf in the tree. If the address points to another directory table, - /// then that table lists directory entries at the next level down. - /// - /// Each resource directory table has the following format. This data - /// structure should be considered the heading of a table because the table - /// actually consists of directory entries. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class ResourceDirectoryTable - { - /// - /// Resource flags. This field is reserved for future use. It is currently - /// set to zero. - /// - public uint Characteristics; - - /// - /// The time that the resource data was created by the resource compiler. - /// - public uint TimeDateStamp; - - /// - /// The major version number, set by the user. - /// - public ushort MajorVersion; - - /// - /// The minor version number, set by the user. - /// - public ushort MinorVersion; - - /// - /// The number of directory entries immediately following the table that use - /// strings to identify Type, Name, or Language entries (depending on the - /// level of the table). - /// - public ushort NumberOfNameEntries; - - /// - /// The number of directory entries immediately following the Name entries that - /// use numeric IDs for Type, Name, or Language entries. - /// - public ushort NumberOfIDEntries; - - /// - /// Directory entries immediately following the table that use - /// strings to identify Type, Name, or Language entries (depending on the - /// level of the table). - /// - public ResourceDirectoryEntry[] Entries; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/ResourceHeader.cs b/BinaryObjectScanner.Models/PortableExecutable/ResourceHeader.cs deleted file mode 100644 index fa313536..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/ResourceHeader.cs +++ /dev/null @@ -1,94 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Contains information about the resource header itself and the data specific to - /// this resource. This structure is not a true C-language structure, because it - /// contains variable-length members. The structure definition provided here is for - /// explanation only; it is not present in any standard header file. - /// - /// - public sealed class ResourceHeader - { - /// - /// The size, in bytes, of the data that follows the resource header for this - /// particular resource. It does not include any file padding between this - /// resource and any resource that follows it in the resource file. - /// - public uint DataSize; - - /// - /// The size, in bytes, of the resource header data that follows. - /// - public uint HeaderSize; - - /// - /// The resource type. The TYPE member can either be a numeric value or a - /// null-terminated Unicode string that specifies the name of the type. See the - /// following Remarks section for a description of Name or Ordinal type members. - /// - /// If the TYPE member is a numeric value, it can specify either a standard or a - /// user-defined resource type. If the member is a string, then it is a - /// user-defined resource type. - /// - /// Values less than 256 are reserved for system use. - /// - public ResourceType ResourceType; - - /// - /// A name that identifies the particular resource. The NAME member, like the TYPE - /// member, can either be a numeric value or a null-terminated Unicode string. - /// See the following Remarks section for a description of Name or Ordinal type - /// members. - /// - /// You do not need to add padding for DWORD alignment between the TYPE and NAME - /// members because they contain WORD data. However, you may need to add a WORD of - /// padding after the NAME member to align the rest of the header on DWORD boundaries. - /// - public uint Name; - - /// - /// A predefined resource data version. This will determine which version of the - /// resource data the application should use. - /// - public uint DataVersion; - - /// - /// A set of attribute flags that can describe the state of the resource. Modifiers - /// in the .RC script file assign these attributes to the resource. The script - /// identifiers can assign the following flag values. - /// - /// Applications do not use any of these attributes. The attributes are permitted - /// in the script for backward compatibility with existing scripts, but they are - /// ignored. Resources are loaded when the corresponding module is loaded, and are - /// freed when the module is unloaded. - /// - public MemoryFlags MemoryFlags; - - /// - /// The language for the resource or set of resources. Set the value for this member - /// with the optional LANGUAGE resource definition statement. The parameters are - /// constants from the Winnt.h file. - /// - /// Each resource includes a language identifier so the system or application can - /// select a language appropriate for the current locale of the system. If there are - /// multiple resources of the same type and name that differ only in the language of - /// the strings within the resources, you will need to specify a LanguageId for each - /// one. - /// - public ushort LanguageId; - - /// - /// A user-defined version number for the resource data that tools can use to read and - /// write resource files. Set this value with the optional VERSION resource definition - /// statement. - /// - public uint Version; - - /// - /// Specifies user-defined information about the resource that tools can use to read and - /// write resource files. Set this value with the optional CHARACTERISTICS resource - /// definition statement. - /// - public uint Characteristics; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/SectionHeader.cs b/BinaryObjectScanner.Models/PortableExecutable/SectionHeader.cs deleted file mode 100644 index 4585c991..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/SectionHeader.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Each row of the section table is, in effect, a section header. This table - /// immediately follows the optional header, if any. This positioning is required - /// because the file header does not contain a direct pointer to the section table. - /// Instead, the location of the section table is determined by calculating the - /// location of the first byte after the headers. Make sure to use the size of - /// the optional header as specified in the file header. - /// - /// The number of entries in the section table is given by the NumberOfSections - /// field in the file header. Entries in the section table are numbered starting - /// from one (1). The code and data memory section entries are in the order chosen - /// by the linker. - /// - /// In an image file, the VAs for sections must be assigned by the linker so that - /// they are in ascending order and adjacent, and they must be a multiple of the - /// SectionAlignment value in the optional header. - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class SectionHeader - { - /// - /// An 8-byte, null-padded UTF-8 encoded string. If the string is exactly 8 - /// characters long, there is no terminating null. For longer names, this field - /// contains a slash (/) that is followed by an ASCII representation of a - /// decimal number that is an offset into the string table. Executable images - /// do not use a string table and do not support section names longer than 8 - /// characters. Long names in object files are truncated if they are emitted - /// to an executable file. - /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] - public byte[] Name; - - /// - /// The total size of the section when loaded into memory. If this value is - /// greater than SizeOfRawData, the section is zero-padded. This field is valid - /// only for executable images and should be set to zero for object files. - /// - public uint VirtualSize; - - /// - /// For executable images, the address of the first byte of the section relative - /// to the image base when the section is loaded into memory. For object files, - /// this field is the address of the first byte before relocation is applied; - /// for simplicity, compilers should set this to zero. Otherwise, it is an - /// arbitrary value that is subtracted from offsets during relocation. - /// - public uint VirtualAddress; - - /// - /// The size of the section (for object files) or the size of the initialized - /// data on disk (for image files). For executable images, this must be a multiple - /// of FileAlignment from the optional header. If this is less than VirtualSize, - /// the remainder of the section is zero-filled. Because the SizeOfRawData field - /// is rounded but the VirtualSize field is not, it is possible for SizeOfRawData - /// to be greater than VirtualSize as well. When a section contains only - /// uninitialized data, this field should be zero. - /// - public uint SizeOfRawData; - - /// - /// The file pointer to the first page of the section within the COFF file. For - /// executable images, this must be a multiple of FileAlignment from the optional - /// header. For object files, the value should be aligned on a 4-byte boundary - /// for best performance. When a section contains only uninitialized data, this - /// field should be zero. - /// - public uint PointerToRawData; - - /// - /// The file pointer to the beginning of relocation entries for the section. This - /// is set to zero for executable images or if there are no relocations. - /// - public uint PointerToRelocations; - - /// - /// The file pointer to the beginning of line-number entries for the section. This - /// is set to zero if there are no COFF line numbers. This value should be zero for - /// an image because COFF debugging information is deprecated. - /// - public uint PointerToLinenumbers; - - /// - /// The number of relocation entries for the section. This is set to zero for - /// executable images. - /// - public ushort NumberOfRelocations; - - /// - /// The number of line-number entries for the section. This value should be zero - /// for an image because COFF debugging information is deprecated. - /// - public ushort NumberOfLinenumbers; - - /// - /// The flags that describe the characteristics of the section. - /// - public SectionFlags Characteristics; - - /// - /// COFF Relocations (Object Only) - /// - public COFFRelocation[] COFFRelocations; - - /// - /// COFF Line Numbers (Deprecated) - /// - public COFFLineNumber[] COFFLineNumbers; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/SecuROMAddD.cs b/BinaryObjectScanner.Models/PortableExecutable/SecuROMAddD.cs deleted file mode 100644 index a2ca1908..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/SecuROMAddD.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Overlay data associated with SecuROM executables - /// - /// - /// All information in this file has been researched in a clean room - /// environment by using sample from legally obtained software that - /// is protected by SecuROM. - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class SecuROMAddD - { - /// - /// "AddD", Identifier? - /// - public uint Signature; - - /// - /// Unknown (Entry count?) - /// - /// - /// 3 in EXPUNGED, 3.17.00.0017, 3.17.00.0019 - /// 3 in 4.47.00.0039, 4.84.00.0054, 4.84.69.0037, 4.84.76.7966, 4.84.76.7968, 4.85.07.0009 - /// - public uint EntryCount; - - /// - /// Version, always 8 bytes? - /// - public string Version; - - /// - /// Unknown (Build? Formatted as a string) - /// - public char[] Build; - - /// - /// Unknown (0x14h), Variable number of bytes before entry table - /// - /// - /// 44 bytes in EXPUNGED, 3.17.00.0017, 3.17.00.0019, 4.47.00.0039 - /// 112 bytes in 4.84.00.0054, 4.84.69.0037, 4.84.76.7966, 4.84.76.7968, 4.85.07.0009 - /// 112 byte range contains a fixed-length string at 0x2C, possibly a product ID? - /// "801400-001" in 4.84.00.0054 - /// "594130-001" in 4.84.69.0037 - /// "554900-001" in 4.84.76.7966 - /// "554900-001" in 4.84.76.7968 - /// "548520-001" in 4.85.07.0009 - /// - public byte[] Unknown14h; - - /// - /// Entry table - /// - public SecuROMAddDEntry[] Entries; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/SecuROMAddDEntry.cs b/BinaryObjectScanner.Models/PortableExecutable/SecuROMAddDEntry.cs deleted file mode 100644 index f6e453a6..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/SecuROMAddDEntry.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Overlay data associated with SecuROM executables - /// - /// - /// All information in this file has been researched in a clean room - /// environment by using sample from legally obtained software that - /// is protected by SecuROM. - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class SecuROMAddDEntry - { - /// - /// Physical offset of the embedded file - /// - public uint PhysicalOffset; - - /// - /// Length of the embedded file - /// - /// The last entry seems to be 4 bytes short in 4.47.00.0039 - public uint Length; - - /// - /// Unknown (0x08) - /// - /// 3149224 [3496, 48] in the sample (all 3 entries) in 4.47.00.0039 - public uint Unknown08h; - - /// - /// Unknown (0x0C) - /// - /// 3147176 [1448, 48] in the sample (all 3 entries) in 4.47.00.0039 - public uint Unknown0Ch; - - /// - /// Unknown (0x10) - /// - /// 3149224 [3496, 48] in the sample (all 3 entries) in 4.47.00.0039 - public uint Unknown10h; - - /// - /// Unknown (0x14) - /// - /// 1245044 [65396, 18] in the sample (all 3 entries) in 4.47.00.0039 - public uint Unknown14h; - - /// - /// Unknown (0x18) - /// - /// 4214725 [20421, 64] in the sample (all 3 entries) in 4.47.00.0039 - public uint Unknown18h; - - /// - /// Unknown (0x1C) - /// - /// 2 [2, 0] in the sample (all 3 entries) in 4.47.00.0039 - public uint Unknown1Ch; - - /// - /// Entry file name (null-terminated) - /// - /// 12 bytes long in the sample (all 3 entries) in 4.47.00.0039 - public string FileName; - - /// - /// Unknown (0x2C) - /// - /// - /// Offset based on consistent-sized filenames (12 bytes) in 4.47.00.0039 - /// 132 [132, 0] in the sample (all 3 entries) in 4.47.00.0039 - /// - public uint Unknown2Ch; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/StringData.cs b/BinaryObjectScanner.Models/PortableExecutable/StringData.cs deleted file mode 100644 index a64ca77f..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/StringData.cs +++ /dev/null @@ -1,79 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Represents the organization of data in a file-version resource. It contains a string - /// that describes a specific aspect of a file, for example, a file's version, its - /// copyright notices, or its trademarks. - /// - /// - public sealed class StringData - { - /// - /// The length, in bytes, of this String structure. - /// - public ushort Length; - - /// - /// The size, in words, of the Value member. - /// - public ushort ValueLength; - - /// - /// The type of data in the version resource. - /// - public VersionResourceType ResourceType; - - /// - /// An arbitrary Unicode string. The Key member can be one or more of the following - /// values. These values are guidelines only. - /// - Comments: The Value member contains any additional information that should be - /// displayed for diagnostic purposes. This string can be an arbitrary length. - /// - CompanyName: The Value member identifies the company that produced the file. - /// For example, "Microsoft Corporation" or "Standard Microsystems Corporation, Inc." - /// - FileDescription: The Value member describes the file in such a way that it can be - /// presented to users. This string may be presented in a list box when the user is - /// choosing files to install. For example, "Keyboard driver for AT-style keyboards" - /// or "Microsoft Word for Windows". - /// - FileVersion: The Value member identifies the version of this file. For example, - /// Value could be "3.00A" or "5.00.RC2". - /// - InternalName: The Value member identifies the file's internal name, if one exists. - /// For example, this string could contain the module name for a DLL, a virtual device - /// name for a Windows virtual device, or a device name for a MS-DOS device driver. - /// - LegalCopyright: The Value member describes all copyright notices, trademarks, and - /// registered trademarks that apply to the file. This should include the full text of - /// all notices, legal symbols, copyright dates, trademark numbers, and so on. In - /// English, this string should be in the format "Copyright Microsoft Corp. 1990 1994". - /// - LegalTrademarks: The Value member describes all trademarks and registered trademarks - /// that apply to the file. This should include the full text of all notices, legal - /// symbols, trademark numbers, and so on. In English, this string should be in the - /// format "Windows is a trademark of Microsoft Corporation". - /// - OriginalFilename: The Value member identifies the original name of the file, not - /// including a path. This enables an application to determine whether a file has been - /// renamed by a user. This name may not be MS-DOS 8.3-format if the file is specific - /// to a non-FAT file system. - /// - PrivateBuild: The Value member describes by whom, where, and why this private version - /// of the file was built. This string should only be present if the VS_FF_PRIVATEBUILD - /// flag is set in the dwFileFlags member of the VS_FIXEDFILEINFO structure. For example, - /// Value could be "Built by OSCAR on \OSCAR2". - /// - ProductName: The Value member identifies the name of the product with which this file is - /// distributed. For example, this string could be "Microsoft Windows". - /// - ProductVersion: The Value member identifies the version of the product with which this - /// file is distributed. For example, Value could be "3.00A" or "5.00.RC2". - /// - SpecialBuild: The Value member describes how this version of the file differs from the - /// normal version. This entry should only be present if the VS_FF_SPECIALBUILD flag is - /// set in the dwFileFlags member of the VS_FIXEDFILEINFO structure. For example, Value - /// could be "Private build for Olivetti solving mouse problems on M250 and M250E computers". - /// - public string Key; - - /// - /// As many zero words as necessary to align the Value member on a 32-bit boundary. - /// - public ushort Padding; - - /// - /// A zero-terminated string. See the szKey member description for more information. - /// - public string Value; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/StringFileInfo.cs b/BinaryObjectScanner.Models/PortableExecutable/StringFileInfo.cs deleted file mode 100644 index 2790ef9e..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/StringFileInfo.cs +++ /dev/null @@ -1,43 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Represents the organization of data in a file-version resource. It contains version - /// information that can be displayed for a particular language and code page. - /// - /// - public sealed class StringFileInfo - { - /// - /// The length, in bytes, of the entire StringFileInfo block, including all - /// structures indicated by the Children member. - /// - public ushort Length; - - /// - /// This member is always equal to zero. - /// - public ushort ValueLength; - - /// - /// The type of data in the version resource. - /// - public VersionResourceType ResourceType; - - /// - /// The Unicode string L"StringFileInfo". - /// - public string Key; - - /// - /// As many zero words as necessary to align the Children member on a 32-bit boundary. - /// - public ushort Padding; - - /// - /// An array of one or more StringTable structures. Each StringTable structure's Key - /// member indicates the appropriate language and code page for displaying the text in - /// that StringTable structure. - /// - public StringTable[] Children; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/StringTable.cs b/BinaryObjectScanner.Models/PortableExecutable/StringTable.cs deleted file mode 100644 index a7cad20e..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/StringTable.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Represents the organization of data in a file-version resource. It contains language - /// and code page formatting information for the strings specified by the Children member. - /// A code page is an ordered character set. - /// - /// - public sealed class StringTable - { - /// - /// The length, in bytes, of this StringTable structure, including all structures - /// indicated by the Children member. - /// - public ushort Length; - - /// - /// This member is always equal to zero. - /// - public ushort ValueLength; - - /// - /// The type of data in the version resource. - /// - public VersionResourceType ResourceType; - - /// - /// An 8-digit hexadecimal number stored as a Unicode string. The four most significant - /// digits represent the language identifier. The four least significant digits represent - /// the code page for which the data is formatted. Each Microsoft Standard Language - /// identifier contains two parts: the low-order 10 bits specify the major language, - /// and the high-order 6 bits specify the sublanguage. - /// - public string Key; - - /// - /// As many zero words as necessary to align the Children member on a 32-bit boundary. - /// - public ushort Padding; - - /// - /// An array of one or more StringData structures. - /// - public StringData[] Children; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/TLSDirectory.cs b/BinaryObjectScanner.Models/PortableExecutable/TLSDirectory.cs deleted file mode 100644 index ba54c9fe..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/TLSDirectory.cs +++ /dev/null @@ -1,96 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - public sealed class TLSDirectory - { - #region RawDataStartVA - - /// - /// The starting address of the TLS template. The template is a block of data - /// that is used to initialize TLS data. The system copies all of this data - /// each time a thread is created, so it must not be corrupted. Note that this - /// address is not an RVA; it is an address for which there should be a base - /// relocation in the .reloc section. - /// - public uint RawDataStartVA_PE32; - - /// - /// The starting address of the TLS template. The template is a block of data - /// that is used to initialize TLS data. The system copies all of this data - /// each time a thread is created, so it must not be corrupted. Note that this - /// address is not an RVA; it is an address for which there should be a base - /// relocation in the .reloc section. - /// - public ulong RawDataStartVA_PE32Plus; - - #endregion - - #region RawDataEndVA - - /// - /// The address of the last byte of the TLS, except for the zero fill. As - /// with the Raw Data Start VA field, this is a VA, not an RVA. - /// - public uint RawDataEndVA_PE32; - - /// - /// The address of the last byte of the TLS, except for the zero fill. As - /// with the Raw Data Start VA field, this is a VA, not an RVA. - /// - public ulong RawDataEndVA_PE32Plus; - - #endregion - - #region AddressOfIndex - - /// - /// The location to receive the TLS index, which the loader assigns. This - /// location is in an ordinary data section, so it can be given a symbolic - /// name that is accessible to the program. - /// - public uint AddressOfIndex_PE32; - - /// - /// The location to receive the TLS index, which the loader assigns. This - /// location is in an ordinary data section, so it can be given a symbolic - /// name that is accessible to the program. - /// - public ulong AddressOfIndex_PE32Plus; - - #endregion - - #region AddressOfCallbacks - - /// - /// The pointer to an array of TLS callback functions. The array is - /// null-terminated, so if no callback function is supported, this field - /// points to 4 bytes set to zero. - /// - public uint AddressOfCallbacks_PE32; - - /// - /// The pointer to an array of TLS callback functions. The array is - /// null-terminated, so if no callback function is supported, this field - /// points to 4 bytes set to zero. - /// - public ulong AddressOfCallbacks_PE32Plus; - - #endregion - - /// - /// The size in bytes of the template, beyond the initialized data delimited - /// by the Raw Data Start VA and Raw Data End VA fields. The total template - /// size should be the same as the total size of TLS data in the image file. - /// The zero fill is the amount of data that comes after the initialized - /// nonzero data. - /// - public uint SizeOfZeroFill; - - /// - /// The four bits [23:20] describe alignment info. Possible values are those - /// defined as IMAGE_SCN_ALIGN_*, which are also used to describe alignment - /// of section in object files. The other 28 bits are reserved for future use. - /// - public uint Characteristics; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/VarData.cs b/BinaryObjectScanner.Models/PortableExecutable/VarData.cs deleted file mode 100644 index 7c25896f..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/VarData.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Represents the organization of data in a file-version resource. It typically contains a - /// list of language and code page identifier pairs that the version of the application or - /// DLL supports. - /// - /// - public sealed class VarData - { - /// - /// The length, in bytes, of the Var structure. - /// - public ushort Length; - - /// - /// The size, in words, of the Value member. - /// - public ushort ValueLength; - - /// - /// The type of data in the version resource. - /// - public VersionResourceType ResourceType; - - /// - /// The Unicode string L"Translation". - /// - public string Key; - - /// - /// As many zero words as necessary to align the Value member on a 32-bit boundary. - /// - public ushort Padding; - - /// - /// An array of one or more values that are language and code page identifier pairs. - /// - /// If you use the Var structure to list the languages your application or DLL supports - /// instead of using multiple version resources, use the Value member to contain an array - /// of DWORD values indicating the language and code page combinations supported by this - /// file. The low-order word of each DWORD must contain a Microsoft language identifier, - /// and the high-order word must contain the IBM code page number. Either high-order or - /// low-order word can be zero, indicating that the file is language or code page - /// independent. If the Var structure is omitted, the file will be interpreted as both - /// language and code page independent. - /// - public uint[] Value; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/VarFileInfo.cs b/BinaryObjectScanner.Models/PortableExecutable/VarFileInfo.cs deleted file mode 100644 index 846639cd..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/VarFileInfo.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Represents the organization of data in a file-version resource. It contains version - /// information not dependent on a particular language and code page combination. - /// - /// - public sealed class VarFileInfo - { - /// - /// The length, in bytes, of the entire VarFileInfo block, including all structures - /// indicated by the Children member. - /// - public ushort Length; - - /// - /// This member is always equal to zero. - /// - public ushort ValueLength; - - /// - /// The type of data in the version resource. - /// - public VersionResourceType ResourceType; - - /// - /// The Unicode string L"VarFileInfo". - /// - public string Key; - - /// - /// As many zero words as necessary to align the Children member on a 32-bit boundary. - /// - public ushort Padding; - - /// - /// Typically contains a list of languages that the application or DLL supports. - /// - public VarData[] Children; - } -} diff --git a/BinaryObjectScanner.Models/PortableExecutable/VersionInfo.cs b/BinaryObjectScanner.Models/PortableExecutable/VersionInfo.cs deleted file mode 100644 index f2f8997b..00000000 --- a/BinaryObjectScanner.Models/PortableExecutable/VersionInfo.cs +++ /dev/null @@ -1,61 +0,0 @@ -namespace BinaryObjectScanner.Models.PortableExecutable -{ - /// - /// Represents the organization of data in a file-version resource. It is the root - /// structure that contains all other file-version information structures. - /// - /// - public sealed class VersionInfo - { - /// - /// The length, in bytes, of the VS_VERSIONINFO structure. This length does not - /// include any padding that aligns any subsequent version resource data on a - /// 32-bit boundary. - /// - public ushort Length; - - /// - /// The length, in bytes, of the Value member. This value is zero if there is no - /// Value member associated with the current version structure. - /// - public ushort ValueLength; - - /// - /// The type of data in the version resource. This member is 1 if the version resource - /// contains text data and 0 if the version resource contains binary data. - /// - public VersionResourceType ResourceType; - - /// - /// The Unicode string L"VS_VERSION_INFO". - /// - public string Key; - - /// - /// Contains as many zero words as necessary to align the Value member on a 32-bit boundary. - /// - public ushort Padding1; - - /// - /// Arbitrary data associated with this VS_VERSIONINFO structure. The ValueLength member - /// specifies the length of this member; if ValueLength is zero, this member does not exist. - /// - public FixedFileInfo Value; - - /// - /// As many zero words as necessary to align the Children member on a 32-bit boundary. - /// These bytes are not included in wValueLength. This member is optional. - /// - public ushort Padding2; - - /// - /// The StringFileInfo structure to store user-defined string information data. - /// - public StringFileInfo StringFileInfo; - - /// - /// The VarFileInfo structure to store language information data. - /// - public VarFileInfo VarFileInfo; - } -} diff --git a/BinaryObjectScanner.Models/Quantum/Archive.cs b/BinaryObjectScanner.Models/Quantum/Archive.cs deleted file mode 100644 index 6b0798ab..00000000 --- a/BinaryObjectScanner.Models/Quantum/Archive.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace BinaryObjectScanner.Models.Quantum -{ - /// - /// Quantum archive file structure - /// - /// - public class Archive - { - /// - /// Quantum header - /// - public Header Header { get; set; } - - /// - /// This is immediately followed by the list of files - /// - public FileDescriptor[] FileList { get; set; } - - /// - /// Immediately following the list of files is the compressed data - /// - public long CompressedDataOffset { get; set; } - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Quantum/Constants.cs b/BinaryObjectScanner.Models/Quantum/Constants.cs deleted file mode 100644 index 37298a5e..00000000 --- a/BinaryObjectScanner.Models/Quantum/Constants.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.Quantum -{ - public static class Constants - { - public static readonly byte[] SignatureBytes = new byte[] { 0x44, 0x53 }; - - public const string SignatureString = "DS"; - - public const ushort SignatureUInt16 = 0x5344; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Quantum/FileDescriptor.cs b/BinaryObjectScanner.Models/Quantum/FileDescriptor.cs deleted file mode 100644 index 5f90b9dd..00000000 --- a/BinaryObjectScanner.Models/Quantum/FileDescriptor.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace BinaryObjectScanner.Models.Quantum -{ - /// - /// Quantum archive file descriptor - /// - /// - public class FileDescriptor - { - /// - /// Length of file name - /// - public int FileNameSize; - - /// - /// File name, variable length string, not zero-terminated - /// - public string FileName; - - /// - /// Length of comment field - /// - public int CommentFieldSize; - - /// - /// Comment field, variable length string, not zero-terminated - /// - public string CommentField; - - /// - /// Fully expanded file size in bytes - /// - public uint ExpandedFileSize; - - /// - /// File time (DOS format) - /// - public ushort FileTime; - - /// - /// File date (DOS format) - /// - public ushort FileDate; - - /// - /// Unknown data, Checksum? - /// - /// Minor version 22 - public ushort? Unknown; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/Quantum/Header.cs b/BinaryObjectScanner.Models/Quantum/Header.cs deleted file mode 100644 index c84539a0..00000000 --- a/BinaryObjectScanner.Models/Quantum/Header.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.Quantum -{ - /// - /// Quantum archive file header - /// - /// - [StructLayout(LayoutKind.Sequential)] - public class Header - { - /// - /// Quantum signature: 0x44 0x53 - /// - public string Signature; - - /// - /// Quantum major version number - /// - public byte MajorVersion; - - /// - /// Quantum minor version number - /// - public byte MinorVersion; - - /// - /// Number of files within this archive - /// - public ushort FileCount; - - /// - /// Table size required for decompression - /// - public byte TableSize; - - /// - /// Compression flags - /// - public byte CompressionFlags; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/SFFS/Constants.cs b/BinaryObjectScanner.Models/SFFS/Constants.cs deleted file mode 100644 index 82035a31..00000000 --- a/BinaryObjectScanner.Models/SFFS/Constants.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.SFFS -{ - public static class Constants - { - public static readonly byte[] SignatureBytes = new byte[] { 0x53, 0x46, 0x46, 0x53 }; - - public const string SignatureString = "SFFS"; - - public const uint SignatureUInt32 = 0x53464653; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/SFFS/FileEntry.cs b/BinaryObjectScanner.Models/SFFS/FileEntry.cs deleted file mode 100644 index 5ea043c8..00000000 --- a/BinaryObjectScanner.Models/SFFS/FileEntry.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.SFFS -{ - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class FileEntry - { - /// - /// MD5 hash of filename (not encrypted,) - /// - /// 0x10 bytes - public byte[] FilenameMD5Hash; - - /// - /// Index of fileheader (encrypted with filename) - /// - public ulong FileHeaderIndex; - } -} diff --git a/BinaryObjectScanner.Models/SFFS/FileHeader.cs b/BinaryObjectScanner.Models/SFFS/FileHeader.cs deleted file mode 100644 index cbff3c84..00000000 --- a/BinaryObjectScanner.Models/SFFS/FileHeader.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.SFFS -{ - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class FileHeader - { - /// - /// Start of file content (encrypted with filename) - /// - public ulong FileContentStart; - - /// - /// File info (timestamps, size, data position, encrypted) - /// - /// Unknown format - public byte[] FileInfo; - } -} diff --git a/BinaryObjectScanner.Models/SFFS/Header.cs b/BinaryObjectScanner.Models/SFFS/Header.cs deleted file mode 100644 index 2c366f71..00000000 --- a/BinaryObjectScanner.Models/SFFS/Header.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Runtime.InteropServices; - -namespace BinaryObjectScanner.Models.SFFS -{ - /// - /// Header - /// - /// - [StructLayout(LayoutKind.Sequential)] - public sealed class Header - { - /// - /// "SFFS" - /// - public uint Magic; - - /// - /// Version (0x00000001) - /// - public uint Version; - - /// - /// Number of files in the container (encrypted with application key). - /// Minimal number here is usually 65h, so its not real file count - /// in some cases, more like index size - /// - public ulong FileCount; - } -} diff --git a/BinaryObjectScanner.Models/SFFS/StarForceFileSystem.cs b/BinaryObjectScanner.Models/SFFS/StarForceFileSystem.cs deleted file mode 100644 index 5bfdb316..00000000 --- a/BinaryObjectScanner.Models/SFFS/StarForceFileSystem.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace BinaryObjectScanner.Models.SFFS -{ - /// - /// SFFS consists of 2 major parts: the container files that contain the game - /// content and a filesystem filter driver (sfvfs02.sys) that handles all file-io. - /// When a game has SFFS'ed files and uses some file-io api like CreateFile, the - /// SFFS filterdriver sees this request and handles it if needed.that way, SFFS is - /// totally transparent to the game, since it never knows if the data is coming from - /// real file API or from the SFFS filterdriver. during SF initialization, the - /// SF-process registers itself as a SFFS process in a processid list, maintained - /// from the filterdriver. Part of that registration are the names of the - /// containerfiles, the process uses and an application key, that is needed to - /// decrypt headerinfos. Note that SFFS itself is completly vm-free. - /// - /// - public sealed class StarForceFileSystem - { - /// - /// Header - /// - public Header Header { get; set; } - - /// - /// Files - /// - public FileEntry[] Files { get; set; } - - /// - /// File headers - /// - public FileHeader[] FileHeaders { get; set; } - } -} diff --git a/BinaryObjectScanner.Models/SGA/Constants.cs b/BinaryObjectScanner.Models/SGA/Constants.cs deleted file mode 100644 index 8153c55e..00000000 --- a/BinaryObjectScanner.Models/SGA/Constants.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - public static class Constants - { - public static readonly byte[] SignatureBytes = new byte[] { 0x5f, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45 }; - - public const string SignatureString = "_ARCHIVE"; - - public const ulong SignatureUInt64 = 0x455649484352415f; - - /// - /// Length of a SGA checksum in bytes - /// - public const int HL_SGA_CHECKSUM_LENGTH = 0x00008000; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/SGA/Directory.cs b/BinaryObjectScanner.Models/SGA/Directory.cs deleted file mode 100644 index 808a8f73..00000000 --- a/BinaryObjectScanner.Models/SGA/Directory.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public abstract class Directory { } -} diff --git a/BinaryObjectScanner.Models/SGA/Directory4.cs b/BinaryObjectScanner.Models/SGA/Directory4.cs deleted file mode 100644 index 4938e10b..00000000 --- a/BinaryObjectScanner.Models/SGA/Directory4.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public sealed class Directory4 : SpecializedDirectory { } -} diff --git a/BinaryObjectScanner.Models/SGA/Directory5.cs b/BinaryObjectScanner.Models/SGA/Directory5.cs deleted file mode 100644 index c08910c9..00000000 --- a/BinaryObjectScanner.Models/SGA/Directory5.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public sealed class Directory5 : SpecializedDirectory { } -} diff --git a/BinaryObjectScanner.Models/SGA/Directory6.cs b/BinaryObjectScanner.Models/SGA/Directory6.cs deleted file mode 100644 index dc548ad0..00000000 --- a/BinaryObjectScanner.Models/SGA/Directory6.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public sealed class Directory6 : SpecializedDirectory { } -} diff --git a/BinaryObjectScanner.Models/SGA/Directory7.cs b/BinaryObjectScanner.Models/SGA/Directory7.cs deleted file mode 100644 index 6cfc5787..00000000 --- a/BinaryObjectScanner.Models/SGA/Directory7.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public sealed class Directory7 : SpecializedDirectory { } -} diff --git a/BinaryObjectScanner.Models/SGA/DirectoryHeader.cs b/BinaryObjectScanner.Models/SGA/DirectoryHeader.cs deleted file mode 100644 index 9b496fb7..00000000 --- a/BinaryObjectScanner.Models/SGA/DirectoryHeader.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public abstract class DirectoryHeader - { - public uint SectionOffset; - - public T SectionCount; - - public uint FolderOffset; - - public T FolderCount; - - public uint FileOffset; - - public T FileCount; - - public uint StringTableOffset; - - public T StringTableCount; - } -} diff --git a/BinaryObjectScanner.Models/SGA/DirectoryHeader4.cs b/BinaryObjectScanner.Models/SGA/DirectoryHeader4.cs deleted file mode 100644 index 7b293b7e..00000000 --- a/BinaryObjectScanner.Models/SGA/DirectoryHeader4.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public sealed class DirectoryHeader4 : DirectoryHeader { } -} diff --git a/BinaryObjectScanner.Models/SGA/DirectoryHeader5.cs b/BinaryObjectScanner.Models/SGA/DirectoryHeader5.cs deleted file mode 100644 index 0d43239c..00000000 --- a/BinaryObjectScanner.Models/SGA/DirectoryHeader5.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public class DirectoryHeader5 : DirectoryHeader { } -} diff --git a/BinaryObjectScanner.Models/SGA/DirectoryHeader7.cs b/BinaryObjectScanner.Models/SGA/DirectoryHeader7.cs deleted file mode 100644 index 7105b21f..00000000 --- a/BinaryObjectScanner.Models/SGA/DirectoryHeader7.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public sealed class DirectoryHeader7 : DirectoryHeader5 - { - public uint HashTableOffset; - - public uint BlockSize; - } -} diff --git a/BinaryObjectScanner.Models/SGA/File.cs b/BinaryObjectScanner.Models/SGA/File.cs deleted file mode 100644 index 380f2d92..00000000 --- a/BinaryObjectScanner.Models/SGA/File.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - /// SGA game archive - /// - /// - public sealed class File - { - /// - ///Header data - /// - public Header Header { get; set; } - - /// - /// Directory data - /// - public Directory Directory { get; set; } - } -} diff --git a/BinaryObjectScanner.Models/SGA/File4.cs b/BinaryObjectScanner.Models/SGA/File4.cs deleted file mode 100644 index 2089610f..00000000 --- a/BinaryObjectScanner.Models/SGA/File4.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public class File4 - { - public uint NameOffset; - - public string Name; - - public uint Offset; - - public uint SizeOnDisk; - - public uint Size; - - public uint TimeModified; - - public byte Dummy0; - - public byte Type; - } -} diff --git a/BinaryObjectScanner.Models/SGA/File6.cs b/BinaryObjectScanner.Models/SGA/File6.cs deleted file mode 100644 index 64c0e371..00000000 --- a/BinaryObjectScanner.Models/SGA/File6.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public class File6 : File4 - { - public uint CRC32; - } -} diff --git a/BinaryObjectScanner.Models/SGA/File7.cs b/BinaryObjectScanner.Models/SGA/File7.cs deleted file mode 100644 index 2dd27760..00000000 --- a/BinaryObjectScanner.Models/SGA/File7.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public sealed class File7 : File6 - { - public uint HashOffset; - } -} diff --git a/BinaryObjectScanner.Models/SGA/FileHeader.cs b/BinaryObjectScanner.Models/SGA/FileHeader.cs deleted file mode 100644 index b807cf8c..00000000 --- a/BinaryObjectScanner.Models/SGA/FileHeader.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public sealed class FileHeader - { - public string Name; - - public uint CRC32; - } -} diff --git a/BinaryObjectScanner.Models/SGA/Folder.cs b/BinaryObjectScanner.Models/SGA/Folder.cs deleted file mode 100644 index c1aade3f..00000000 --- a/BinaryObjectScanner.Models/SGA/Folder.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public abstract class Folder - { - public uint NameOffset; - - public string Name; - - public T FolderStartIndex; - - public T FolderEndIndex; - - public T FileStartIndex; - - public T FileEndIndex; - } -} diff --git a/BinaryObjectScanner.Models/SGA/Folder4.cs b/BinaryObjectScanner.Models/SGA/Folder4.cs deleted file mode 100644 index 5c689a34..00000000 --- a/BinaryObjectScanner.Models/SGA/Folder4.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public sealed class Folder4 : Folder { } -} diff --git a/BinaryObjectScanner.Models/SGA/Folder5.cs b/BinaryObjectScanner.Models/SGA/Folder5.cs deleted file mode 100644 index 8013ef03..00000000 --- a/BinaryObjectScanner.Models/SGA/Folder5.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public sealed class Folder5 : Folder { } -} diff --git a/BinaryObjectScanner.Models/SGA/Header.cs b/BinaryObjectScanner.Models/SGA/Header.cs deleted file mode 100644 index cb4557f0..00000000 --- a/BinaryObjectScanner.Models/SGA/Header.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public abstract class Header - { - public string Signature; - - public ushort MajorVersion; - - public ushort MinorVersion; - } -} diff --git a/BinaryObjectScanner.Models/SGA/Header4.cs b/BinaryObjectScanner.Models/SGA/Header4.cs deleted file mode 100644 index 5fbe0485..00000000 --- a/BinaryObjectScanner.Models/SGA/Header4.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public sealed class Header4 : Header - { - public byte[] FileMD5; - - public string Name; - - public byte[] HeaderMD5; - - public uint HeaderLength; - - public uint FileDataOffset; - - public uint Dummy0; - } -} diff --git a/BinaryObjectScanner.Models/SGA/Header6.cs b/BinaryObjectScanner.Models/SGA/Header6.cs deleted file mode 100644 index 10e99b49..00000000 --- a/BinaryObjectScanner.Models/SGA/Header6.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public sealed class Header6 : Header - { - public string Name; - - public uint HeaderLength; - - public uint FileDataOffset; - - public uint Dummy0; - } -} diff --git a/BinaryObjectScanner.Models/SGA/Section.cs b/BinaryObjectScanner.Models/SGA/Section.cs deleted file mode 100644 index a96c2217..00000000 --- a/BinaryObjectScanner.Models/SGA/Section.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public abstract class Section - { - public string Alias; - - public string Name; - - public T FolderStartIndex; - - public T FolderEndIndex; - - public T FileStartIndex; - - public T FileEndIndex; - - public T FolderRootIndex; - } -} diff --git a/BinaryObjectScanner.Models/SGA/Section4.cs b/BinaryObjectScanner.Models/SGA/Section4.cs deleted file mode 100644 index 2876814b..00000000 --- a/BinaryObjectScanner.Models/SGA/Section4.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public sealed class Section4 : Section { } -} diff --git a/BinaryObjectScanner.Models/SGA/Section5.cs b/BinaryObjectScanner.Models/SGA/Section5.cs deleted file mode 100644 index 0a504c3d..00000000 --- a/BinaryObjectScanner.Models/SGA/Section5.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace BinaryObjectScanner.Models.SGA -{ - /// - public sealed class Section5 : Section { } -} diff --git a/BinaryObjectScanner.Models/SGA/SpecializedDirectory.cs b/BinaryObjectScanner.Models/SGA/SpecializedDirectory.cs deleted file mode 100644 index 58cf0c43..00000000 --- a/BinaryObjectScanner.Models/SGA/SpecializedDirectory.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Collections.Generic; - -namespace BinaryObjectScanner.Models.SGA -{ - /// - /// Specialization File7 and up where the CRC moved to the header and the CRC is of the compressed data and there are stronger hashes. - /// - /// - public class SpecializedDirectory : Directory - where THeader : Header - where TDirectoryHeader : DirectoryHeader - where TSection : Section - where TFolder : Folder - where TFile : File4 - { - /// - /// Source SGA file - /// - public File File { get; set; } - - /// - /// Directory header data - /// - public TDirectoryHeader DirectoryHeader { get; set; } - - /// - /// Sections data - /// - public TSection[] Sections { get; set; } - - /// - /// Folders data - /// - public TFolder[] Folders { get; set; } - - /// - /// Files data - /// - public TFile[] Files { get; set; } - - /// - /// String table data - /// - public Dictionary StringTable { get; set; } - } -} diff --git a/BinaryObjectScanner.Models/TAR/Archive.cs b/BinaryObjectScanner.Models/TAR/Archive.cs deleted file mode 100644 index ef6f1cd5..00000000 --- a/BinaryObjectScanner.Models/TAR/Archive.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace BinaryObjectScanner.Models.TAR -{ - public sealed class Archive - { - /// - /// File header - /// - public Header Header { get; set; } - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/TAR/Enums.cs b/BinaryObjectScanner.Models/TAR/Enums.cs deleted file mode 100644 index 6d2f72a0..00000000 --- a/BinaryObjectScanner.Models/TAR/Enums.cs +++ /dev/null @@ -1,157 +0,0 @@ -using System; - -namespace BinaryObjectScanner.Models.TAR -{ - [Flags] - public enum Mode : ushort - { - /// - /// Execute/search by other - /// - TOEXEC = 0x0001, - - /// - /// Write by other - /// - TOWRITE = 0x0002, - - /// - /// Read by other - /// - TOREAD = 0x0004, - - /// - /// Execute/search by group - /// - TGEXEC = 0x0008, - - /// - /// Write by group - /// - TGWRITE = 0x0010, - - /// - /// Read by group - /// - TGREAD = 0x0020, - - /// - /// Execute/search by owner - /// - TUEXEC = 0x0040, - - /// - /// Write by owner - /// - TUWRITE = 0x0080, - - /// - /// Read by owner - /// - TUREAD = 0x0100, - - /// - /// Reserved - /// - TSVTX = 0x0200, - - /// - /// Set GID on execution - /// - TSGID = 0x0400, - - /// - /// Set UID on execution - /// - TSUID = 0x0800, - } - - public enum TypeFlag : byte - { - /// - /// Regular file - /// - REGTYPE = (byte)'0', - - /// - /// Regular file - /// - AREGTYPE = 0, - - /// - /// Hard link - /// - LNKTYPE = (byte)'1', - - /// - /// Symbolic link - /// - SYMTYPE = (byte)'2', - - /// - /// Character special - /// - CHRTYPE = (byte)'3', - - /// - /// Block special - /// - BLKTYPE = (byte)'4', - - /// - /// Directory - /// - DIRTYPE = (byte)'5', - - /// - /// FIFO - /// - FIFOTYPE = (byte)'6', - - /// - /// Contiguous file - /// - CONTTYPE = (byte)'7', - - /// - /// Global extended header with meta data (POSIX.1-2001) - /// - XHDTYPE = (byte)'g', - - /// - /// Extended header with metadata for the next file in the archive (POSIX.1-2001) - /// - XGLTYPE = (byte)'x', - - #region Vendor-Specific Extensions (POSIX.1-1988) - - VendorSpecificA = (byte)'A', - VendorSpecificB = (byte)'B', - VendorSpecificC = (byte)'C', - VendorSpecificD = (byte)'D', - VendorSpecificE = (byte)'E', - VendorSpecificF = (byte)'F', - VendorSpecificG = (byte)'G', - VendorSpecificH = (byte)'H', - VendorSpecificI = (byte)'I', - VendorSpecificJ = (byte)'J', - VendorSpecificK = (byte)'K', - VendorSpecificL = (byte)'L', - VendorSpecificM = (byte)'M', - VendorSpecificN = (byte)'N', - VendorSpecificO = (byte)'O', - VendorSpecificP = (byte)'P', - VendorSpecificQ = (byte)'Q', - VendorSpecificR = (byte)'R', - VendorSpecificS = (byte)'S', - VendorSpecificT = (byte)'T', - VendorSpecificU = (byte)'U', - VendorSpecificV = (byte)'V', - VendorSpecificW = (byte)'W', - VendorSpecificX = (byte)'X', - VendorSpecificY = (byte)'Y', - VendorSpecificZ = (byte)'Z', - - #endregion - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/TAR/Header.cs b/BinaryObjectScanner.Models/TAR/Header.cs deleted file mode 100644 index fbe87449..00000000 --- a/BinaryObjectScanner.Models/TAR/Header.cs +++ /dev/null @@ -1,85 +0,0 @@ -namespace BinaryObjectScanner.Models.TAR -{ - public sealed class Header - { - /// - /// File name - /// - public string FileName; - - /// - /// File mode - /// - public Mode Mode; - - /// - /// Owner's numeric user ID - /// - public uint UID; - - /// - /// Owner's numeric user ID - /// - public uint GID; - - /// - /// File size in bytes - /// - public ulong Size; - - /// - /// Last modification time in numeric Unix time format - /// - public ulong ModifiedTime; - - /// - /// Checksum for header record - /// - public ushort Checksum; - - /// - /// Link indicator (file type) / Type flag - /// - public TypeFlag TypeFlag; - - /// - /// Name of linked file - /// - public string LinkName; - - /// - /// UStar indicator, "ustar", then NUL - /// - public string Magic; - - /// - /// UStar version, "00" - /// - public string Version; - - /// - /// Owner user name - /// - public string UserName; - - /// - /// Owner group name - /// - public string GroupName; - - /// - /// Device major number - /// - public string DevMajor; - - /// - /// Device minor number - /// - public string DevMinor; - - /// - /// Filename prefix - /// - public string Prefix; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/VBSP/Constants.cs b/BinaryObjectScanner.Models/VBSP/Constants.cs deleted file mode 100644 index c64490c1..00000000 --- a/BinaryObjectScanner.Models/VBSP/Constants.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace BinaryObjectScanner.Models.VBSP -{ - public static class Constants - { - public static readonly byte[] SignatureBytes = new byte[] { 0x56, 0x42, 0x53, 0x50 }; - - public const string SignatureString = "VBSP"; - - public const uint SignatureUInt32 = 0x50534256; - - /// - /// Total number of lumps in the package - /// - public const int HL_VBSP_LUMP_COUNT = 64; - - /// - /// Index for the entities lump - /// - public const int HL_VBSP_LUMP_ENTITIES = 0; - - /// - /// Index for the pakfile lump - /// - public const int HL_VBSP_LUMP_PAKFILE = 40; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/VBSP/File.cs b/BinaryObjectScanner.Models/VBSP/File.cs deleted file mode 100644 index 55eb941d..00000000 --- a/BinaryObjectScanner.Models/VBSP/File.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace BinaryObjectScanner.Models.VBSP -{ - /// - /// Half-Life 2 Level - /// - /// - public sealed class File - { - /// - /// Directory header data - /// - public Header Header { get; set; } - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/VBSP/Header.cs b/BinaryObjectScanner.Models/VBSP/Header.cs deleted file mode 100644 index 44065373..00000000 --- a/BinaryObjectScanner.Models/VBSP/Header.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace BinaryObjectScanner.Models.VBSP -{ - /// - public sealed class Header - { - /// - /// BSP file signature. - /// - public string Signature; - - /// - /// BSP file version. - /// - /// - /// 19-20: Source - /// 21: Source - The lump version property was moved to the start of the struct. - /// 0x00040014: Dark Messiah - Looks like the 32 bit version has been split into two 16 bit fields. - /// - public int Version; - - /// - /// Lumps. - /// - public Lump[] Lumps; - - /// - /// The map's revision (iteration, version) number. - /// - public int MapRevision; - } -} diff --git a/BinaryObjectScanner.Models/VBSP/Lump.cs b/BinaryObjectScanner.Models/VBSP/Lump.cs deleted file mode 100644 index e083d11c..00000000 --- a/BinaryObjectScanner.Models/VBSP/Lump.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace BinaryObjectScanner.Models.VBSP -{ - /// - public sealed class Lump - { - public uint Offset; - - public uint Length; - - /// - /// Default to zero. - /// - public uint Version; - - /// - /// Default to (char)0, (char)0, (char)0, (char)0. - /// - public char[] FourCC; - } -} diff --git a/BinaryObjectScanner.Models/VBSP/LumpHeader.cs b/BinaryObjectScanner.Models/VBSP/LumpHeader.cs deleted file mode 100644 index 1c3a1303..00000000 --- a/BinaryObjectScanner.Models/VBSP/LumpHeader.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace BinaryObjectScanner.Models.VBSP -{ - /// - public sealed class LumpHeader - { - public int LumpOffset; - - public int LumpID; - - public int LumpVersion; - - public int LumpLength; - - public int MapRevision; - } -} diff --git a/BinaryObjectScanner.Models/VPK/ArchiveHash.cs b/BinaryObjectScanner.Models/VPK/ArchiveHash.cs deleted file mode 100644 index 6d02de36..00000000 --- a/BinaryObjectScanner.Models/VPK/ArchiveHash.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace BinaryObjectScanner.Models.VPK -{ - /// - public sealed class ArchiveHash - { - public uint ArchiveIndex; - - public uint ArchiveOffset; - - public uint Length; - - /// - /// MD5 - /// - public byte[] Hash; - } -} diff --git a/BinaryObjectScanner.Models/VPK/Constants.cs b/BinaryObjectScanner.Models/VPK/Constants.cs deleted file mode 100644 index 6450bd69..00000000 --- a/BinaryObjectScanner.Models/VPK/Constants.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace BinaryObjectScanner.Models.VPK -{ - public static class Constants - { - public static readonly byte[] SignatureBytes = new byte[] { 0x34, 0x12, 0xaa, 0x55 }; - - public static readonly string SignatureString = System.Text.Encoding.ASCII.GetString(SignatureBytes); - - public const uint SignatureUInt32 = 0x55aa1234; - - /// - /// Index indicating that there is no archive - /// - public const int HL_VPK_NO_ARCHIVE = 0x7fff; - - /// - /// Length of a VPK checksum in bytes - /// - public const int HL_VPK_CHECKSUM_LENGTH = 0x00008000; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/VPK/DirectoryEntry.cs b/BinaryObjectScanner.Models/VPK/DirectoryEntry.cs deleted file mode 100644 index 47cf3868..00000000 --- a/BinaryObjectScanner.Models/VPK/DirectoryEntry.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace BinaryObjectScanner.Models.VPK -{ - /// - public sealed class DirectoryEntry - { - public uint CRC; - - public ushort PreloadBytes; - - public ushort ArchiveIndex; - - public uint EntryOffset; - - public uint EntryLength; - - /// - /// Always 0xffff. - /// - public ushort Dummy0; - } -} diff --git a/BinaryObjectScanner.Models/VPK/DirectoryItem.cs b/BinaryObjectScanner.Models/VPK/DirectoryItem.cs deleted file mode 100644 index afebe320..00000000 --- a/BinaryObjectScanner.Models/VPK/DirectoryItem.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace BinaryObjectScanner.Models.VPK -{ - /// - public sealed class DirectoryItem - { - public string Extension; - - public string Path; - - public string Name; - - public DirectoryEntry DirectoryEntry; - - public byte[] PreloadData; - } -} diff --git a/BinaryObjectScanner.Models/VPK/ExtendedHeader.cs b/BinaryObjectScanner.Models/VPK/ExtendedHeader.cs deleted file mode 100644 index 3588049f..00000000 --- a/BinaryObjectScanner.Models/VPK/ExtendedHeader.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace BinaryObjectScanner.Models.VPK -{ - /// - /// Added in version 2. - /// - /// - public sealed class ExtendedHeader - { - /// - /// Reserved - /// - public uint Dummy0; - - /// - /// Archive hash length - /// - public uint ArchiveHashLength; - - /// - /// Looks like some more MD5 hashes. - /// - public uint ExtraLength; - - /// - /// Reserved - /// - public uint Dummy1; - } -} diff --git a/BinaryObjectScanner.Models/VPK/File.cs b/BinaryObjectScanner.Models/VPK/File.cs deleted file mode 100644 index 786a0b1a..00000000 --- a/BinaryObjectScanner.Models/VPK/File.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace BinaryObjectScanner.Models.VPK -{ - /// - /// Valve Package File - /// - /// - public sealed class File - { - /// - /// Header data - /// - public Header Header { get; set; } - - /// - /// Extended header data - /// - public ExtendedHeader ExtendedHeader { get; set; } - - /// - /// Archive hashes data - /// - public ArchiveHash[] ArchiveHashes { get; set; } - - /// - /// Directory items data - /// - public DirectoryItem[] DirectoryItems { get; set; } - } -} diff --git a/BinaryObjectScanner.Models/VPK/Header.cs b/BinaryObjectScanner.Models/VPK/Header.cs deleted file mode 100644 index f2f4b4c2..00000000 --- a/BinaryObjectScanner.Models/VPK/Header.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace BinaryObjectScanner.Models.VPK -{ - /// - public sealed class Header - { - /// - /// Always 0x55aa1234. - /// - public uint Signature; - - public uint Version; - - public uint DirectoryLength; - } -} diff --git a/BinaryObjectScanner.Models/WAD/Constants.cs b/BinaryObjectScanner.Models/WAD/Constants.cs deleted file mode 100644 index 6b42cdd8..00000000 --- a/BinaryObjectScanner.Models/WAD/Constants.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace BinaryObjectScanner.Models.WAD -{ - public static class Constants - { - public static readonly byte[] SignatureBytes = new byte[] { 0x57, 0x41, 0x44, 0x33 }; - - public const string SignatureString = "WAD3"; - - public const uint SignatureUInt32 = 0x33444157; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/WAD/File.cs b/BinaryObjectScanner.Models/WAD/File.cs deleted file mode 100644 index 921a809d..00000000 --- a/BinaryObjectScanner.Models/WAD/File.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace BinaryObjectScanner.Models.WAD -{ - /// - /// Half-Life Texture Package File - /// - /// - public sealed class File - { - /// - /// Deserialized header data - /// - public Header Header { get; set; } - - /// - /// Deserialized lumps data - /// - public Lump[] Lumps { get; set; } - - /// - /// Deserialized lump infos data - /// - public LumpInfo[] LumpInfos { get; set; } - } -} diff --git a/BinaryObjectScanner.Models/WAD/Header.cs b/BinaryObjectScanner.Models/WAD/Header.cs deleted file mode 100644 index a7287b40..00000000 --- a/BinaryObjectScanner.Models/WAD/Header.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace BinaryObjectScanner.Models.WAD -{ - /// - public sealed class Header - { - public string Signature; - - public uint LumpCount; - - public uint LumpOffset; - } -} diff --git a/BinaryObjectScanner.Models/WAD/Lump.cs b/BinaryObjectScanner.Models/WAD/Lump.cs deleted file mode 100644 index 9c9b5752..00000000 --- a/BinaryObjectScanner.Models/WAD/Lump.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace BinaryObjectScanner.Models.WAD -{ - /// - public sealed class Lump - { - public uint Offset; - - public uint DiskLength; - - public uint Length; - - public byte Type; - - public byte Compression; - - public byte Padding0; - - public byte Padding1; - - public string Name; - } -} diff --git a/BinaryObjectScanner.Models/WAD/LumpInfo.cs b/BinaryObjectScanner.Models/WAD/LumpInfo.cs deleted file mode 100644 index d7dd076f..00000000 --- a/BinaryObjectScanner.Models/WAD/LumpInfo.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace BinaryObjectScanner.Models.WAD -{ - /// - public sealed class LumpInfo - { - public string Name; - - public uint Width; - - public uint Height; - - public uint PixelOffset; - - // 12 bytes of unknown data - - public byte[] PixelData; - - public uint PaletteSize; - - public byte[] PaletteData; - } -} diff --git a/BinaryObjectScanner.Models/XZP/Constants.cs b/BinaryObjectScanner.Models/XZP/Constants.cs deleted file mode 100644 index c3aa92ec..00000000 --- a/BinaryObjectScanner.Models/XZP/Constants.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace BinaryObjectScanner.Models.XZP -{ - public static class Constants - { - public static readonly byte[] HeaderSignatureBytes = new byte[] { 0x70, 0x69, 0x5a, 0x78 }; - - public const string HeaderSignatureString = "piZx"; - - public const uint HeaderSignatureUInt32 = 0x785a6970; - - public static readonly byte[] FooterSignatureBytes = new byte[] { 0x74, 0x46, 0x7a, 0x58 }; - - public const string FooterSignatureString = "tFzX"; - - public const uint FooterSignatureUInt32 = 0x587a4674; - } -} \ No newline at end of file diff --git a/BinaryObjectScanner.Models/XZP/DirectoryEntry.cs b/BinaryObjectScanner.Models/XZP/DirectoryEntry.cs deleted file mode 100644 index 0d12124c..00000000 --- a/BinaryObjectScanner.Models/XZP/DirectoryEntry.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace BinaryObjectScanner.Models.XZP -{ - /// - public sealed class DirectoryEntry - { - public uint FileNameCRC; - - public uint EntryLength; - - public uint EntryOffset; - } -} diff --git a/BinaryObjectScanner.Models/XZP/DirectoryItem.cs b/BinaryObjectScanner.Models/XZP/DirectoryItem.cs deleted file mode 100644 index 7c45bba4..00000000 --- a/BinaryObjectScanner.Models/XZP/DirectoryItem.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace BinaryObjectScanner.Models.XZP -{ - /// - public sealed class DirectoryItem - { - public uint FileNameCRC; - - public uint NameOffset; - - public string Name; - - public uint TimeCreated; - } -} diff --git a/BinaryObjectScanner.Models/XZP/DirectoryMapping.cs b/BinaryObjectScanner.Models/XZP/DirectoryMapping.cs deleted file mode 100644 index 64014d5f..00000000 --- a/BinaryObjectScanner.Models/XZP/DirectoryMapping.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace BinaryObjectScanner.Models.XZP -{ - /// - public sealed class DirectoryMapping - { - public ushort PreloadDirectoryEntryIndex; - } -} diff --git a/BinaryObjectScanner.Models/XZP/File.cs b/BinaryObjectScanner.Models/XZP/File.cs deleted file mode 100644 index 47600b5b..00000000 --- a/BinaryObjectScanner.Models/XZP/File.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace BinaryObjectScanner.Models.XZP -{ - /// - /// XBox Package File - /// - /// - public sealed class File - { - /// - /// Header data - /// - public Header Header { get; set; } - - /// - /// Directory entries data - /// - public DirectoryEntry[] DirectoryEntries { get; set; } - - /// - /// Preload directory entries data - /// - public DirectoryEntry[] PreloadDirectoryEntries { get; set; } - - /// - /// Preload directory mappings data - /// - public DirectoryMapping[] PreloadDirectoryMappings { get; set; } - - /// - /// Directory items data - /// - public DirectoryItem[] DirectoryItems { get; set; } - - /// - /// Footer data - /// - public Footer Footer { get; set; } - } -} diff --git a/BinaryObjectScanner.Models/XZP/Footer.cs b/BinaryObjectScanner.Models/XZP/Footer.cs deleted file mode 100644 index de210c95..00000000 --- a/BinaryObjectScanner.Models/XZP/Footer.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace BinaryObjectScanner.Models.XZP -{ - /// - public sealed class Footer - { - public uint FileLength; - - public string Signature; - } -} diff --git a/BinaryObjectScanner.Models/XZP/Header.cs b/BinaryObjectScanner.Models/XZP/Header.cs deleted file mode 100644 index 2efa33a4..00000000 --- a/BinaryObjectScanner.Models/XZP/Header.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace BinaryObjectScanner.Models.XZP -{ - /// - public sealed class Header - { - public string Signature; - - public uint Version; - - public uint PreloadDirectoryEntryCount; - - public uint DirectoryEntryCount; - - public uint PreloadBytes; - - public uint HeaderLength; - - public uint DirectoryItemCount; - - public uint DirectoryItemOffset; - - public uint DirectoryItemLength; - } -} diff --git a/BinaryObjectScanner.Packer/EmbeddedExecutable.cs b/BinaryObjectScanner.Packer/EmbeddedExecutable.cs index 77631875..bfcad3bf 100644 --- a/BinaryObjectScanner.Packer/EmbeddedExecutable.cs +++ b/BinaryObjectScanner.Packer/EmbeddedExecutable.cs @@ -22,7 +22,7 @@ namespace BinaryObjectScanner.Packer return null; // Get the resources that have an executable signature - if (pex.ResourceData?.Any(kvp => kvp.Value is byte[] ba && ba.StartsWith(BinaryObjectScanner.Models.MSDOS.Constants.SignatureBytes)) == true) + if (pex.ResourceData?.Any(kvp => kvp.Value is byte[] ba && ba.StartsWith(SabreTools.Models.MSDOS.Constants.SignatureBytes)) == true) return "Embedded Executable"; return null; @@ -53,7 +53,7 @@ namespace BinaryObjectScanner.Packer // Get the resources that have an executable signature var resources = pex.ResourceData .Where(kvp => kvp.Value != null && kvp.Value is byte[]) - .Where(kvp => (kvp.Value as byte[]).StartsWith(Models.MSDOS.Constants.SignatureBytes)) + .Where(kvp => (kvp.Value as byte[]).StartsWith(SabreTools.Models.MSDOS.Constants.SignatureBytes)) .ToList(); string tempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); diff --git a/BinaryObjectScanner.Packer/WinZipSFX.cs b/BinaryObjectScanner.Packer/WinZipSFX.cs index e3d606b8..00b1577f 100644 --- a/BinaryObjectScanner.Packer/WinZipSFX.cs +++ b/BinaryObjectScanner.Packer/WinZipSFX.cs @@ -132,10 +132,10 @@ namespace BinaryObjectScanner.Packer && nex.EntryTableOffset == 0x0086 && nex.EntryTableSize == 0x0002 && nex.CrcChecksum == 0x00000000 - && nex.FlagWord == (BinaryObjectScanner.Models.NewExecutable.HeaderFlag.MULTIPLEDATA - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.ProtectedModeOnly - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.FullScreen - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) + && nex.FlagWord == (SabreTools.Models.NewExecutable.HeaderFlag.MULTIPLEDATA + | SabreTools.Models.NewExecutable.HeaderFlag.ProtectedModeOnly + | SabreTools.Models.NewExecutable.HeaderFlag.FullScreen + | SabreTools.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) && nex.AutomaticDataSegmentNumber == 0x0003 && nex.InitialHeapAlloc == 0x2000 && nex.InitialStackAlloc == 0x4000 @@ -153,7 +153,7 @@ namespace BinaryObjectScanner.Packer && nex.MovableEntriesCount == 0x0000 && nex.SegmentAlignmentShiftCount == 0x0001 && nex.ResourceEntriesCount == 0x0000 - && nex.TargetOperatingSystem == BinaryObjectScanner.Models.NewExecutable.OperatingSystem.WINDOWS + && nex.TargetOperatingSystem == SabreTools.Models.NewExecutable.OperatingSystem.WINDOWS && nex.AdditionalFlags == 0x00 && nex.ReturnThunkOffset == 0x0000 && nex.SegmentReferenceThunkOffset == 0x0000 @@ -168,10 +168,10 @@ namespace BinaryObjectScanner.Packer && nex.EntryTableOffset == 0x0086 && nex.EntryTableSize == 0x0002 && nex.CrcChecksum == 0x00000000 - && nex.FlagWord == (BinaryObjectScanner.Models.NewExecutable.HeaderFlag.MULTIPLEDATA - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.ProtectedModeOnly - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.FullScreen - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) + && nex.FlagWord == (SabreTools.Models.NewExecutable.HeaderFlag.MULTIPLEDATA + | SabreTools.Models.NewExecutable.HeaderFlag.ProtectedModeOnly + | SabreTools.Models.NewExecutable.HeaderFlag.FullScreen + | SabreTools.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) && nex.AutomaticDataSegmentNumber == 0x0003 && nex.InitialHeapAlloc == 0x2000 && nex.InitialStackAlloc == 0x4000 @@ -189,7 +189,7 @@ namespace BinaryObjectScanner.Packer && nex.MovableEntriesCount == 0x0000 && nex.SegmentAlignmentShiftCount == 0x0001 && nex.ResourceEntriesCount == 0x0000 - && nex.TargetOperatingSystem == BinaryObjectScanner.Models.NewExecutable.OperatingSystem.WINDOWS + && nex.TargetOperatingSystem == SabreTools.Models.NewExecutable.OperatingSystem.WINDOWS && nex.AdditionalFlags == 0x00 && nex.ReturnThunkOffset == 0x0000 && nex.SegmentReferenceThunkOffset == 0x0000 @@ -204,10 +204,10 @@ namespace BinaryObjectScanner.Packer && nex.EntryTableOffset == 0x0080 && nex.EntryTableSize == 0x0002 && nex.CrcChecksum == 0x00000000 - && nex.FlagWord == (BinaryObjectScanner.Models.NewExecutable.HeaderFlag.MULTIPLEDATA - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.ProtectedModeOnly - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.FullScreen - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) + && nex.FlagWord == (SabreTools.Models.NewExecutable.HeaderFlag.MULTIPLEDATA + | SabreTools.Models.NewExecutable.HeaderFlag.ProtectedModeOnly + | SabreTools.Models.NewExecutable.HeaderFlag.FullScreen + | SabreTools.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) && nex.AutomaticDataSegmentNumber == 0x0003 && nex.InitialHeapAlloc == 0x2000 && nex.InitialStackAlloc == 0x4000 @@ -225,7 +225,7 @@ namespace BinaryObjectScanner.Packer && nex.MovableEntriesCount == 0x0000 && nex.SegmentAlignmentShiftCount == 0x0001 && nex.ResourceEntriesCount == 0x0000 - && nex.TargetOperatingSystem == BinaryObjectScanner.Models.NewExecutable.OperatingSystem.WINDOWS + && nex.TargetOperatingSystem == SabreTools.Models.NewExecutable.OperatingSystem.WINDOWS && nex.AdditionalFlags == 0x00 && nex.ReturnThunkOffset == 0x0000 && nex.SegmentReferenceThunkOffset == 0x0000 @@ -240,9 +240,9 @@ namespace BinaryObjectScanner.Packer && nex.EntryTableOffset == 0x00CD && nex.EntryTableSize == 0x0002 && nex.CrcChecksum == 0x00000000 - && nex.FlagWord == (BinaryObjectScanner.Models.NewExecutable.HeaderFlag.MULTIPLEDATA - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.FullScreen - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) + && nex.FlagWord == (SabreTools.Models.NewExecutable.HeaderFlag.MULTIPLEDATA + | SabreTools.Models.NewExecutable.HeaderFlag.FullScreen + | SabreTools.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) && nex.AutomaticDataSegmentNumber == 0x0003 && nex.InitialHeapAlloc == 0x2000 && nex.InitialStackAlloc == 0x4000 @@ -260,7 +260,7 @@ namespace BinaryObjectScanner.Packer && nex.MovableEntriesCount == 0x0000 && nex.SegmentAlignmentShiftCount == 0x0001 && nex.ResourceEntriesCount == 0x0000 - && nex.TargetOperatingSystem == BinaryObjectScanner.Models.NewExecutable.OperatingSystem.WINDOWS + && nex.TargetOperatingSystem == SabreTools.Models.NewExecutable.OperatingSystem.WINDOWS && nex.AdditionalFlags == 0x00 && nex.ReturnThunkOffset == 0x0000 && nex.SegmentReferenceThunkOffset == 0x0000 @@ -279,10 +279,10 @@ namespace BinaryObjectScanner.Packer && nex.EntryTableOffset == 0x0086 && nex.EntryTableSize == 0x0002 && nex.CrcChecksum == 0x00000000 - && nex.FlagWord == (BinaryObjectScanner.Models.NewExecutable.HeaderFlag.MULTIPLEDATA - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.ProtectedModeOnly - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.FullScreen - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) + && nex.FlagWord == (SabreTools.Models.NewExecutable.HeaderFlag.MULTIPLEDATA + | SabreTools.Models.NewExecutable.HeaderFlag.ProtectedModeOnly + | SabreTools.Models.NewExecutable.HeaderFlag.FullScreen + | SabreTools.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) && nex.AutomaticDataSegmentNumber == 0x0003 && nex.InitialHeapAlloc == 0x2000 && nex.InitialStackAlloc == 0x4000 @@ -300,7 +300,7 @@ namespace BinaryObjectScanner.Packer && nex.MovableEntriesCount == 0x0000 && nex.SegmentAlignmentShiftCount == 0x0001 && nex.ResourceEntriesCount == 0x0000 - && nex.TargetOperatingSystem == BinaryObjectScanner.Models.NewExecutable.OperatingSystem.WINDOWS + && nex.TargetOperatingSystem == SabreTools.Models.NewExecutable.OperatingSystem.WINDOWS && nex.AdditionalFlags == 0x00 && nex.ReturnThunkOffset == 0x0000 && nex.SegmentReferenceThunkOffset == 0x0000 @@ -315,9 +315,9 @@ namespace BinaryObjectScanner.Packer && nex.EntryTableOffset == 0x00BE && nex.EntryTableSize == 0x0002 && nex.CrcChecksum == 0x00000000 - && nex.FlagWord == (BinaryObjectScanner.Models.NewExecutable.HeaderFlag.MULTIPLEDATA - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.FullScreen - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) + && nex.FlagWord == (SabreTools.Models.NewExecutable.HeaderFlag.MULTIPLEDATA + | SabreTools.Models.NewExecutable.HeaderFlag.FullScreen + | SabreTools.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) && nex.AutomaticDataSegmentNumber == 0x0003 && nex.InitialHeapAlloc == 0x2000 && nex.InitialStackAlloc == 0x4000 @@ -335,7 +335,7 @@ namespace BinaryObjectScanner.Packer && nex.MovableEntriesCount == 0x0000 && nex.SegmentAlignmentShiftCount == 0x0001 && nex.ResourceEntriesCount == 0x0000 - && nex.TargetOperatingSystem == BinaryObjectScanner.Models.NewExecutable.OperatingSystem.WINDOWS + && nex.TargetOperatingSystem == SabreTools.Models.NewExecutable.OperatingSystem.WINDOWS && nex.AdditionalFlags == 0x00 && nex.ReturnThunkOffset == 0x0000 && nex.SegmentReferenceThunkOffset == 0x0000 @@ -350,10 +350,10 @@ namespace BinaryObjectScanner.Packer && nex.EntryTableOffset == 0x0080 && nex.EntryTableSize == 0x0002 && nex.CrcChecksum == 0x00000000 - && nex.FlagWord == (BinaryObjectScanner.Models.NewExecutable.HeaderFlag.MULTIPLEDATA - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.ProtectedModeOnly - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.FullScreen - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) + && nex.FlagWord == (SabreTools.Models.NewExecutable.HeaderFlag.MULTIPLEDATA + | SabreTools.Models.NewExecutable.HeaderFlag.ProtectedModeOnly + | SabreTools.Models.NewExecutable.HeaderFlag.FullScreen + | SabreTools.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) && nex.AutomaticDataSegmentNumber == 0x0003 && nex.InitialHeapAlloc == 0x2000 && nex.InitialStackAlloc == 0x4000 @@ -371,7 +371,7 @@ namespace BinaryObjectScanner.Packer && nex.MovableEntriesCount == 0x0000 && nex.SegmentAlignmentShiftCount == 0x0001 && nex.ResourceEntriesCount == 0x0000 - && nex.TargetOperatingSystem == BinaryObjectScanner.Models.NewExecutable.OperatingSystem.WINDOWS + && nex.TargetOperatingSystem == SabreTools.Models.NewExecutable.OperatingSystem.WINDOWS && nex.AdditionalFlags == 0x00 && nex.ReturnThunkOffset == 0x0000 && nex.SegmentReferenceThunkOffset == 0x0000 @@ -386,9 +386,9 @@ namespace BinaryObjectScanner.Packer && nex.EntryTableOffset == 0x00BE && nex.EntryTableSize == 0x0002 && nex.CrcChecksum == 0x00000000 - && nex.FlagWord == (BinaryObjectScanner.Models.NewExecutable.HeaderFlag.MULTIPLEDATA - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.FullScreen - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) + && nex.FlagWord == (SabreTools.Models.NewExecutable.HeaderFlag.MULTIPLEDATA + | SabreTools.Models.NewExecutable.HeaderFlag.FullScreen + | SabreTools.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) && nex.AutomaticDataSegmentNumber == 0x0003 && nex.InitialHeapAlloc == 0x2000 && nex.InitialStackAlloc == 0x4000 @@ -406,7 +406,7 @@ namespace BinaryObjectScanner.Packer && nex.MovableEntriesCount == 0x0000 && nex.SegmentAlignmentShiftCount == 0x0001 && nex.ResourceEntriesCount == 0x0000 - && nex.TargetOperatingSystem == BinaryObjectScanner.Models.NewExecutable.OperatingSystem.WINDOWS + && nex.TargetOperatingSystem == SabreTools.Models.NewExecutable.OperatingSystem.WINDOWS && nex.AdditionalFlags == 0x00 && nex.ReturnThunkOffset == 0x0000 && nex.SegmentReferenceThunkOffset == 0x0000 @@ -425,10 +425,10 @@ namespace BinaryObjectScanner.Packer && nex.EntryTableOffset == 0x0086 && nex.EntryTableSize == 0x0002 && nex.CrcChecksum == 0x00000000 - && nex.FlagWord == (BinaryObjectScanner.Models.NewExecutable.HeaderFlag.MULTIPLEDATA - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.ProtectedModeOnly - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.FullScreen - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) + && nex.FlagWord == (SabreTools.Models.NewExecutable.HeaderFlag.MULTIPLEDATA + | SabreTools.Models.NewExecutable.HeaderFlag.ProtectedModeOnly + | SabreTools.Models.NewExecutable.HeaderFlag.FullScreen + | SabreTools.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) && nex.AutomaticDataSegmentNumber == 0x0003 && nex.InitialHeapAlloc == 0x2000 && nex.InitialStackAlloc == 0x3A00 @@ -446,7 +446,7 @@ namespace BinaryObjectScanner.Packer && nex.MovableEntriesCount == 0x0000 && nex.SegmentAlignmentShiftCount == 0x0001 && nex.ResourceEntriesCount == 0x0000 - && nex.TargetOperatingSystem == BinaryObjectScanner.Models.NewExecutable.OperatingSystem.WINDOWS + && nex.TargetOperatingSystem == SabreTools.Models.NewExecutable.OperatingSystem.WINDOWS && nex.AdditionalFlags == 0x00 && nex.ReturnThunkOffset == 0x0000 && nex.SegmentReferenceThunkOffset == 0x0000 @@ -461,9 +461,9 @@ namespace BinaryObjectScanner.Packer && nex.EntryTableOffset == 0x00BE && nex.EntryTableSize == 0x0002 && nex.CrcChecksum == 0x00000000 - && nex.FlagWord == (BinaryObjectScanner.Models.NewExecutable.HeaderFlag.MULTIPLEDATA - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.FullScreen - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) + && nex.FlagWord == (SabreTools.Models.NewExecutable.HeaderFlag.MULTIPLEDATA + | SabreTools.Models.NewExecutable.HeaderFlag.FullScreen + | SabreTools.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) && nex.AutomaticDataSegmentNumber == 0x0003 && nex.InitialHeapAlloc == 0x2000 && nex.InitialStackAlloc == 0x3A00 @@ -481,7 +481,7 @@ namespace BinaryObjectScanner.Packer && nex.MovableEntriesCount == 0x0000 && nex.SegmentAlignmentShiftCount == 0x0001 && nex.ResourceEntriesCount == 0x0000 - && nex.TargetOperatingSystem == BinaryObjectScanner.Models.NewExecutable.OperatingSystem.WINDOWS + && nex.TargetOperatingSystem == SabreTools.Models.NewExecutable.OperatingSystem.WINDOWS && nex.AdditionalFlags == 0x00 && nex.ReturnThunkOffset == 0x0000 && nex.SegmentReferenceThunkOffset == 0x0000 @@ -496,10 +496,10 @@ namespace BinaryObjectScanner.Packer && nex.EntryTableOffset == 0x0080 && nex.EntryTableSize == 0x0002 && nex.CrcChecksum == 0x00000000 - && nex.FlagWord == (BinaryObjectScanner.Models.NewExecutable.HeaderFlag.MULTIPLEDATA - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.ProtectedModeOnly - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.FullScreen - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) + && nex.FlagWord == (SabreTools.Models.NewExecutable.HeaderFlag.MULTIPLEDATA + | SabreTools.Models.NewExecutable.HeaderFlag.ProtectedModeOnly + | SabreTools.Models.NewExecutable.HeaderFlag.FullScreen + | SabreTools.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) && nex.AutomaticDataSegmentNumber == 0x0003 && nex.InitialHeapAlloc == 0x2000 && nex.InitialStackAlloc == 0x3A00 @@ -517,7 +517,7 @@ namespace BinaryObjectScanner.Packer && nex.MovableEntriesCount == 0x0000 && nex.SegmentAlignmentShiftCount == 0x0001 && nex.ResourceEntriesCount == 0x0000 - && nex.TargetOperatingSystem == BinaryObjectScanner.Models.NewExecutable.OperatingSystem.WINDOWS + && nex.TargetOperatingSystem == SabreTools.Models.NewExecutable.OperatingSystem.WINDOWS && nex.AdditionalFlags == 0x00 && nex.ReturnThunkOffset == 0x0000 && nex.SegmentReferenceThunkOffset == 0x0000 @@ -532,9 +532,9 @@ namespace BinaryObjectScanner.Packer && nex.EntryTableOffset == 0x00BE && nex.EntryTableSize == 0x0002 && nex.CrcChecksum == 0x00000000 - && nex.FlagWord == (BinaryObjectScanner.Models.NewExecutable.HeaderFlag.MULTIPLEDATA - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.FullScreen - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) + && nex.FlagWord == (SabreTools.Models.NewExecutable.HeaderFlag.MULTIPLEDATA + | SabreTools.Models.NewExecutable.HeaderFlag.FullScreen + | SabreTools.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) && nex.AutomaticDataSegmentNumber == 0x0003 && nex.InitialHeapAlloc == 0x2000 && nex.InitialStackAlloc == 0x3A00 @@ -552,7 +552,7 @@ namespace BinaryObjectScanner.Packer && nex.MovableEntriesCount == 0x0000 && nex.SegmentAlignmentShiftCount == 0x0001 && nex.ResourceEntriesCount == 0x0000 - && nex.TargetOperatingSystem == BinaryObjectScanner.Models.NewExecutable.OperatingSystem.WINDOWS + && nex.TargetOperatingSystem == SabreTools.Models.NewExecutable.OperatingSystem.WINDOWS && nex.AdditionalFlags == 0x00 && nex.ReturnThunkOffset == 0x0000 && nex.SegmentReferenceThunkOffset == 0x0000 @@ -571,10 +571,10 @@ namespace BinaryObjectScanner.Packer && nex.EntryTableOffset == 0x0086 && nex.EntryTableSize == 0x0002 && nex.CrcChecksum == 0x00000000 - && nex.FlagWord == (BinaryObjectScanner.Models.NewExecutable.HeaderFlag.MULTIPLEDATA - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.ProtectedModeOnly - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.FullScreen - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) + && nex.FlagWord == (SabreTools.Models.NewExecutable.HeaderFlag.MULTIPLEDATA + | SabreTools.Models.NewExecutable.HeaderFlag.ProtectedModeOnly + | SabreTools.Models.NewExecutable.HeaderFlag.FullScreen + | SabreTools.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) && nex.AutomaticDataSegmentNumber == 0x0003 && nex.InitialHeapAlloc == 0x2000 && nex.InitialStackAlloc == 0x4000 @@ -592,7 +592,7 @@ namespace BinaryObjectScanner.Packer && nex.MovableEntriesCount == 0x0000 && nex.SegmentAlignmentShiftCount == 0x0001 && nex.ResourceEntriesCount == 0x0000 - && nex.TargetOperatingSystem == BinaryObjectScanner.Models.NewExecutable.OperatingSystem.WINDOWS + && nex.TargetOperatingSystem == SabreTools.Models.NewExecutable.OperatingSystem.WINDOWS && nex.AdditionalFlags == 0x00 && nex.ReturnThunkOffset == 0x0000 && nex.SegmentReferenceThunkOffset == 0x0000 @@ -607,9 +607,9 @@ namespace BinaryObjectScanner.Packer && nex.EntryTableOffset == 0x00BE && nex.EntryTableSize == 0x0002 && nex.CrcChecksum == 0x00000000 - && nex.FlagWord == (BinaryObjectScanner.Models.NewExecutable.HeaderFlag.MULTIPLEDATA - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.FullScreen - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) + && nex.FlagWord == (SabreTools.Models.NewExecutable.HeaderFlag.MULTIPLEDATA + | SabreTools.Models.NewExecutable.HeaderFlag.FullScreen + | SabreTools.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) && nex.AutomaticDataSegmentNumber == 0x0003 && nex.InitialHeapAlloc == 0x2000 && nex.InitialStackAlloc == 0x3C00 @@ -627,7 +627,7 @@ namespace BinaryObjectScanner.Packer && nex.MovableEntriesCount == 0x0000 && nex.SegmentAlignmentShiftCount == 0x0001 && nex.ResourceEntriesCount == 0x0000 - && nex.TargetOperatingSystem == BinaryObjectScanner.Models.NewExecutable.OperatingSystem.WINDOWS + && nex.TargetOperatingSystem == SabreTools.Models.NewExecutable.OperatingSystem.WINDOWS && nex.AdditionalFlags == 0x00 && nex.ReturnThunkOffset == 0x0000 && nex.SegmentReferenceThunkOffset == 0x0000 @@ -642,9 +642,9 @@ namespace BinaryObjectScanner.Packer && nex.EntryTableOffset == 0x00C6 && nex.EntryTableSize == 0x0002 && nex.CrcChecksum == 0x00000000 - && nex.FlagWord == (BinaryObjectScanner.Models.NewExecutable.HeaderFlag.MULTIPLEDATA - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.FullScreen - | BinaryObjectScanner.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) + && nex.FlagWord == (SabreTools.Models.NewExecutable.HeaderFlag.MULTIPLEDATA + | SabreTools.Models.NewExecutable.HeaderFlag.FullScreen + | SabreTools.Models.NewExecutable.HeaderFlag.WindowsPMCompatible) && nex.AutomaticDataSegmentNumber == 0x0003 && nex.InitialHeapAlloc == 0x43DC && nex.InitialStackAlloc == 0x2708 @@ -662,7 +662,7 @@ namespace BinaryObjectScanner.Packer && nex.MovableEntriesCount == 0x0000 && nex.SegmentAlignmentShiftCount == 0x0001 && nex.ResourceEntriesCount == 0x0000 - && nex.TargetOperatingSystem == BinaryObjectScanner.Models.NewExecutable.OperatingSystem.WINDOWS + && nex.TargetOperatingSystem == SabreTools.Models.NewExecutable.OperatingSystem.WINDOWS && nex.AdditionalFlags == 0x00 && nex.ReturnThunkOffset == 0x0000 && nex.SegmentReferenceThunkOffset == 0x0000 diff --git a/BinaryObjectScanner.Wrappers/AACSMediaKeyBlock.cs b/BinaryObjectScanner.Wrappers/AACSMediaKeyBlock.cs index 68f23f77..9f194457 100644 --- a/BinaryObjectScanner.Wrappers/AACSMediaKeyBlock.cs +++ b/BinaryObjectScanner.Wrappers/AACSMediaKeyBlock.cs @@ -18,7 +18,7 @@ namespace BinaryObjectScanner.Wrappers #region Records /// - public Models.AACS.Record[] Records => _mediaKeyBlock.Records; + public SabreTools.Models.AACS.Record[] Records => _mediaKeyBlock.Records; #endregion @@ -29,7 +29,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the AACS media key block /// - private Models.AACS.MediaKeyBlock _mediaKeyBlock; + private SabreTools.Models.AACS.MediaKeyBlock _mediaKeyBlock; #endregion @@ -126,13 +126,13 @@ namespace BinaryObjectScanner.Wrappers switch (record.RecordType) { - case Models.AACS.RecordType.EndOfMediaKeyBlock: - var eomkb = record as Models.AACS.EndOfMediaKeyBlockRecord; + case SabreTools.Models.AACS.RecordType.EndOfMediaKeyBlock: + var eomkb = record as SabreTools.Models.AACS.EndOfMediaKeyBlockRecord; builder.AppendLine($" Signature data: {BitConverter.ToString(eomkb.SignatureData ?? new byte[0]).Replace('-', ' ')}"); break; - case Models.AACS.RecordType.ExplicitSubsetDifference: - var esd = record as Models.AACS.ExplicitSubsetDifferenceRecord; + case SabreTools.Models.AACS.RecordType.ExplicitSubsetDifference: + var esd = record as SabreTools.Models.AACS.ExplicitSubsetDifferenceRecord; builder.AppendLine($" Subset Differences:"); builder.AppendLine(" -------------------------"); if (esd.SubsetDifferences == null || esd.SubsetDifferences.Length == 0) @@ -151,8 +151,8 @@ namespace BinaryObjectScanner.Wrappers } break; - case Models.AACS.RecordType.MediaKeyData: - var mkd = record as Models.AACS.MediaKeyDataRecord; + case SabreTools.Models.AACS.RecordType.MediaKeyData: + var mkd = record as SabreTools.Models.AACS.MediaKeyDataRecord; builder.AppendLine($" Media Keys:"); builder.AppendLine(" -------------------------"); if (mkd.MediaKeyData == null || mkd.MediaKeyData.Length == 0) @@ -169,8 +169,8 @@ namespace BinaryObjectScanner.Wrappers } break; - case Models.AACS.RecordType.SubsetDifferenceIndex: - var sdi = record as Models.AACS.SubsetDifferenceIndexRecord; + case SabreTools.Models.AACS.RecordType.SubsetDifferenceIndex: + var sdi = record as SabreTools.Models.AACS.SubsetDifferenceIndexRecord; builder.AppendLine($" Span: {sdi.Span} (0x{sdi.Span:X})"); builder.AppendLine($" Offsets:"); builder.AppendLine(" -------------------------"); @@ -188,14 +188,14 @@ namespace BinaryObjectScanner.Wrappers } break; - case Models.AACS.RecordType.TypeAndVersion: - var tav = record as Models.AACS.TypeAndVersionRecord; + case SabreTools.Models.AACS.RecordType.TypeAndVersion: + var tav = record as SabreTools.Models.AACS.TypeAndVersionRecord; builder.AppendLine($" Media key block type: {tav.MediaKeyBlockType} (0x{tav.MediaKeyBlockType:X})"); builder.AppendLine($" Version number: {tav.VersionNumber} (0x{tav.VersionNumber:X})"); break; - case Models.AACS.RecordType.DriveRevocationList: - var drl = record as Models.AACS.DriveRevocationListRecord; + case SabreTools.Models.AACS.RecordType.DriveRevocationList: + var drl = record as SabreTools.Models.AACS.DriveRevocationListRecord; builder.AppendLine($" Total number of entries: {drl.TotalNumberOfEntries} (0x{drl.TotalNumberOfEntries:X})"); builder.AppendLine($" Signature Blocks:"); builder.AppendLine(" -------------------------"); @@ -230,8 +230,8 @@ namespace BinaryObjectScanner.Wrappers } break; - case Models.AACS.RecordType.HostRevocationList: - var hrl = record as Models.AACS.HostRevocationListRecord; + case SabreTools.Models.AACS.RecordType.HostRevocationList: + var hrl = record as SabreTools.Models.AACS.HostRevocationListRecord; builder.AppendLine($" Total number of entries: {hrl.TotalNumberOfEntries} (0x{hrl.TotalNumberOfEntries:X})"); builder.AppendLine($" Signature Blocks:"); builder.AppendLine(" -------------------------"); @@ -266,13 +266,13 @@ namespace BinaryObjectScanner.Wrappers } break; - case Models.AACS.RecordType.VerifyMediaKey: - var vmk = record as Models.AACS.VerifyMediaKeyRecord; + case SabreTools.Models.AACS.RecordType.VerifyMediaKey: + var vmk = record as SabreTools.Models.AACS.VerifyMediaKeyRecord; builder.AppendLine($" Ciphertext value: {BitConverter.ToString(vmk.CiphertextValue ?? new byte[0]).Replace('-', ' ')}"); break; - case Models.AACS.RecordType.Copyright: - var c = record as Models.AACS.CopyrightRecord; + case SabreTools.Models.AACS.RecordType.Copyright: + var c = record as SabreTools.Models.AACS.CopyrightRecord; builder.AppendLine($" Copyright: {c.Copyright ?? "[NULL]"}"); break; } diff --git a/BinaryObjectScanner.Wrappers/BDPlusSVM.cs b/BinaryObjectScanner.Wrappers/BDPlusSVM.cs index f54c3071..b64e22dd 100644 --- a/BinaryObjectScanner.Wrappers/BDPlusSVM.cs +++ b/BinaryObjectScanner.Wrappers/BDPlusSVM.cs @@ -46,7 +46,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the SVM /// - private Models.BDPlus.SVM _svm; + private SabreTools.Models.BDPlus.SVM _svm; #endregion diff --git a/BinaryObjectScanner.Wrappers/BFPK.cs b/BinaryObjectScanner.Wrappers/BFPK.cs index 9d2ceb8a..5780d597 100644 --- a/BinaryObjectScanner.Wrappers/BFPK.cs +++ b/BinaryObjectScanner.Wrappers/BFPK.cs @@ -32,7 +32,7 @@ namespace BinaryObjectScanner.Wrappers #region Files /// - public Models.BFPK.FileEntry[] FileTable => _archive.Files; + public SabreTools.Models.BFPK.FileEntry[] FileTable => _archive.Files; #endregion @@ -43,7 +43,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the archive /// - private Models.BFPK.Archive _archive; + private SabreTools.Models.BFPK.Archive _archive; #endregion diff --git a/BinaryObjectScanner.Wrappers/BSP.cs b/BinaryObjectScanner.Wrappers/BSP.cs index c9db051d..31c0e39f 100644 --- a/BinaryObjectScanner.Wrappers/BSP.cs +++ b/BinaryObjectScanner.Wrappers/BSP.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; -using static BinaryObjectScanner.Models.BSP.Constants; +using static SabreTools.Models.BSP.Constants; namespace BinaryObjectScanner.Wrappers { @@ -27,7 +27,7 @@ namespace BinaryObjectScanner.Wrappers #region Lumps /// - public Models.BSP.Lump[] Lumps => _file.Lumps; + public SabreTools.Models.BSP.Lump[] Lumps => _file.Lumps; #endregion @@ -44,7 +44,7 @@ namespace BinaryObjectScanner.Wrappers #region Textures /// - public Models.BSP.Texture[] Textures => _file.Textures; + public SabreTools.Models.BSP.Texture[] Textures => _file.Textures; #endregion @@ -55,7 +55,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the BSP /// - private Models.BSP.File _file; + private SabreTools.Models.BSP.File _file; #endregion @@ -410,14 +410,14 @@ namespace BinaryObjectScanner.Wrappers /// /// Texture object to format /// Byte array representing the texture as a bitmap - private static byte[] CreateTextureData(Models.BSP.Texture texture) + private static byte[] CreateTextureData(SabreTools.Models.BSP.Texture texture) { // If there's no texture data if (texture.TextureData == null || texture.TextureData.Length == 0) return null; // Create the bitmap file header - var fileHeader = new Models.BMP.BITMAPFILEHEADER() + var fileHeader = new SabreTools.Models.BMP.BITMAPFILEHEADER() { Type = ('M' << 8) | 'B', Size = 14 + 40 + (texture.PaletteSize * 4) + (texture.Width * texture.Height), @@ -425,7 +425,7 @@ namespace BinaryObjectScanner.Wrappers }; // Create the bitmap info header - var infoHeader = new Models.BMP.BITMAPINFOHEADER + var infoHeader = new SabreTools.Models.BMP.BITMAPINFOHEADER { Size = 40, Width = (int)texture.Width, diff --git a/BinaryObjectScanner.Wrappers/BinaryObjectScanner.Wrappers.csproj b/BinaryObjectScanner.Wrappers/BinaryObjectScanner.Wrappers.csproj index 9d50f03c..75bad52c 100644 --- a/BinaryObjectScanner.Wrappers/BinaryObjectScanner.Wrappers.csproj +++ b/BinaryObjectScanner.Wrappers/BinaryObjectScanner.Wrappers.csproj @@ -21,15 +21,15 @@ + + + + + + + - - - - - - - diff --git a/BinaryObjectScanner.Wrappers/CFB.cs b/BinaryObjectScanner.Wrappers/CFB.cs index 7a1c8e60..b9563a92 100644 --- a/BinaryObjectScanner.Wrappers/CFB.cs +++ b/BinaryObjectScanner.Wrappers/CFB.cs @@ -70,35 +70,35 @@ namespace BinaryObjectScanner.Wrappers public uint NumberOfDIFATSectors => _binary.Header.NumberOfDIFATSectors; /// - public Models.CFB.SectorNumber[] DIFAT => _binary.Header.DIFAT; + public SabreTools.Models.CFB.SectorNumber[] DIFAT => _binary.Header.DIFAT; #endregion #region FAT Sector Numbers /// - public Models.CFB.SectorNumber[] FATSectorNumbers => _binary.FATSectorNumbers; + public SabreTools.Models.CFB.SectorNumber[] FATSectorNumbers => _binary.FATSectorNumbers; #endregion #region Mini FAT Sector Numbers /// - public Models.CFB.SectorNumber[] MiniFATSectorNumbers => _binary.MiniFATSectorNumbers; + public SabreTools.Models.CFB.SectorNumber[] MiniFATSectorNumbers => _binary.MiniFATSectorNumbers; #endregion #region DIFAT Sector Numbers /// - public Models.CFB.SectorNumber[] DIFATSectorNumbers => _binary.DIFATSectorNumbers; + public SabreTools.Models.CFB.SectorNumber[] DIFATSectorNumbers => _binary.DIFATSectorNumbers; #endregion #region Directory Entries /// - public Models.CFB.DirectoryEntry[] DirectoryEntries => _binary.DirectoryEntries; + public SabreTools.Models.CFB.DirectoryEntry[] DirectoryEntries => _binary.DirectoryEntries; #endregion @@ -123,7 +123,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the file /// - private Models.CFB.Binary _binary; + private SabreTools.Models.CFB.Binary _binary; #endregion @@ -188,14 +188,14 @@ namespace BinaryObjectScanner.Wrappers /// /// Initial FAT sector /// Ordered list of sector numbers, null on error - public List GetFATSectorChain(Models.CFB.SectorNumber startingSector) + public List GetFATSectorChain(SabreTools.Models.CFB.SectorNumber startingSector) { // If we have an invalid sector if (startingSector < 0 || (long)startingSector >= FATSectorNumbers.Length) return null; // Setup the returned list - var sectors = new List { startingSector }; + var sectors = new List { startingSector }; var lastSector = startingSector; while (true) @@ -204,7 +204,7 @@ namespace BinaryObjectScanner.Wrappers var nextSector = FATSectorNumbers[(uint)lastSector]; // If we have an end of chain or free sector - if (nextSector == Models.CFB.SectorNumber.ENDOFCHAIN || nextSector == Models.CFB.SectorNumber.FREESECT) + if (nextSector == SabreTools.Models.CFB.SectorNumber.ENDOFCHAIN || nextSector == SabreTools.Models.CFB.SectorNumber.FREESECT) break; // Add the next sector to the list and replace the last sector @@ -220,7 +220,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Initial FAT sector /// Ordered list of sector numbers, null on error - public byte[] GetFATSectorChainData(Models.CFB.SectorNumber startingSector) + public byte[] GetFATSectorChainData(SabreTools.Models.CFB.SectorNumber startingSector) { // Get the sector chain first var sectorChain = GetFATSectorChain(startingSector); @@ -253,10 +253,10 @@ namespace BinaryObjectScanner.Wrappers /// /// Sector to convert /// File offset in bytes, -1 on error - public long FATSectorToFileOffset(Models.CFB.SectorNumber sector) + public long FATSectorToFileOffset(SabreTools.Models.CFB.SectorNumber sector) { // If we have an invalid sector number - if (sector > Models.CFB.SectorNumber.MAXREGSECT) + if (sector > SabreTools.Models.CFB.SectorNumber.MAXREGSECT) return -1; // Convert based on the sector shift value @@ -272,14 +272,14 @@ namespace BinaryObjectScanner.Wrappers /// /// Initial Mini FAT sector /// Ordered list of sector numbers, null on error - public List GetMiniFATSectorChain(Models.CFB.SectorNumber startingSector) + public List GetMiniFATSectorChain(SabreTools.Models.CFB.SectorNumber startingSector) { // If we have an invalid sector if (startingSector < 0 || (long)startingSector >= MiniFATSectorNumbers.Length) return null; // Setup the returned list - var sectors = new List { startingSector }; + var sectors = new List { startingSector }; var lastSector = startingSector; while (true) @@ -288,7 +288,7 @@ namespace BinaryObjectScanner.Wrappers var nextSector = MiniFATSectorNumbers[(uint)lastSector]; // If we have an end of chain or free sector - if (nextSector == Models.CFB.SectorNumber.ENDOFCHAIN || nextSector == Models.CFB.SectorNumber.FREESECT) + if (nextSector == SabreTools.Models.CFB.SectorNumber.ENDOFCHAIN || nextSector == SabreTools.Models.CFB.SectorNumber.FREESECT) break; // Add the next sector to the list and replace the last sector @@ -304,7 +304,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Initial Mini FAT sector /// Ordered list of sector numbers, null on error - public byte[] GetMiniFATSectorChainData(Models.CFB.SectorNumber startingSector) + public byte[] GetMiniFATSectorChainData(SabreTools.Models.CFB.SectorNumber startingSector) { // Get the sector chain first var sectorChain = GetMiniFATSectorChain(startingSector); @@ -337,10 +337,10 @@ namespace BinaryObjectScanner.Wrappers /// /// Sector to convert /// File offset in bytes, -1 on error - public long MiniFATSectorToFileOffset(Models.CFB.SectorNumber sector) + public long MiniFATSectorToFileOffset(SabreTools.Models.CFB.SectorNumber sector) { // If we have an invalid sector number - if (sector > Models.CFB.SectorNumber.MAXREGSECT) + if (sector > SabreTools.Models.CFB.SectorNumber.MAXREGSECT) return -1; // Convert based on the sector shift value diff --git a/BinaryObjectScanner.Wrappers/CIA.cs b/BinaryObjectScanner.Wrappers/CIA.cs index 2a5b1f5c..6ceed2b9 100644 --- a/BinaryObjectScanner.Wrappers/CIA.cs +++ b/BinaryObjectScanner.Wrappers/CIA.cs @@ -49,14 +49,14 @@ namespace BinaryObjectScanner.Wrappers #region Certificate Chain /// - public Models.N3DS.Certificate[] CertificateChain => _cia.CertificateChain; + public SabreTools.Models.N3DS.Certificate[] CertificateChain => _cia.CertificateChain; #endregion #region Ticket /// - public Models.N3DS.SignatureType T_SignatureType => _cia.Ticket.SignatureType; + public SabreTools.Models.N3DS.SignatureType T_SignatureType => _cia.Ticket.SignatureType; /// public ushort T_SignatureSize => _cia.Ticket.SignatureSize; @@ -140,14 +140,14 @@ namespace BinaryObjectScanner.Wrappers public byte[] T_ContentIndex => _cia.Ticket.ContentIndex; /// - public Models.N3DS.Certificate[] T_CertificateChain => _cia.Ticket.CertificateChain; + public SabreTools.Models.N3DS.Certificate[] T_CertificateChain => _cia.Ticket.CertificateChain; #endregion #region Title Metadata /// - public Models.N3DS.SignatureType TMD_SignatureType => _cia.TMDFileData.SignatureType; + public SabreTools.Models.N3DS.SignatureType TMD_SignatureType => _cia.TMDFileData.SignatureType; /// public ushort TMD_SignatureSize => _cia.TMDFileData.SignatureSize; @@ -222,20 +222,20 @@ namespace BinaryObjectScanner.Wrappers public byte[] TMD_SHA256HashContentInfoRecords => _cia.TMDFileData.SHA256HashContentInfoRecords; /// - public Models.N3DS.ContentInfoRecord[] TMD_ContentInfoRecords => _cia.TMDFileData.ContentInfoRecords; + public SabreTools.Models.N3DS.ContentInfoRecord[] TMD_ContentInfoRecords => _cia.TMDFileData.ContentInfoRecords; /// - public Models.N3DS.ContentChunkRecord[] TMD_ContentChunkRecords => _cia.TMDFileData.ContentChunkRecords; + public SabreTools.Models.N3DS.ContentChunkRecord[] TMD_ContentChunkRecords => _cia.TMDFileData.ContentChunkRecords; /// - public Models.N3DS.Certificate[] TMD_CertificateChain => _cia.TMDFileData.CertificateChain; + public SabreTools.Models.N3DS.Certificate[] TMD_CertificateChain => _cia.TMDFileData.CertificateChain; #endregion #region Partitions /// - public Models.N3DS.NCCHHeader[] Partitions => _cia.Partitions; + public SabreTools.Models.N3DS.NCCHHeader[] Partitions => _cia.Partitions; #endregion @@ -265,7 +265,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the cart /// - private Models.N3DS.CIA _cia; + private SabreTools.Models.N3DS.CIA _cia; #endregion @@ -402,13 +402,13 @@ namespace BinaryObjectScanner.Wrappers builder.AppendLine($" Expiration time: {certificate.ExpirationTime} (0x{certificate.ExpirationTime:X})"); switch (certificate.KeyType) { - case Models.N3DS.PublicKeyType.RSA_4096: - case Models.N3DS.PublicKeyType.RSA_2048: + case SabreTools.Models.N3DS.PublicKeyType.RSA_4096: + case SabreTools.Models.N3DS.PublicKeyType.RSA_2048: builder.AppendLine($" Modulus: {BitConverter.ToString(certificate.RSAModulus).Replace('-', ' ')}"); builder.AppendLine($" Public exponent: {certificate.RSAPublicExponent} (0x{certificate.RSAPublicExponent:X})"); builder.AppendLine($" Padding: {BitConverter.ToString(certificate.RSAPadding).Replace('-', ' ')}"); break; - case Models.N3DS.PublicKeyType.EllipticCurve: + case SabreTools.Models.N3DS.PublicKeyType.EllipticCurve: builder.AppendLine($" Public key: {BitConverter.ToString(certificate.ECCPublicKey).Replace('-', ' ')}"); builder.AppendLine($" Padding: {BitConverter.ToString(certificate.ECCPadding).Replace('-', ' ')}"); break; @@ -491,13 +491,13 @@ namespace BinaryObjectScanner.Wrappers builder.AppendLine($" Expiration time: {certificate.ExpirationTime} (0x{certificate.ExpirationTime:X})"); switch (certificate.KeyType) { - case Models.N3DS.PublicKeyType.RSA_4096: - case Models.N3DS.PublicKeyType.RSA_2048: + case SabreTools.Models.N3DS.PublicKeyType.RSA_4096: + case SabreTools.Models.N3DS.PublicKeyType.RSA_2048: builder.AppendLine($" Modulus: {BitConverter.ToString(certificate.RSAModulus).Replace('-', ' ')}"); builder.AppendLine($" Public exponent: {certificate.RSAPublicExponent} (0x{certificate.RSAPublicExponent:X})"); builder.AppendLine($" Padding: {BitConverter.ToString(certificate.RSAPadding).Replace('-', ' ')}"); break; - case Models.N3DS.PublicKeyType.EllipticCurve: + case SabreTools.Models.N3DS.PublicKeyType.EllipticCurve: builder.AppendLine($" Public key: {BitConverter.ToString(certificate.ECCPublicKey).Replace('-', ' ')}"); builder.AppendLine($" Padding: {BitConverter.ToString(certificate.ECCPadding).Replace('-', ' ')}"); break; @@ -613,13 +613,13 @@ namespace BinaryObjectScanner.Wrappers builder.AppendLine($" Expiration time: {certificate.ExpirationTime} (0x{certificate.ExpirationTime:X})"); switch (certificate.KeyType) { - case Models.N3DS.PublicKeyType.RSA_4096: - case Models.N3DS.PublicKeyType.RSA_2048: + case SabreTools.Models.N3DS.PublicKeyType.RSA_4096: + case SabreTools.Models.N3DS.PublicKeyType.RSA_2048: builder.AppendLine($" Modulus: {BitConverter.ToString(certificate.RSAModulus).Replace('-', ' ')}"); builder.AppendLine($" Public exponent: {certificate.RSAPublicExponent} (0x{certificate.RSAPublicExponent:X})"); builder.AppendLine($" Padding: {BitConverter.ToString(certificate.RSAPadding).Replace('-', ' ')}"); break; - case Models.N3DS.PublicKeyType.EllipticCurve: + case SabreTools.Models.N3DS.PublicKeyType.EllipticCurve: builder.AppendLine($" Public key: {BitConverter.ToString(certificate.ECCPublicKey).Replace('-', ' ')}"); builder.AppendLine($" Padding: {BitConverter.ToString(certificate.ECCPadding).Replace('-', ' ')}"); break; @@ -651,7 +651,7 @@ namespace BinaryObjectScanner.Wrappers { builder.AppendLine($" Empty partition, no data can be parsed"); } - else if (partitionHeader.MagicID != Models.N3DS.Constants.NCCHMagicNumber) + else if (partitionHeader.MagicID != SabreTools.Models.N3DS.Constants.NCCHMagicNumber) { builder.AppendLine($" Unrecognized partition data, no data can be parsed"); } diff --git a/BinaryObjectScanner.Wrappers/GCF.cs b/BinaryObjectScanner.Wrappers/GCF.cs index 6818501c..71de7215 100644 --- a/BinaryObjectScanner.Wrappers/GCF.cs +++ b/BinaryObjectScanner.Wrappers/GCF.cs @@ -84,7 +84,7 @@ namespace BinaryObjectScanner.Wrappers #region Block Entries /// - public Models.GCF.BlockEntry[] BlockEntries => _file.BlockEntries; + public SabreTools.Models.GCF.BlockEntry[] BlockEntries => _file.BlockEntries; #endregion @@ -107,7 +107,7 @@ namespace BinaryObjectScanner.Wrappers #region Fragmentation Maps /// - public Models.GCF.FragmentationMap[] FragmentationMaps => _file.FragmentationMaps; + public SabreTools.Models.GCF.FragmentationMap[] FragmentationMaps => _file.FragmentationMaps; #endregion @@ -133,7 +133,7 @@ namespace BinaryObjectScanner.Wrappers #region Block Entry Maps /// - public Models.GCF.BlockEntryMap[] BlockEntryMaps => _file.BlockEntryMaps; + public SabreTools.Models.GCF.BlockEntryMap[] BlockEntryMaps => _file.BlockEntryMaps; #endregion @@ -186,7 +186,7 @@ namespace BinaryObjectScanner.Wrappers #region Directory Entries /// - public Models.GCF.DirectoryEntry[] DirectoryEntries => _file.DirectoryEntries; + public SabreTools.Models.GCF.DirectoryEntry[] DirectoryEntries => _file.DirectoryEntries; #endregion @@ -200,28 +200,28 @@ namespace BinaryObjectScanner.Wrappers #region Directory Info 1 Entries /// - public Models.GCF.DirectoryInfo1Entry[] DirectoryInfo1Entries => _file.DirectoryInfo1Entries; + public SabreTools.Models.GCF.DirectoryInfo1Entry[] DirectoryInfo1Entries => _file.DirectoryInfo1Entries; #endregion #region Directory Info 2 Entries /// - public Models.GCF.DirectoryInfo2Entry[] DirectoryInfo2Entries => _file.DirectoryInfo2Entries; + public SabreTools.Models.GCF.DirectoryInfo2Entry[] DirectoryInfo2Entries => _file.DirectoryInfo2Entries; #endregion #region Directory Copy Entries /// - public Models.GCF.DirectoryCopyEntry[] DirectoryCopyEntries => _file.DirectoryCopyEntries; + public SabreTools.Models.GCF.DirectoryCopyEntry[] DirectoryCopyEntries => _file.DirectoryCopyEntries; #endregion #region Directory Local Entries /// - public Models.GCF.DirectoryLocalEntry[] DirectoryLocalEntries => _file.DirectoryLocalEntries; + public SabreTools.Models.GCF.DirectoryLocalEntry[] DirectoryLocalEntries => _file.DirectoryLocalEntries; #endregion @@ -238,7 +238,7 @@ namespace BinaryObjectScanner.Wrappers #region Directory Map Entries /// - public Models.GCF.DirectoryMapEntry[] DirectoryMapEntries => _file.DirectoryMapEntries; + public SabreTools.Models.GCF.DirectoryMapEntry[] DirectoryMapEntries => _file.DirectoryMapEntries; #endregion @@ -271,14 +271,14 @@ namespace BinaryObjectScanner.Wrappers #region Checksum Map Entries /// - public Models.GCF.ChecksumMapEntry[] ChecksumMapEntries => _file.ChecksumMapEntries; + public SabreTools.Models.GCF.ChecksumMapEntry[] ChecksumMapEntries => _file.ChecksumMapEntries; #endregion #region Checksum Entries /// - public Models.GCF.ChecksumEntry[] ChecksumEntries => _file.ChecksumEntries; + public SabreTools.Models.GCF.ChecksumEntry[] ChecksumEntries => _file.ChecksumEntries; #endregion @@ -328,17 +328,17 @@ namespace BinaryObjectScanner.Wrappers var directoryMapEntry = DirectoryMapEntries[i]; // If we have a directory, skip for now - if (!directoryEntry.DirectoryFlags.HasFlag(Models.GCF.HL_GCF_FLAG.HL_GCF_FLAG_FILE)) + if (!directoryEntry.DirectoryFlags.HasFlag(SabreTools.Models.GCF.HL_GCF_FLAG.HL_GCF_FLAG_FILE)) continue; // Otherwise, start building the file info var fileInfo = new FileInfo() { Size = directoryEntry.ItemSize, - Encrypted = directoryEntry.DirectoryFlags.HasFlag(Models.GCF.HL_GCF_FLAG.HL_GCF_FLAG_ENCRYPTED), + Encrypted = directoryEntry.DirectoryFlags.HasFlag(SabreTools.Models.GCF.HL_GCF_FLAG.HL_GCF_FLAG_ENCRYPTED), }; var pathParts = new List { directoryEntry.Name }; - var blockEntries = new List(); + var blockEntries = new List(); // Traverse the parent tree uint index = directoryEntry.ParentIndex; @@ -406,7 +406,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the GCF /// - private Models.GCF.File _file; + private SabreTools.Models.GCF.File _file; /// /// Set of all files and their information @@ -1109,7 +1109,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Array of block entries /// - public Models.GCF.BlockEntry[] BlockEntries; + public SabreTools.Models.GCF.BlockEntry[] BlockEntries; } #endregion diff --git a/BinaryObjectScanner.Wrappers/InstallShieldCabinet.cs b/BinaryObjectScanner.Wrappers/InstallShieldCabinet.cs index 862e14c9..a4bd3190 100644 --- a/BinaryObjectScanner.Wrappers/InstallShieldCabinet.cs +++ b/BinaryObjectScanner.Wrappers/InstallShieldCabinet.cs @@ -177,35 +177,35 @@ namespace BinaryObjectScanner.Wrappers #region File Descriptors /// - public Models.InstallShieldCabinet.FileDescriptor[] FileDescriptors => _cabinet.FileDescriptors; + public SabreTools.Models.InstallShieldCabinet.FileDescriptor[] FileDescriptors => _cabinet.FileDescriptors; #endregion #region File Group Offsets /// - public Dictionary FileGroupOffsets => _cabinet.FileGroupOffsets; + public Dictionary FileGroupOffsets => _cabinet.FileGroupOffsets; #endregion #region File Groups /// - public Models.InstallShieldCabinet.FileGroup[] FileGroups => _cabinet.FileGroups; + public SabreTools.Models.InstallShieldCabinet.FileGroup[] FileGroups => _cabinet.FileGroups; #endregion #region Component Offsets /// - public Dictionary ComponentOffsets => _cabinet.ComponentOffsets; + public Dictionary ComponentOffsets => _cabinet.ComponentOffsets; #endregion #region Components /// - public Models.InstallShieldCabinet.Component[] Components => _cabinet.Components; + public SabreTools.Models.InstallShieldCabinet.Component[] Components => _cabinet.Components; #endregion @@ -243,7 +243,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the cabinet /// - private Models.InstallShieldCabinet.Cabinet _cabinet; + private SabreTools.Models.InstallShieldCabinet.Cabinet _cabinet; #endregion diff --git a/BinaryObjectScanner.Wrappers/LinearExecutable.cs b/BinaryObjectScanner.Wrappers/LinearExecutable.cs index fd483d34..51c30c1f 100644 --- a/BinaryObjectScanner.Wrappers/LinearExecutable.cs +++ b/BinaryObjectScanner.Wrappers/LinearExecutable.cs @@ -90,25 +90,25 @@ namespace BinaryObjectScanner.Wrappers public string Signature => _executable.InformationBlock.Signature; /// - public Models.LinearExecutable.ByteOrder ByteOrder => _executable.InformationBlock.ByteOrder; + public SabreTools.Models.LinearExecutable.ByteOrder ByteOrder => _executable.InformationBlock.ByteOrder; /// - public Models.LinearExecutable.WordOrder WordOrder => _executable.InformationBlock.WordOrder; + public SabreTools.Models.LinearExecutable.WordOrder WordOrder => _executable.InformationBlock.WordOrder; /// public uint ExecutableFormatLevel => _executable.InformationBlock.ExecutableFormatLevel; /// - public Models.LinearExecutable.CPUType CPUType => _executable.InformationBlock.CPUType; + public SabreTools.Models.LinearExecutable.CPUType CPUType => _executable.InformationBlock.CPUType; /// - public Models.LinearExecutable.OperatingSystem ModuleOS => _executable.InformationBlock.ModuleOS; + public SabreTools.Models.LinearExecutable.OperatingSystem ModuleOS => _executable.InformationBlock.ModuleOS; /// public uint ModuleVersion => _executable.InformationBlock.ModuleVersion; /// - public Models.LinearExecutable.ModuleFlags ModuleTypeFlags => _executable.InformationBlock.ModuleTypeFlags; + public SabreTools.Models.LinearExecutable.ModuleFlags ModuleTypeFlags => _executable.InformationBlock.ModuleTypeFlags; /// public uint ModuleNumberPages => _executable.InformationBlock.ModuleNumberPages; @@ -229,43 +229,43 @@ namespace BinaryObjectScanner.Wrappers #region Tables /// - public Models.LinearExecutable.ObjectTableEntry[] ObjectTable => _executable.ObjectTable; + public SabreTools.Models.LinearExecutable.ObjectTableEntry[] ObjectTable => _executable.ObjectTable; /// - public Models.LinearExecutable.ObjectPageMapEntry[] ObjectPageMap => _executable.ObjectPageMap; + public SabreTools.Models.LinearExecutable.ObjectPageMapEntry[] ObjectPageMap => _executable.ObjectPageMap; /// - public Models.LinearExecutable.ResourceTableEntry[] ResourceTable => _executable.ResourceTable; + public SabreTools.Models.LinearExecutable.ResourceTableEntry[] ResourceTable => _executable.ResourceTable; /// - public Models.LinearExecutable.ResidentNamesTableEntry[] ResidentNamesTable => _executable.ResidentNamesTable; + public SabreTools.Models.LinearExecutable.ResidentNamesTableEntry[] ResidentNamesTable => _executable.ResidentNamesTable; /// - public Models.LinearExecutable.EntryTableBundle[] EntryTable => _executable.EntryTable; + public SabreTools.Models.LinearExecutable.EntryTableBundle[] EntryTable => _executable.EntryTable; /// - public Models.LinearExecutable.ModuleFormatDirectivesTableEntry[] ModuleFormatDirectivesTable => _executable.ModuleFormatDirectivesTable; + public SabreTools.Models.LinearExecutable.ModuleFormatDirectivesTableEntry[] ModuleFormatDirectivesTable => _executable.ModuleFormatDirectivesTable; /// - public Models.LinearExecutable.VerifyRecordDirectiveTableEntry[] VerifyRecordDirectiveTable => _executable.VerifyRecordDirectiveTable; + public SabreTools.Models.LinearExecutable.VerifyRecordDirectiveTableEntry[] VerifyRecordDirectiveTable => _executable.VerifyRecordDirectiveTable; /// - public Models.LinearExecutable.PerPageChecksumTableEntry[] PerPageChecksumTable => _executable.PerPageChecksumTable; + public SabreTools.Models.LinearExecutable.PerPageChecksumTableEntry[] PerPageChecksumTable => _executable.PerPageChecksumTable; /// - public Models.LinearExecutable.FixupPageTableEntry[] FixupPageTable => _executable.FixupPageTable; + public SabreTools.Models.LinearExecutable.FixupPageTableEntry[] FixupPageTable => _executable.FixupPageTable; /// - public Models.LinearExecutable.FixupRecordTableEntry[] FixupRecordTable => _executable.FixupRecordTable; + public SabreTools.Models.LinearExecutable.FixupRecordTableEntry[] FixupRecordTable => _executable.FixupRecordTable; /// - public Models.LinearExecutable.ImportModuleNameTableEntry[] ImportModuleNameTable => _executable.ImportModuleNameTable; + public SabreTools.Models.LinearExecutable.ImportModuleNameTableEntry[] ImportModuleNameTable => _executable.ImportModuleNameTable; /// - public Models.LinearExecutable.ImportModuleProcedureNameTableEntry[] ImportModuleProcedureNameTable => _executable.ImportModuleProcedureNameTable; + public SabreTools.Models.LinearExecutable.ImportModuleProcedureNameTableEntry[] ImportModuleProcedureNameTable => _executable.ImportModuleProcedureNameTable; /// - public Models.LinearExecutable.NonResidentNamesTableEntry[] NonResidentNamesTable => _executable.NonResidentNamesTable; + public SabreTools.Models.LinearExecutable.NonResidentNamesTableEntry[] NonResidentNamesTable => _executable.NonResidentNamesTable; #endregion @@ -275,7 +275,7 @@ namespace BinaryObjectScanner.Wrappers public string DI_Signature => _executable.DebugInformation?.Signature; /// - public Models.LinearExecutable.DebugFormatType? DI_FormatType => _executable.DebugInformation?.FormatType; + public SabreTools.Models.LinearExecutable.DebugFormatType? DI_FormatType => _executable.DebugInformation?.FormatType; /// public byte[] DebuggerData => _executable.DebugInformation?.DebuggerData; @@ -295,7 +295,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the executable /// - private Models.LinearExecutable.Executable _executable; + private SabreTools.Models.LinearExecutable.Executable _executable; #endregion @@ -628,32 +628,32 @@ namespace BinaryObjectScanner.Wrappers { var entry = bundle.TableEntries[j]; builder.AppendLine($" Entry Table Entry {j}"); - switch (bundle.BundleType & ~Models.LinearExecutable.BundleType.ParameterTypingInformationPresent) + switch (bundle.BundleType & ~SabreTools.Models.LinearExecutable.BundleType.ParameterTypingInformationPresent) { - case Models.LinearExecutable.BundleType.UnusedEntry: + case SabreTools.Models.LinearExecutable.BundleType.UnusedEntry: builder.AppendLine($" Unused, empty entry"); break; - case Models.LinearExecutable.BundleType.SixteenBitEntry: + case SabreTools.Models.LinearExecutable.BundleType.SixteenBitEntry: builder.AppendLine($" Object number: {entry.SixteenBitObjectNumber} (0x{entry.SixteenBitObjectNumber:X})"); builder.AppendLine($" Entry flags: {entry.SixteenBitEntryFlags} (0x{entry.SixteenBitEntryFlags:X})"); builder.AppendLine($" Offset: {entry.SixteenBitOffset} (0x{entry.SixteenBitOffset:X})"); break; - case Models.LinearExecutable.BundleType.TwoEightySixCallGateEntry: + case SabreTools.Models.LinearExecutable.BundleType.TwoEightySixCallGateEntry: builder.AppendLine($" Object number: {entry.TwoEightySixObjectNumber} (0x{entry.TwoEightySixObjectNumber:X})"); builder.AppendLine($" Entry flags: {entry.TwoEightySixEntryFlags} (0x{entry.TwoEightySixEntryFlags:X})"); builder.AppendLine($" Offset: {entry.TwoEightySixOffset} (0x{entry.TwoEightySixOffset:X})"); builder.AppendLine($" Callgate: {entry.TwoEightySixCallgate} (0x{entry.TwoEightySixCallgate:X})"); break; - case Models.LinearExecutable.BundleType.ThirtyTwoBitEntry: + case SabreTools.Models.LinearExecutable.BundleType.ThirtyTwoBitEntry: builder.AppendLine($" Object number: {entry.ThirtyTwoBitObjectNumber} (0x{entry.ThirtyTwoBitObjectNumber:X})"); builder.AppendLine($" Entry flags: {entry.ThirtyTwoBitEntryFlags} (0x{entry.ThirtyTwoBitEntryFlags:X})"); builder.AppendLine($" Offset: {entry.ThirtyTwoBitOffset} (0x{entry.ThirtyTwoBitOffset:X})"); break; - case Models.LinearExecutable.BundleType.ForwarderEntry: + case SabreTools.Models.LinearExecutable.BundleType.ForwarderEntry: builder.AppendLine($" Reserved: {entry.ForwarderReserved} (0x{entry.ForwarderReserved:X})"); builder.AppendLine($" Forwarder flags: {entry.ForwarderFlags} (0x{entry.ForwarderFlags:X})"); builder.AppendLine($" Module ordinal number: {entry.ForwarderModuleOrdinalNumber} (0x{entry.ForwarderModuleOrdinalNumber:X})"); @@ -775,25 +775,25 @@ namespace BinaryObjectScanner.Wrappers builder.AppendLine($" Target flags: {entry.TargetFlags} (0x{entry.TargetFlags:X})"); // Source list flag - if (entry.SourceType.HasFlag(Models.LinearExecutable.FixupRecordSourceType.SourceListFlag)) + if (entry.SourceType.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordSourceType.SourceListFlag)) builder.AppendLine($" Source offset list count: {entry.SourceOffsetListCount} (0x{entry.SourceOffsetListCount:X})"); else builder.AppendLine($" Source offset: {entry.SourceOffset} (0x{entry.SourceOffset:X})"); // OBJECT / TRGOFF - if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.InternalReference)) + if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.InternalReference)) { // 16-bit Object Number/Module Ordinal Flag - if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.SixteenBitObjectNumberModuleOrdinalFlag)) + if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.SixteenBitObjectNumberModuleOrdinalFlag)) builder.AppendLine($" Target object number: {entry.TargetObjectNumberWORD} (0x{entry.TargetObjectNumberWORD:X})"); else builder.AppendLine($" Target object number: {entry.TargetObjectNumberByte} (0x{entry.TargetObjectNumberByte:X})"); // 16-bit Selector fixup - if (!entry.SourceType.HasFlag(Models.LinearExecutable.FixupRecordSourceType.SixteenBitSelectorFixup)) + if (!entry.SourceType.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordSourceType.SixteenBitSelectorFixup)) { // 32-bit Target Offset Flag - if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.ThirtyTwoBitTargetOffsetFlag)) + if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.ThirtyTwoBitTargetOffsetFlag)) builder.AppendLine($" Target offset: {entry.TargetOffsetDWORD} (0x{entry.TargetOffsetDWORD:X})"); else builder.AppendLine($" Target offset: {entry.TargetOffsetWORD} (0x{entry.TargetOffsetWORD:X})"); @@ -801,27 +801,27 @@ namespace BinaryObjectScanner.Wrappers } // MOD ORD# / IMPORT ORD / ADDITIVE - else if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.ImportedReferenceByOrdinal)) + else if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.ImportedReferenceByOrdinal)) { // 16-bit Object Number/Module Ordinal Flag - if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.SixteenBitObjectNumberModuleOrdinalFlag)) + if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.SixteenBitObjectNumberModuleOrdinalFlag)) builder.AppendLine(value: $" Ordinal index import module name table: {entry.OrdinalIndexImportModuleNameTableWORD} (0x{entry.OrdinalIndexImportModuleNameTableWORD:X})"); else builder.AppendLine(value: $" Ordinal index import module name table: {entry.OrdinalIndexImportModuleNameTableByte} (0x{entry.OrdinalIndexImportModuleNameTableByte:X})"); // 8-bit Ordinal Flag & 32-bit Target Offset Flag - if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.EightBitOrdinalFlag)) + if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.EightBitOrdinalFlag)) builder.AppendLine(value: $" Imported ordinal number: {entry.ImportedOrdinalNumberByte} (0x{entry.ImportedOrdinalNumberByte:X})"); - else if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.ThirtyTwoBitTargetOffsetFlag)) + else if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.ThirtyTwoBitTargetOffsetFlag)) builder.AppendLine(value: $" Imported ordinal number: {entry.ImportedOrdinalNumberDWORD} (0x{entry.ImportedOrdinalNumberDWORD:X})"); else builder.AppendLine(value: $" Imported ordinal number: {entry.ImportedOrdinalNumberWORD} (0x{entry.ImportedOrdinalNumberWORD:X})"); // Additive Fixup Flag - if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.AdditiveFixupFlag)) + if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.AdditiveFixupFlag)) { // 32-bit Additive Flag - if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.ThirtyTwoBitAdditiveFixupFlag)) + if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.ThirtyTwoBitAdditiveFixupFlag)) builder.AppendLine(value: $" Additive fixup value: {entry.AdditiveFixupValueDWORD} (0x{entry.AdditiveFixupValueDWORD:X})"); else builder.AppendLine(value: $" Additive fixup value: {entry.AdditiveFixupValueWORD} (0x{entry.AdditiveFixupValueWORD:X})"); @@ -829,25 +829,25 @@ namespace BinaryObjectScanner.Wrappers } // MOD ORD# / PROCEDURE NAME OFFSET / ADDITIVE - else if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.ImportedReferenceByName)) + else if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.ImportedReferenceByName)) { // 16-bit Object Number/Module Ordinal Flag - if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.SixteenBitObjectNumberModuleOrdinalFlag)) + if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.SixteenBitObjectNumberModuleOrdinalFlag)) builder.AppendLine(value: $" Ordinal index import module name table: {entry.OrdinalIndexImportModuleNameTableWORD} (0x{entry.OrdinalIndexImportModuleNameTableWORD:X})"); else builder.AppendLine(value: $" Ordinal index import module name table: {entry.OrdinalIndexImportModuleNameTableByte} (0x{entry.OrdinalIndexImportModuleNameTableByte:X})"); // 32-bit Target Offset Flag - if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.ThirtyTwoBitTargetOffsetFlag)) + if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.ThirtyTwoBitTargetOffsetFlag)) builder.AppendLine(value: $" Offset import procedure name table: {entry.OffsetImportProcedureNameTableDWORD} (0x{entry.OffsetImportProcedureNameTableDWORD:X})"); else builder.AppendLine(value: $" Offset import procedure name table: {entry.OffsetImportProcedureNameTableWORD} (0x{entry.OffsetImportProcedureNameTableWORD:X})"); // Additive Fixup Flag - if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.AdditiveFixupFlag)) + if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.AdditiveFixupFlag)) { // 32-bit Additive Flag - if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.ThirtyTwoBitAdditiveFixupFlag)) + if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.ThirtyTwoBitAdditiveFixupFlag)) builder.AppendLine(value: $" Additive fixup value: {entry.AdditiveFixupValueDWORD} (0x{entry.AdditiveFixupValueDWORD:X})"); else builder.AppendLine(value: $" Additive fixup value: {entry.AdditiveFixupValueWORD} (0x{entry.AdditiveFixupValueWORD:X})"); @@ -855,19 +855,19 @@ namespace BinaryObjectScanner.Wrappers } // ORD # / ADDITIVE - else if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.InternalReferenceViaEntryTable)) + else if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.InternalReferenceViaEntryTable)) { // 16-bit Object Number/Module Ordinal Flag - if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.SixteenBitObjectNumberModuleOrdinalFlag)) + if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.SixteenBitObjectNumberModuleOrdinalFlag)) builder.AppendLine($" Target object number: {entry.TargetObjectNumberWORD} (0x{entry.TargetObjectNumberWORD:X})"); else builder.AppendLine($" Target object number: {entry.TargetObjectNumberByte} (0x{entry.TargetObjectNumberByte:X})"); // Additive Fixup Flag - if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.AdditiveFixupFlag)) + if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.AdditiveFixupFlag)) { // 32-bit Additive Flag - if (entry.TargetFlags.HasFlag(Models.LinearExecutable.FixupRecordTargetFlags.ThirtyTwoBitAdditiveFixupFlag)) + if (entry.TargetFlags.HasFlag(SabreTools.Models.LinearExecutable.FixupRecordTargetFlags.ThirtyTwoBitAdditiveFixupFlag)) builder.AppendLine(value: $" Additive fixup value: {entry.AdditiveFixupValueDWORD} (0x{entry.AdditiveFixupValueDWORD:X})"); else builder.AppendLine(value: $" Additive fixup value: {entry.AdditiveFixupValueWORD} (0x{entry.AdditiveFixupValueWORD:X})"); diff --git a/BinaryObjectScanner.Wrappers/MSDOS.cs b/BinaryObjectScanner.Wrappers/MSDOS.cs index d9533f0e..f189f484 100644 --- a/BinaryObjectScanner.Wrappers/MSDOS.cs +++ b/BinaryObjectScanner.Wrappers/MSDOS.cs @@ -82,7 +82,7 @@ namespace BinaryObjectScanner.Wrappers #region Relocation Table /// - public Models.MSDOS.RelocationEntry[] RelocationTable => _executable.RelocationTable; + public SabreTools.Models.MSDOS.RelocationEntry[] RelocationTable => _executable.RelocationTable; #endregion @@ -93,7 +93,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the executable /// - private Models.MSDOS.Executable _executable; + private SabreTools.Models.MSDOS.Executable _executable; #endregion diff --git a/BinaryObjectScanner.Wrappers/MicrosoftCabinet.cs b/BinaryObjectScanner.Wrappers/MicrosoftCabinet.cs index 403b7c1d..7b6b7073 100644 --- a/BinaryObjectScanner.Wrappers/MicrosoftCabinet.cs +++ b/BinaryObjectScanner.Wrappers/MicrosoftCabinet.cs @@ -49,7 +49,7 @@ namespace BinaryObjectScanner.Wrappers public ushort FileCount => _cabinet.Header.FileCount; /// - public Models.MicrosoftCabinet.HeaderFlags Flags => _cabinet.Header.Flags; + public SabreTools.Models.MicrosoftCabinet.HeaderFlags Flags => _cabinet.Header.Flags; /// public ushort SetID => _cabinet.Header.SetID; @@ -86,14 +86,14 @@ namespace BinaryObjectScanner.Wrappers #region Folders /// - public Models.MicrosoftCabinet.CFFOLDER[] Folders => _cabinet.Folders; + public SabreTools.Models.MicrosoftCabinet.CFFOLDER[] Folders => _cabinet.Folders; #endregion #region Files /// - public Models.MicrosoftCabinet.CFFILE[] Files => _cabinet.Files; + public SabreTools.Models.MicrosoftCabinet.CFFILE[] Files => _cabinet.Files; #endregion @@ -104,7 +104,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the cabinet /// - private Models.MicrosoftCabinet.Cabinet _cabinet; + private SabreTools.Models.MicrosoftCabinet.Cabinet _cabinet; #endregion @@ -238,20 +238,20 @@ namespace BinaryObjectScanner.Wrappers foreach (var dataBlock in folder.DataBlocks) { byte[] decompressed = new byte[dataBlock.UncompressedSize]; - switch (folder.CompressionType & Models.MicrosoftCabinet.CompressionType.MASK_TYPE) + switch (folder.CompressionType & SabreTools.Models.MicrosoftCabinet.CompressionType.MASK_TYPE) { - case Models.MicrosoftCabinet.CompressionType.TYPE_NONE: + case SabreTools.Models.MicrosoftCabinet.CompressionType.TYPE_NONE: decompressed = dataBlock.CompressedData; break; - case Models.MicrosoftCabinet.CompressionType.TYPE_MSZIP: - decompressed = new byte[Models.Compression.MSZIP.Constants.ZIPWSIZE]; + case SabreTools.Models.MicrosoftCabinet.CompressionType.TYPE_MSZIP: + decompressed = new byte[SabreTools.Models.Compression.MSZIP.Constants.ZIPWSIZE]; Compression.MSZIP.Decompressor.Decompress(mszip, dataBlock.CompressedSize, dataBlock.CompressedData, dataBlock.UncompressedSize, decompressed); Array.Resize(ref decompressed, dataBlock.UncompressedSize); break; - case Models.MicrosoftCabinet.CompressionType.TYPE_QUANTUM: + case SabreTools.Models.MicrosoftCabinet.CompressionType.TYPE_QUANTUM: Compression.Quantum.Decompressor.Decompress(qtm, dataBlock.CompressedSize, dataBlock.CompressedData, dataBlock.UncompressedSize, decompressed); break; - case Models.MicrosoftCabinet.CompressionType.TYPE_LZX: + case SabreTools.Models.MicrosoftCabinet.CompressionType.TYPE_LZX: Compression.LZX.Decompressor.Decompress(state: lzx, dataBlock.CompressedSize, dataBlock.CompressedData, dataBlock.UncompressedSize, decompressed); break; default: @@ -443,7 +443,7 @@ namespace BinaryObjectScanner.Wrappers builder.AppendLine($" Set ID: {SetID} (0x{SetID:X})"); builder.AppendLine($" Cabinet index: {CabinetIndex} (0x{CabinetIndex:X})"); - if (Flags.HasFlag(Models.MicrosoftCabinet.HeaderFlags.RESERVE_PRESENT)) + if (Flags.HasFlag(SabreTools.Models.MicrosoftCabinet.HeaderFlags.RESERVE_PRESENT)) { builder.AppendLine($" Header reserved size: {HeaderReservedSize} (0x{HeaderReservedSize:X})"); builder.AppendLine($" Folder reserved size: {FolderReservedSize} (0x{FolderReservedSize:X})"); @@ -454,13 +454,13 @@ namespace BinaryObjectScanner.Wrappers builder.AppendLine($" Reserved data = {BitConverter.ToString(ReservedData).Replace("-", " ")}"); } - if (Flags.HasFlag(Models.MicrosoftCabinet.HeaderFlags.PREV_CABINET)) + if (Flags.HasFlag(SabreTools.Models.MicrosoftCabinet.HeaderFlags.PREV_CABINET)) { builder.AppendLine($" Previous cabinet: {CabinetPrev}"); builder.AppendLine($" Previous disk: {DiskPrev}"); } - if (Flags.HasFlag(Models.MicrosoftCabinet.HeaderFlags.NEXT_CABINET)) + if (Flags.HasFlag(SabreTools.Models.MicrosoftCabinet.HeaderFlags.NEXT_CABINET)) { builder.AppendLine($" Next cabinet: {CabinetNext}"); builder.AppendLine($" Next disk: {DiskNext}"); @@ -490,7 +490,7 @@ namespace BinaryObjectScanner.Wrappers builder.AppendLine($" Cab start offset = {entry.CabStartOffset} (0x{entry.CabStartOffset:X})"); builder.AppendLine($" Data count = {entry.DataCount} (0x{entry.DataCount:X})"); builder.AppendLine($" Compression type = {entry.CompressionType} (0x{entry.CompressionType:X})"); - builder.AppendLine($" Masked compression type = {entry.CompressionType & Models.MicrosoftCabinet.CompressionType.MASK_TYPE}"); + builder.AppendLine($" Masked compression type = {entry.CompressionType & SabreTools.Models.MicrosoftCabinet.CompressionType.MASK_TYPE}"); if (entry.ReservedData == null) builder.AppendLine($" Reserved data = [NULL]"); else @@ -507,7 +507,7 @@ namespace BinaryObjectScanner.Wrappers { for (int j = 0; j < entry.DataBlocks.Length; j++) { - Models.MicrosoftCabinet.CFDATA dataBlock = entry.DataBlocks[j]; + SabreTools.Models.MicrosoftCabinet.CFDATA dataBlock = entry.DataBlocks[j]; builder.AppendLine($" Data Block {j}"); builder.AppendLine($" Checksum = {dataBlock.Checksum} (0x{dataBlock.Checksum:X})"); builder.AppendLine($" Compressed size = {dataBlock.CompressedSize} (0x{dataBlock.CompressedSize:X})"); diff --git a/BinaryObjectScanner.Wrappers/N3DS.cs b/BinaryObjectScanner.Wrappers/N3DS.cs index 02caf0cd..b35bc2e0 100644 --- a/BinaryObjectScanner.Wrappers/N3DS.cs +++ b/BinaryObjectScanner.Wrappers/N3DS.cs @@ -32,13 +32,13 @@ namespace BinaryObjectScanner.Wrappers public byte[] MediaId => _cart.Header.MediaId; /// - public Models.N3DS.FilesystemType PartitionsFSType => _cart.Header.PartitionsFSType; + public SabreTools.Models.N3DS.FilesystemType PartitionsFSType => _cart.Header.PartitionsFSType; /// public byte[] PartitionsCryptType => _cart.Header.PartitionsCryptType; /// - public Models.N3DS.PartitionTableEntry[] PartitionsTable => _cart.Header.PartitionsTable; + public SabreTools.Models.N3DS.PartitionTableEntry[] PartitionsTable => _cart.Header.PartitionsTable; #endregion @@ -142,7 +142,7 @@ namespace BinaryObjectScanner.Wrappers public byte[] DCIH_ID_Reserved => _cart.DevelopmentCardInfoHeader?.InitialData?.Reserved; /// - public Models.N3DS.NCCHHeader DCIH_ID_BackupHeader => _cart.DevelopmentCardInfoHeader?.InitialData?.BackupHeader; + public SabreTools.Models.N3DS.NCCHHeader DCIH_ID_BackupHeader => _cart.DevelopmentCardInfoHeader?.InitialData?.BackupHeader; #endregion @@ -194,28 +194,28 @@ namespace BinaryObjectScanner.Wrappers #region Partitions /// - public Models.N3DS.NCCHHeader[] Partitions => _cart.Partitions; + public SabreTools.Models.N3DS.NCCHHeader[] Partitions => _cart.Partitions; #endregion #region Extended Headers /// - public Models.N3DS.NCCHExtendedHeader[] ExtendedHeaders => _cart.ExtendedHeaders; + public SabreTools.Models.N3DS.NCCHExtendedHeader[] ExtendedHeaders => _cart.ExtendedHeaders; #endregion #region ExeFS Headers /// - public Models.N3DS.ExeFSHeader[] ExeFSHeaders => _cart.ExeFSHeaders; + public SabreTools.Models.N3DS.ExeFSHeader[] ExeFSHeaders => _cart.ExeFSHeaders; #endregion #region RomFS Headers /// - public Models.N3DS.RomFSHeader[] RomFSHeaders => _cart.RomFSHeaders; + public SabreTools.Models.N3DS.RomFSHeader[] RomFSHeaders => _cart.RomFSHeaders; #endregion @@ -226,7 +226,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the cart /// - private Models.N3DS.Cart _cart; + private SabreTools.Models.N3DS.Cart _cart; #endregion @@ -334,7 +334,7 @@ namespace BinaryObjectScanner.Wrappers builder.AppendLine(); // If we have a cart image - if (PartitionsFSType == Models.N3DS.FilesystemType.Normal || PartitionsFSType == Models.N3DS.FilesystemType.None) + if (PartitionsFSType == SabreTools.Models.N3DS.FilesystemType.Normal || PartitionsFSType == SabreTools.Models.N3DS.FilesystemType.None) { builder.AppendLine($" Exheader SHA-256 hash: {BitConverter.ToString(ExheaderHash).Replace('-', ' ')}"); builder.AppendLine($" Additional header size: {AdditionalHeaderSize} (0x{AdditionalHeaderSize:X})"); @@ -357,7 +357,7 @@ namespace BinaryObjectScanner.Wrappers } // If we have a firmware image - else if (PartitionsFSType == Models.N3DS.FilesystemType.FIRM) + else if (PartitionsFSType == SabreTools.Models.N3DS.FilesystemType.FIRM) { builder.AppendLine($" Unknown: {BitConverter.ToString(Unknown).Replace('-', ' ')}"); builder.AppendLine($" Encrypted MBR: {BitConverter.ToString(EncryptedMBR).Replace('-', ' ')}"); @@ -488,7 +488,7 @@ namespace BinaryObjectScanner.Wrappers { builder.AppendLine($" Empty partition, no data can be parsed"); } - else if (partitionHeader.MagicID != Models.N3DS.Constants.NCCHMagicNumber) + else if (partitionHeader.MagicID != SabreTools.Models.N3DS.Constants.NCCHMagicNumber) { builder.AppendLine($" Unrecognized partition data, no data can be parsed"); } diff --git a/BinaryObjectScanner.Wrappers/NCF.cs b/BinaryObjectScanner.Wrappers/NCF.cs index a571e4b8..aaed3aa3 100644 --- a/BinaryObjectScanner.Wrappers/NCF.cs +++ b/BinaryObjectScanner.Wrappers/NCF.cs @@ -100,7 +100,7 @@ namespace BinaryObjectScanner.Wrappers #region Directory Entries /// - public Models.NCF.DirectoryEntry[] DirectoryEntries => _file.DirectoryEntries; + public SabreTools.Models.NCF.DirectoryEntry[] DirectoryEntries => _file.DirectoryEntries; #endregion @@ -114,28 +114,28 @@ namespace BinaryObjectScanner.Wrappers #region Directory Info 1 Entries /// - public Models.NCF.DirectoryInfo1Entry[] DirectoryInfo1Entries => _file.DirectoryInfo1Entries; + public SabreTools.Models.NCF.DirectoryInfo1Entry[] DirectoryInfo1Entries => _file.DirectoryInfo1Entries; #endregion #region Directory Info 2 Entries /// - public Models.NCF.DirectoryInfo2Entry[] DirectoryInfo2Entries => _file.DirectoryInfo2Entries; + public SabreTools.Models.NCF.DirectoryInfo2Entry[] DirectoryInfo2Entries => _file.DirectoryInfo2Entries; #endregion #region Directory Copy Entries /// - public Models.NCF.DirectoryCopyEntry[] DirectoryCopyEntries => _file.DirectoryCopyEntries; + public SabreTools.Models.NCF.DirectoryCopyEntry[] DirectoryCopyEntries => _file.DirectoryCopyEntries; #endregion #region Directory Local Entries /// - public Models.NCF.DirectoryLocalEntry[] DirectoryLocalEntries => _file.DirectoryLocalEntries; + public SabreTools.Models.NCF.DirectoryLocalEntry[] DirectoryLocalEntries => _file.DirectoryLocalEntries; #endregion @@ -152,7 +152,7 @@ namespace BinaryObjectScanner.Wrappers #region Unknown Entries /// - public Models.NCF.UnknownEntry[] UnknownEntries => _file.UnknownEntries; + public SabreTools.Models.NCF.UnknownEntry[] UnknownEntries => _file.UnknownEntries; #endregion @@ -185,14 +185,14 @@ namespace BinaryObjectScanner.Wrappers #region Checksum Map Entries /// - public Models.NCF.ChecksumMapEntry[] ChecksumMapEntries => _file.ChecksumMapEntries; + public SabreTools.Models.NCF.ChecksumMapEntry[] ChecksumMapEntries => _file.ChecksumMapEntries; #endregion #region Checksum Entries /// - public Models.NCF.ChecksumEntry[] ChecksumEntries => _file.ChecksumEntries; + public SabreTools.Models.NCF.ChecksumEntry[] ChecksumEntries => _file.ChecksumEntries; #endregion @@ -203,7 +203,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the NCF /// - private Models.NCF.File _file; + private SabreTools.Models.NCF.File _file; #endregion diff --git a/BinaryObjectScanner.Wrappers/NewExecutable.cs b/BinaryObjectScanner.Wrappers/NewExecutable.cs index 5761318c..e227ee4a 100644 --- a/BinaryObjectScanner.Wrappers/NewExecutable.cs +++ b/BinaryObjectScanner.Wrappers/NewExecutable.cs @@ -107,7 +107,7 @@ namespace BinaryObjectScanner.Wrappers public uint CrcChecksum => _executable.Header.CrcChecksum; /// - public Models.NewExecutable.HeaderFlag FlagWord => _executable.Header.FlagWord; + public SabreTools.Models.NewExecutable.HeaderFlag FlagWord => _executable.Header.FlagWord; /// public ushort AutomaticDataSegmentNumber => _executable.Header.AutomaticDataSegmentNumber; @@ -161,10 +161,10 @@ namespace BinaryObjectScanner.Wrappers public ushort ResourceEntriesCount => _executable.Header.ResourceEntriesCount; /// - public Models.NewExecutable.OperatingSystem TargetOperatingSystem => _executable.Header.TargetOperatingSystem; + public SabreTools.Models.NewExecutable.OperatingSystem TargetOperatingSystem => _executable.Header.TargetOperatingSystem; /// - public Models.NewExecutable.OS2Flag AdditionalFlags => _executable.Header.AdditionalFlags; + public SabreTools.Models.NewExecutable.OS2Flag AdditionalFlags => _executable.Header.AdditionalFlags; /// public ushort ReturnThunkOffset => _executable.Header.ReturnThunkOffset; @@ -186,25 +186,25 @@ namespace BinaryObjectScanner.Wrappers #region Tables /// - public Models.NewExecutable.SegmentTableEntry[] SegmentTable => _executable.SegmentTable; + public SabreTools.Models.NewExecutable.SegmentTableEntry[] SegmentTable => _executable.SegmentTable; /// - public Models.NewExecutable.ResourceTable ResourceTable => _executable.ResourceTable; + public SabreTools.Models.NewExecutable.ResourceTable ResourceTable => _executable.ResourceTable; /// - public Models.NewExecutable.ResidentNameTableEntry[] ResidentNameTable => _executable.ResidentNameTable; + public SabreTools.Models.NewExecutable.ResidentNameTableEntry[] ResidentNameTable => _executable.ResidentNameTable; /// - public Models.NewExecutable.ModuleReferenceTableEntry[] ModuleReferenceTable => _executable.ModuleReferenceTable; + public SabreTools.Models.NewExecutable.ModuleReferenceTableEntry[] ModuleReferenceTable => _executable.ModuleReferenceTable; /// - public Dictionary ImportedNameTable => _executable.ImportedNameTable; + public Dictionary ImportedNameTable => _executable.ImportedNameTable; /// - public Models.NewExecutable.EntryTableBundle[] EntryTable => _executable.EntryTable; + public SabreTools.Models.NewExecutable.EntryTableBundle[] EntryTable => _executable.EntryTable; /// - public Models.NewExecutable.NonResidentNameTableEntry[] NonResidentNameTable => _executable.NonResidentNameTable; + public SabreTools.Models.NewExecutable.NonResidentNameTableEntry[] NonResidentNameTable => _executable.NonResidentNameTable; #endregion @@ -221,7 +221,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the executable /// - private Models.NewExecutable.Executable _executable; + private SabreTools.Models.NewExecutable.Executable _executable; #endregion @@ -577,11 +577,11 @@ namespace BinaryObjectScanner.Wrappers builder.AppendLine($" Segment indicator: {entry.SegmentIndicator} (0x{entry.SegmentIndicator:X}) ({entry.GetEntryType()})"); switch (entry.GetEntryType()) { - case Models.NewExecutable.SegmentEntryType.FixedSegment: + case SabreTools.Models.NewExecutable.SegmentEntryType.FixedSegment: builder.AppendLine($" Flag word: {entry.FixedFlagWord} (0x{entry.FixedFlagWord:X})"); builder.AppendLine($" Offset: {entry.FixedOffset} (0x{entry.FixedOffset:X})"); break; - case Models.NewExecutable.SegmentEntryType.MoveableSegment: + case SabreTools.Models.NewExecutable.SegmentEntryType.MoveableSegment: builder.AppendLine($" Flag word: {entry.MoveableFlagWord} (0x{entry.MoveableFlagWord:X})"); builder.AppendLine($" Reserved: {entry.MoveableReserved} (0x{entry.MoveableReserved:X})"); builder.AppendLine($" Segment number: {entry.MoveableSegmentNumber} (0x{entry.MoveableSegmentNumber:X})"); diff --git a/BinaryObjectScanner.Wrappers/Nitro.cs b/BinaryObjectScanner.Wrappers/Nitro.cs index 5156e9de..4e919370 100644 --- a/BinaryObjectScanner.Wrappers/Nitro.cs +++ b/BinaryObjectScanner.Wrappers/Nitro.cs @@ -27,7 +27,7 @@ namespace BinaryObjectScanner.Wrappers public string MakerCode => _cart.CommonHeader.MakerCode; /// - public Models.Nitro.Unitcode UnitCode => _cart.CommonHeader.UnitCode; + public SabreTools.Models.Nitro.Unitcode UnitCode => _cart.CommonHeader.UnitCode; /// public byte EncryptionSeedSelect => _cart.CommonHeader.EncryptionSeedSelect; @@ -300,17 +300,17 @@ namespace BinaryObjectScanner.Wrappers #region Name Table /// - public Models.Nitro.FolderAllocationTableEntry[] FolderAllocationTable => _cart.NameTable.FolderAllocationTable; + public SabreTools.Models.Nitro.FolderAllocationTableEntry[] FolderAllocationTable => _cart.NameTable.FolderAllocationTable; /// - public Models.Nitro.NameListEntry[] NameList => _cart.NameTable.NameList; + public SabreTools.Models.Nitro.NameListEntry[] NameList => _cart.NameTable.NameList; #endregion #region File Allocation Table /// - public Models.Nitro.FileAllocationTableEntry[] FileAllocationTable => _cart.FileAllocationTable; + public SabreTools.Models.Nitro.FileAllocationTableEntry[] FileAllocationTable => _cart.FileAllocationTable; #endregion @@ -321,7 +321,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the cart /// - private Models.Nitro.Cart _cart; + private SabreTools.Models.Nitro.Cart _cart; #endregion diff --git a/BinaryObjectScanner.Wrappers/PAK.cs b/BinaryObjectScanner.Wrappers/PAK.cs index 54032288..ffbf7d26 100644 --- a/BinaryObjectScanner.Wrappers/PAK.cs +++ b/BinaryObjectScanner.Wrappers/PAK.cs @@ -30,7 +30,7 @@ namespace BinaryObjectScanner.Wrappers #region Directory Items /// - public Models.PAK.DirectoryItem[] DirectoryItems => _file.DirectoryItems; + public SabreTools.Models.PAK.DirectoryItem[] DirectoryItems => _file.DirectoryItems; #endregion @@ -47,7 +47,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the PAK /// - private Models.PAK.File _file; + private SabreTools.Models.PAK.File _file; #endregion diff --git a/BinaryObjectScanner.Wrappers/PFF.cs b/BinaryObjectScanner.Wrappers/PFF.cs index 96a67bf3..a6ff98bd 100644 --- a/BinaryObjectScanner.Wrappers/PFF.cs +++ b/BinaryObjectScanner.Wrappers/PFF.cs @@ -36,7 +36,7 @@ namespace BinaryObjectScanner.Wrappers #region Segments /// - public Models.PFF.Segment[] Segments => _archive.Segments; + public SabreTools.Models.PFF.Segment[] Segments => _archive.Segments; #endregion @@ -60,7 +60,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the archive /// - private Models.PFF.Archive _archive; + private SabreTools.Models.PFF.Archive _archive; #endregion diff --git a/BinaryObjectScanner.Wrappers/PlayJAudioFile.cs b/BinaryObjectScanner.Wrappers/PlayJAudioFile.cs index 43cdcc44..2880a15f 100644 --- a/BinaryObjectScanner.Wrappers/PlayJAudioFile.cs +++ b/BinaryObjectScanner.Wrappers/PlayJAudioFile.cs @@ -26,107 +26,107 @@ namespace BinaryObjectScanner.Wrappers #region V1 Only /// - public uint? V1_TrackID => (_audioFile.Header as Models.PlayJ.AudioHeaderV1)?.TrackID; + public uint? V1_TrackID => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV1)?.TrackID; /// - public uint? V1_UnknownOffset1 => (_audioFile.Header as Models.PlayJ.AudioHeaderV1)?.UnknownOffset1; + public uint? V1_UnknownOffset1 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV1)?.UnknownOffset1; /// - public uint? V1_UnknownOffset2 => (_audioFile.Header as Models.PlayJ.AudioHeaderV1)?.UnknownOffset2; + public uint? V1_UnknownOffset2 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV1)?.UnknownOffset2; /// - public uint? V1_UnknownOffset3 => (_audioFile.Header as Models.PlayJ.AudioHeaderV1)?.UnknownOffset3; + public uint? V1_UnknownOffset3 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV1)?.UnknownOffset3; /// - public uint? V1_Unknown1 => (_audioFile.Header as Models.PlayJ.AudioHeaderV1)?.Unknown1; + public uint? V1_Unknown1 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV1)?.Unknown1; /// - public uint? V1_Unknown2 => (_audioFile.Header as Models.PlayJ.AudioHeaderV1)?.Unknown2; + public uint? V1_Unknown2 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV1)?.Unknown2; /// - public uint? V1_Year => (_audioFile.Header as Models.PlayJ.AudioHeaderV1)?.Year; + public uint? V1_Year => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV1)?.Year; /// - public uint? V1_TrackNumber => (_audioFile.Header as Models.PlayJ.AudioHeaderV1)?.TrackNumber; + public uint? V1_TrackNumber => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV1)?.TrackNumber; /// - public Models.PlayJ.Subgenre? V1_Subgenre => (_audioFile.Header as Models.PlayJ.AudioHeaderV1)?.Subgenre; + public SabreTools.Models.PlayJ.Subgenre? V1_Subgenre => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV1)?.Subgenre; /// - public uint? V1_Duration => (_audioFile.Header as Models.PlayJ.AudioHeaderV1)?.Duration; + public uint? V1_Duration => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV1)?.Duration; #endregion #region V2 Only /// - public uint? V2_Unknown1 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown1; + public uint? V2_Unknown1 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown1; /// - public uint? V2_Unknown2 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown2; + public uint? V2_Unknown2 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown2; /// - public uint? V2_Unknown3 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown3; + public uint? V2_Unknown3 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown3; /// - public uint? V2_Unknown4 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown4; + public uint? V2_Unknown4 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown4; /// - public uint? V2_Unknown5 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown5; + public uint? V2_Unknown5 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown5; /// - public uint? V2_Unknown6 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown6; + public uint? V2_Unknown6 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown6; /// - public uint? V2_UnknownOffset1 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.UnknownOffset1; + public uint? V2_UnknownOffset1 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.UnknownOffset1; /// - public uint? V2_Unknown7 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown7; + public uint? V2_Unknown7 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown7; /// - public uint? V2_Unknown8 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown8; + public uint? V2_Unknown8 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown8; /// - public uint? V2_Unknown9 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown9; + public uint? V2_Unknown9 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown9; /// - public uint? V2_UnknownOffset2 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.UnknownOffset2; + public uint? V2_UnknownOffset2 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.UnknownOffset2; /// - public uint? V2_Unknown10 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown10; + public uint? V2_Unknown10 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown10; /// - public uint? V2_Unknown11 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown11; + public uint? V2_Unknown11 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown11; /// - public uint? V2_Unknown12 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown12; + public uint? V2_Unknown12 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown12; /// - public uint? V2_Unknown13 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown13; + public uint? V2_Unknown13 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown13; /// - public uint? V2_Unknown14 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown14; + public uint? V2_Unknown14 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown14; /// - public uint? V2_Unknown15 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown15; + public uint? V2_Unknown15 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown15; /// - public uint? V2_Unknown16 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown16; + public uint? V2_Unknown16 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown16; /// - public uint? V2_Unknown17 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown17; + public uint? V2_Unknown17 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown17; /// - public uint? V2_TrackID => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.TrackID; + public uint? V2_TrackID => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.TrackID; /// - public uint? V2_Year => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Year; + public uint? V2_Year => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Year; /// - public uint? V2_TrackNumber => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.TrackNumber; + public uint? V2_TrackNumber => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.TrackNumber; /// - public uint? V2_Unknown18 => (_audioFile.Header as Models.PlayJ.AudioHeaderV2)?.Unknown18; + public uint? V2_Unknown18 => (_audioFile.Header as SabreTools.Models.PlayJ.AudioHeaderV2)?.Unknown18; #endregion @@ -214,7 +214,7 @@ namespace BinaryObjectScanner.Wrappers #region Unknown Block 3 /// - public Models.PlayJ.DataFile[] DataFiles => _audioFile.DataFiles; + public SabreTools.Models.PlayJ.DataFile[] DataFiles => _audioFile.DataFiles; #endregion @@ -227,7 +227,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the archive /// - private Models.PlayJ.AudioFile _audioFile; + private SabreTools.Models.PlayJ.AudioFile _audioFile; #endregion diff --git a/BinaryObjectScanner.Wrappers/PortableExecutable.cs b/BinaryObjectScanner.Wrappers/PortableExecutable.cs index 7eb270ff..cd22bc32 100644 --- a/BinaryObjectScanner.Wrappers/PortableExecutable.cs +++ b/BinaryObjectScanner.Wrappers/PortableExecutable.cs @@ -96,7 +96,7 @@ namespace BinaryObjectScanner.Wrappers #region COFF File Header /// - public Models.PortableExecutable.MachineType Machine => _executable.COFFFileHeader.Machine; + public SabreTools.Models.PortableExecutable.MachineType Machine => _executable.COFFFileHeader.Machine; /// public ushort NumberOfSections => _executable.COFFFileHeader.NumberOfSections; @@ -114,7 +114,7 @@ namespace BinaryObjectScanner.Wrappers public uint SizeOfOptionalHeader => _executable.COFFFileHeader.SizeOfOptionalHeader; /// - public Models.PortableExecutable.Characteristics Characteristics => _executable.COFFFileHeader.Characteristics; + public SabreTools.Models.PortableExecutable.Characteristics Characteristics => _executable.COFFFileHeader.Characteristics; #endregion @@ -123,7 +123,7 @@ namespace BinaryObjectScanner.Wrappers #region Standard Fields /// - public Models.PortableExecutable.OptionalHeaderMagicNumber OH_Magic => _executable.OptionalHeader.Magic; + public SabreTools.Models.PortableExecutable.OptionalHeaderMagicNumber OH_Magic => _executable.OptionalHeader.Magic; /// public byte OH_MajorLinkerVersion => _executable.OptionalHeader.MajorLinkerVersion; @@ -147,7 +147,7 @@ namespace BinaryObjectScanner.Wrappers public uint OH_BaseOfCode => _executable.OptionalHeader.BaseOfCode; /// - public uint? OH_BaseOfData => _executable.OptionalHeader.Magic == Models.PortableExecutable.OptionalHeaderMagicNumber.PE32 + public uint? OH_BaseOfData => _executable.OptionalHeader.Magic == SabreTools.Models.PortableExecutable.OptionalHeaderMagicNumber.PE32 ? (uint?)_executable.OptionalHeader.BaseOfData : null; @@ -156,7 +156,7 @@ namespace BinaryObjectScanner.Wrappers #region Windows-Specific Fields /// - public ulong OH_ImageBase => _executable.OptionalHeader.Magic == Models.PortableExecutable.OptionalHeaderMagicNumber.PE32 + public ulong OH_ImageBase => _executable.OptionalHeader.Magic == SabreTools.Models.PortableExecutable.OptionalHeaderMagicNumber.PE32 ? _executable.OptionalHeader.ImageBase_PE32 : _executable.OptionalHeader.ImageBase_PE32Plus; @@ -197,28 +197,28 @@ namespace BinaryObjectScanner.Wrappers public uint OH_CheckSum => _executable.OptionalHeader.CheckSum; /// - public Models.PortableExecutable.WindowsSubsystem OH_Subsystem => _executable.OptionalHeader.Subsystem; + public SabreTools.Models.PortableExecutable.WindowsSubsystem OH_Subsystem => _executable.OptionalHeader.Subsystem; /// - public Models.PortableExecutable.DllCharacteristics OH_DllCharacteristics => _executable.OptionalHeader.DllCharacteristics; + public SabreTools.Models.PortableExecutable.DllCharacteristics OH_DllCharacteristics => _executable.OptionalHeader.DllCharacteristics; /// - public ulong OH_SizeOfStackReserve => _executable.OptionalHeader.Magic == Models.PortableExecutable.OptionalHeaderMagicNumber.PE32 + public ulong OH_SizeOfStackReserve => _executable.OptionalHeader.Magic == SabreTools.Models.PortableExecutable.OptionalHeaderMagicNumber.PE32 ? _executable.OptionalHeader.SizeOfStackReserve_PE32 : _executable.OptionalHeader.SizeOfStackReserve_PE32Plus; /// - public ulong OH_SizeOfStackCommit => _executable.OptionalHeader.Magic == Models.PortableExecutable.OptionalHeaderMagicNumber.PE32 + public ulong OH_SizeOfStackCommit => _executable.OptionalHeader.Magic == SabreTools.Models.PortableExecutable.OptionalHeaderMagicNumber.PE32 ? _executable.OptionalHeader.SizeOfStackCommit_PE32 : _executable.OptionalHeader.SizeOfStackCommit_PE32Plus; /// - public ulong OH_SizeOfHeapReserve => _executable.OptionalHeader.Magic == Models.PortableExecutable.OptionalHeaderMagicNumber.PE32 + public ulong OH_SizeOfHeapReserve => _executable.OptionalHeader.Magic == SabreTools.Models.PortableExecutable.OptionalHeaderMagicNumber.PE32 ? _executable.OptionalHeader.SizeOfHeapReserve_PE32 : _executable.OptionalHeader.SizeOfHeapReserve_PE32Plus; /// - public ulong OH_SizeOfHeapCommit => _executable.OptionalHeader.Magic == Models.PortableExecutable.OptionalHeaderMagicNumber.PE32 + public ulong OH_SizeOfHeapCommit => _executable.OptionalHeader.Magic == SabreTools.Models.PortableExecutable.OptionalHeaderMagicNumber.PE32 ? _executable.OptionalHeader.SizeOfHeapCommit_PE32 : _executable.OptionalHeader.SizeOfHeapCommit_PE32Plus; @@ -233,49 +233,49 @@ namespace BinaryObjectScanner.Wrappers #region Data Directories /// - public Models.PortableExecutable.DataDirectory OH_ExportTable => _executable.OptionalHeader.ExportTable; + public SabreTools.Models.PortableExecutable.DataDirectory OH_ExportTable => _executable.OptionalHeader.ExportTable; /// - public Models.PortableExecutable.DataDirectory OH_ImportTable => _executable.OptionalHeader.ImportTable; + public SabreTools.Models.PortableExecutable.DataDirectory OH_ImportTable => _executable.OptionalHeader.ImportTable; /// - public Models.PortableExecutable.DataDirectory OH_ResourceTable => _executable.OptionalHeader.ResourceTable; + public SabreTools.Models.PortableExecutable.DataDirectory OH_ResourceTable => _executable.OptionalHeader.ResourceTable; /// - public Models.PortableExecutable.DataDirectory OH_ExceptionTable => _executable.OptionalHeader.ExceptionTable; + public SabreTools.Models.PortableExecutable.DataDirectory OH_ExceptionTable => _executable.OptionalHeader.ExceptionTable; /// - public Models.PortableExecutable.DataDirectory OH_CertificateTable => _executable.OptionalHeader.CertificateTable; + public SabreTools.Models.PortableExecutable.DataDirectory OH_CertificateTable => _executable.OptionalHeader.CertificateTable; /// - public Models.PortableExecutable.DataDirectory OH_BaseRelocationTable => _executable.OptionalHeader.BaseRelocationTable; + public SabreTools.Models.PortableExecutable.DataDirectory OH_BaseRelocationTable => _executable.OptionalHeader.BaseRelocationTable; /// - public Models.PortableExecutable.DataDirectory OH_Debug => _executable.OptionalHeader.Debug; + public SabreTools.Models.PortableExecutable.DataDirectory OH_Debug => _executable.OptionalHeader.Debug; /// public ulong OH_Architecture => _executable.OptionalHeader.Architecture; /// - public Models.PortableExecutable.DataDirectory OH_GlobalPtr => _executable.OptionalHeader.GlobalPtr; + public SabreTools.Models.PortableExecutable.DataDirectory OH_GlobalPtr => _executable.OptionalHeader.GlobalPtr; /// - public Models.PortableExecutable.DataDirectory OH_ThreadLocalStorageTable => _executable.OptionalHeader.ThreadLocalStorageTable; + public SabreTools.Models.PortableExecutable.DataDirectory OH_ThreadLocalStorageTable => _executable.OptionalHeader.ThreadLocalStorageTable; /// - public Models.PortableExecutable.DataDirectory OH_LoadConfigTable => _executable.OptionalHeader.LoadConfigTable; + public SabreTools.Models.PortableExecutable.DataDirectory OH_LoadConfigTable => _executable.OptionalHeader.LoadConfigTable; /// - public Models.PortableExecutable.DataDirectory OH_BoundImport => _executable.OptionalHeader.BoundImport; + public SabreTools.Models.PortableExecutable.DataDirectory OH_BoundImport => _executable.OptionalHeader.BoundImport; /// - public Models.PortableExecutable.DataDirectory OH_ImportAddressTable => _executable.OptionalHeader.ImportAddressTable; + public SabreTools.Models.PortableExecutable.DataDirectory OH_ImportAddressTable => _executable.OptionalHeader.ImportAddressTable; /// - public Models.PortableExecutable.DataDirectory OH_DelayImportDescriptor => _executable.OptionalHeader.DelayImportDescriptor; + public SabreTools.Models.PortableExecutable.DataDirectory OH_DelayImportDescriptor => _executable.OptionalHeader.DelayImportDescriptor; /// - public Models.PortableExecutable.DataDirectory OH_CLRRuntimeHeader => _executable.OptionalHeader.CLRRuntimeHeader; + public SabreTools.Models.PortableExecutable.DataDirectory OH_CLRRuntimeHeader => _executable.OptionalHeader.CLRRuntimeHeader; /// public ulong OH_Reserved => _executable.OptionalHeader.Reserved; @@ -287,38 +287,38 @@ namespace BinaryObjectScanner.Wrappers #region Tables /// - public Models.PortableExecutable.SectionHeader[] SectionTable => _executable.SectionTable; + public SabreTools.Models.PortableExecutable.SectionHeader[] SectionTable => _executable.SectionTable; /// - public Models.PortableExecutable.COFFSymbolTableEntry[] COFFSymbolTable => _executable.COFFSymbolTable; + public SabreTools.Models.PortableExecutable.COFFSymbolTableEntry[] COFFSymbolTable => _executable.COFFSymbolTable; /// - public Models.PortableExecutable.COFFStringTable COFFStringTable => _executable.COFFStringTable; + public SabreTools.Models.PortableExecutable.COFFStringTable COFFStringTable => _executable.COFFStringTable; /// - public Models.PortableExecutable.AttributeCertificateTableEntry[] AttributeCertificateTable => _executable.AttributeCertificateTable; + public SabreTools.Models.PortableExecutable.AttributeCertificateTableEntry[] AttributeCertificateTable => _executable.AttributeCertificateTable; /// - public Models.PortableExecutable.DelayLoadDirectoryTable DelayLoadDirectoryTable => _executable.DelayLoadDirectoryTable; + public SabreTools.Models.PortableExecutable.DelayLoadDirectoryTable DelayLoadDirectoryTable => _executable.DelayLoadDirectoryTable; #endregion #region Sections /// - public Models.PortableExecutable.BaseRelocationBlock[] BaseRelocationTable => _executable.BaseRelocationTable; + public SabreTools.Models.PortableExecutable.BaseRelocationBlock[] BaseRelocationTable => _executable.BaseRelocationTable; /// - public Models.PortableExecutable.DebugTable DebugTable => _executable.DebugTable; + public SabreTools.Models.PortableExecutable.DebugTable DebugTable => _executable.DebugTable; /// - public Models.PortableExecutable.ExportTable ExportTable => _executable.ExportTable; + public SabreTools.Models.PortableExecutable.ExportTable ExportTable => _executable.ExportTable; /// public string[] ExportNameTable => _executable.ExportTable?.ExportNameTable?.Strings; /// - public Models.PortableExecutable.ImportTable ImportTable => _executable.ImportTable; + public SabreTools.Models.PortableExecutable.ImportTable ImportTable => _executable.ImportTable; /// public string[] ImportHintNameTable => _executable.ImportTable?.HintNameTable != null @@ -326,7 +326,7 @@ namespace BinaryObjectScanner.Wrappers : null; /// - public Models.PortableExecutable.ResourceDirectoryTable ResourceDirectoryTable => _executable.ResourceDirectoryTable; + public SabreTools.Models.PortableExecutable.ResourceDirectoryTable ResourceDirectoryTable => _executable.ResourceDirectoryTable; #endregion @@ -906,7 +906,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the executable /// - private Models.PortableExecutable.Executable _executable; + private SabreTools.Models.PortableExecutable.Executable _executable; /// /// Header padding data, if it exists @@ -981,12 +981,12 @@ namespace BinaryObjectScanner.Wrappers /// /// Cached version info data /// - private Models.PortableExecutable.VersionInfo _versionInfo = null; + private SabreTools.Models.PortableExecutable.VersionInfo _versionInfo = null; /// /// Cached assembly manifest data /// - private Models.PortableExecutable.AssemblyManifest _assemblyManifest = null; + private SabreTools.Models.PortableExecutable.AssemblyManifest _assemblyManifest = null; /// /// Lock object for reading from the source @@ -1091,7 +1091,7 @@ namespace BinaryObjectScanner.Wrappers /// Get the assembly manifest, if possible /// /// Assembly manifest object, null on error - private Models.PortableExecutable.AssemblyManifest GetAssemblyManifest() + private SabreTools.Models.PortableExecutable.AssemblyManifest GetAssemblyManifest() { // Use the cached data if possible if (_assemblyManifest != null) @@ -1224,7 +1224,7 @@ namespace BinaryObjectScanner.Wrappers builder.AppendLine($" Size of uninitialized data: {OH_SizeOfUninitializedData} (0x{OH_SizeOfUninitializedData:X})"); builder.AppendLine($" Address of entry point: {OH_AddressOfEntryPoint} (0x{OH_AddressOfEntryPoint:X})"); builder.AppendLine($" Base of code: {OH_BaseOfCode} (0x{OH_BaseOfCode:X})"); - if (OH_Magic == Models.PortableExecutable.OptionalHeaderMagicNumber.PE32) + if (OH_Magic == SabreTools.Models.PortableExecutable.OptionalHeaderMagicNumber.PE32) builder.AppendLine($" Base of data: {OH_BaseOfData} (0x{OH_BaseOfData:X})"); builder.AppendLine($" Image base: {OH_ImageBase} (0x{OH_ImageBase:X})"); @@ -1446,36 +1446,36 @@ namespace BinaryObjectScanner.Wrappers if (auxSymbolsRemaining == 0) continue; - if (entry.StorageClass == Models.PortableExecutable.StorageClass.IMAGE_SYM_CLASS_EXTERNAL - && entry.SymbolType == Models.PortableExecutable.SymbolType.IMAGE_SYM_TYPE_FUNC + if (entry.StorageClass == SabreTools.Models.PortableExecutable.StorageClass.IMAGE_SYM_CLASS_EXTERNAL + && entry.SymbolType == SabreTools.Models.PortableExecutable.SymbolType.IMAGE_SYM_TYPE_FUNC && entry.SectionNumber > 0) { currentSymbolType = 1; } - else if (entry.StorageClass == Models.PortableExecutable.StorageClass.IMAGE_SYM_CLASS_FUNCTION + else if (entry.StorageClass == SabreTools.Models.PortableExecutable.StorageClass.IMAGE_SYM_CLASS_FUNCTION && entry.ShortName != null && ((entry.ShortName[0] == 0x2E && entry.ShortName[1] == 0x62 && entry.ShortName[2] == 0x66) // .bf || (entry.ShortName[0] == 0x2E && entry.ShortName[1] == 0x65 && entry.ShortName[2] == 0x66))) // .ef { currentSymbolType = 2; } - else if (entry.StorageClass == Models.PortableExecutable.StorageClass.IMAGE_SYM_CLASS_EXTERNAL - && entry.SectionNumber == (ushort)Models.PortableExecutable.SectionNumber.IMAGE_SYM_UNDEFINED + else if (entry.StorageClass == SabreTools.Models.PortableExecutable.StorageClass.IMAGE_SYM_CLASS_EXTERNAL + && entry.SectionNumber == (ushort)SabreTools.Models.PortableExecutable.SectionNumber.IMAGE_SYM_UNDEFINED && entry.Value == 0) { currentSymbolType = 3; } - else if (entry.StorageClass == Models.PortableExecutable.StorageClass.IMAGE_SYM_CLASS_FILE) + else if (entry.StorageClass == SabreTools.Models.PortableExecutable.StorageClass.IMAGE_SYM_CLASS_FILE) { // TODO: Symbol name should be ".file" currentSymbolType = 4; } - else if (entry.StorageClass == Models.PortableExecutable.StorageClass.IMAGE_SYM_CLASS_STATIC) + else if (entry.StorageClass == SabreTools.Models.PortableExecutable.StorageClass.IMAGE_SYM_CLASS_STATIC) { // TODO: Should have the name of a section (like ".text") currentSymbolType = 5; } - else if (entry.StorageClass == Models.PortableExecutable.StorageClass.IMAGE_SYM_CLASS_CLR_TOKEN) + else if (entry.StorageClass == SabreTools.Models.PortableExecutable.StorageClass.IMAGE_SYM_CLASS_CLR_TOKEN) { currentSymbolType = 6; } @@ -1582,7 +1582,7 @@ namespace BinaryObjectScanner.Wrappers builder.AppendLine($" Revision: {entry.Revision} (0x{entry.Revision:X})"); builder.AppendLine($" Certificate type: {entry.CertificateType} (0x{entry.CertificateType:X})"); builder.AppendLine(); - if (entry.CertificateType == Models.PortableExecutable.WindowsCertificateType.WIN_CERT_TYPE_PKCS_SIGNED_DATA) + if (entry.CertificateType == SabreTools.Models.PortableExecutable.WindowsCertificateType.WIN_CERT_TYPE_PKCS_SIGNED_DATA) { builder.AppendLine(" Certificate Data [Formatted]"); builder.AppendLine(" -------------------------"); @@ -2001,7 +2001,7 @@ namespace BinaryObjectScanner.Wrappers /// Pretty print the resource directory table information /// /// StringBuilder to append information to - private static void PrintResourceDirectoryTable(Models.PortableExecutable.ResourceDirectoryTable table, int level, List types, StringBuilder builder) + private static void PrintResourceDirectoryTable(SabreTools.Models.PortableExecutable.ResourceDirectoryTable table, int level, List types, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); @@ -2041,7 +2041,7 @@ namespace BinaryObjectScanner.Wrappers /// Pretty print the resource directory entry information /// /// StringBuilder to append information to - private static void PrintResourceDirectoryEntry(Models.PortableExecutable.ResourceDirectoryEntry entry, int level, List types, StringBuilder builder) + private static void PrintResourceDirectoryEntry(SabreTools.Models.PortableExecutable.ResourceDirectoryEntry entry, int level, List types, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); @@ -2066,7 +2066,7 @@ namespace BinaryObjectScanner.Wrappers /// Pretty print the resource data entry information /// /// StringBuilder to append information to - private static void PrintResourceDataEntry(Models.PortableExecutable.ResourceDataEntry entry, int level, List types, StringBuilder builder) + private static void PrintResourceDataEntry(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, List types, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); @@ -2082,69 +2082,69 @@ namespace BinaryObjectScanner.Wrappers // TODO: Print out per-type data if (types != null && types.Count > 0 && types[0] is uint resourceType) { - switch ((Models.PortableExecutable.ResourceType)resourceType) + switch ((SabreTools.Models.PortableExecutable.ResourceType)resourceType) { - case Models.PortableExecutable.ResourceType.RT_CURSOR: + case SabreTools.Models.PortableExecutable.ResourceType.RT_CURSOR: PrintResourceRT_CURSOR(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_BITMAP: + case SabreTools.Models.PortableExecutable.ResourceType.RT_BITMAP: PrintResourceRT_BITMAP(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_ICON: + case SabreTools.Models.PortableExecutable.ResourceType.RT_ICON: PrintResourceRT_ICON(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_MENU: + case SabreTools.Models.PortableExecutable.ResourceType.RT_MENU: PrintResourceRT_MENU(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_DIALOG: + case SabreTools.Models.PortableExecutable.ResourceType.RT_DIALOG: PrintResourceRT_DIALOG(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_STRING: + case SabreTools.Models.PortableExecutable.ResourceType.RT_STRING: PrintResourceRT_STRING(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_FONTDIR: + case SabreTools.Models.PortableExecutable.ResourceType.RT_FONTDIR: PrintResourceRT_FONTDIR(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_FONT: + case SabreTools.Models.PortableExecutable.ResourceType.RT_FONT: PrintResourceRT_FONT(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_ACCELERATOR: + case SabreTools.Models.PortableExecutable.ResourceType.RT_ACCELERATOR: PrintResourceRT_ACCELERATOR(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_RCDATA: + case SabreTools.Models.PortableExecutable.ResourceType.RT_RCDATA: PrintResourceRT_RCDATA(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_MESSAGETABLE: + case SabreTools.Models.PortableExecutable.ResourceType.RT_MESSAGETABLE: PrintResourceRT_MESSAGETABLE(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_GROUP_CURSOR: + case SabreTools.Models.PortableExecutable.ResourceType.RT_GROUP_CURSOR: PrintResourceRT_GROUP_CURSOR(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_GROUP_ICON: + case SabreTools.Models.PortableExecutable.ResourceType.RT_GROUP_ICON: PrintResourceRT_GROUP_ICON(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_VERSION: + case SabreTools.Models.PortableExecutable.ResourceType.RT_VERSION: PrintResourceRT_VERSION(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_DLGINCLUDE: + case SabreTools.Models.PortableExecutable.ResourceType.RT_DLGINCLUDE: PrintResourceRT_DLGINCLUDE(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_PLUGPLAY: + case SabreTools.Models.PortableExecutable.ResourceType.RT_PLUGPLAY: PrintResourceRT_PLUGPLAY(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_VXD: + case SabreTools.Models.PortableExecutable.ResourceType.RT_VXD: PrintResourceRT_VXD(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_ANICURSOR: + case SabreTools.Models.PortableExecutable.ResourceType.RT_ANICURSOR: PrintResourceRT_ANICURSOR(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_ANIICON: + case SabreTools.Models.PortableExecutable.ResourceType.RT_ANIICON: PrintResourceRT_ANIICON(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_HTML: + case SabreTools.Models.PortableExecutable.ResourceType.RT_HTML: PrintResourceRT_HTML(entry, level, builder); break; - case Models.PortableExecutable.ResourceType.RT_MANIFEST: + case SabreTools.Models.PortableExecutable.ResourceType.RT_MANIFEST: PrintResourceRT_MANIFEST(entry, level, builder); break; default: @@ -2164,7 +2164,7 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_CURSOR resource /// /// StringBuilder to append information to - private static void PrintResourceRT_CURSOR(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_CURSOR(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); builder.AppendLine($"{padding}Hardware-dependent cursor resource found, not parsed yet"); @@ -2174,7 +2174,7 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_BITMAP resource /// /// StringBuilder to append information to - private static void PrintResourceRT_BITMAP(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_BITMAP(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); builder.AppendLine($"{padding}Bitmap resource found, not parsed yet"); @@ -2184,7 +2184,7 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_ICON resource /// /// StringBuilder to append information to - private static void PrintResourceRT_ICON(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_ICON(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); builder.AppendLine($"{padding}Hardware-dependent icon resource found, not parsed yet"); @@ -2194,11 +2194,11 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_MENU resource /// /// StringBuilder to append information to - private static void PrintResourceRT_MENU(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_MENU(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); - Models.PortableExecutable.MenuResource menu = null; + SabreTools.Models.PortableExecutable.MenuResource menu = null; try { menu = entry.AsMenu(); } catch { } if (menu == null) { @@ -2277,11 +2277,11 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_DIALOG resource /// /// StringBuilder to append information to - private static void PrintResourceRT_DIALOG(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_DIALOG(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); - Models.PortableExecutable.DialogBoxResource dialogBox = null; + SabreTools.Models.PortableExecutable.DialogBoxResource dialogBox = null; try { dialogBox = entry.AsDialogBox(); } catch { } if (dialogBox == null) { @@ -2406,7 +2406,7 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_STRING resource /// /// StringBuilder to append information to - private static void PrintResourceRT_STRING(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_STRING(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); @@ -2430,7 +2430,7 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_FONTDIR resource /// /// StringBuilder to append information to - private static void PrintResourceRT_FONTDIR(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_FONTDIR(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); builder.AppendLine($"{padding}Font directory resource found, not parsed yet"); @@ -2440,7 +2440,7 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_FONT resource /// /// StringBuilder to append information to - private static void PrintResourceRT_FONT(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_FONT(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); builder.AppendLine($"{padding}Font resource found, not parsed yet"); @@ -2450,11 +2450,11 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_ACCELERATOR resource /// /// StringBuilder to append information to - private static void PrintResourceRT_ACCELERATOR(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_ACCELERATOR(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); - Models.PortableExecutable.AcceleratorTableEntry[] acceleratorTable = null; + SabreTools.Models.PortableExecutable.AcceleratorTableEntry[] acceleratorTable = null; try { acceleratorTable = entry.AsAcceleratorTableResource(); } catch { } if (acceleratorTable == null) { @@ -2477,7 +2477,7 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_RCDATA resource /// /// StringBuilder to append information to - private static void PrintResourceRT_RCDATA(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_RCDATA(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); builder.AppendLine($"{padding}Application-defined resource found, not parsed yet"); @@ -2520,11 +2520,11 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_MESSAGETABLE resource /// /// StringBuilder to append information to - private static void PrintResourceRT_MESSAGETABLE(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_MESSAGETABLE(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); - Models.PortableExecutable.MessageResourceData messageTable = null; + SabreTools.Models.PortableExecutable.MessageResourceData messageTable = null; try { messageTable = entry.AsMessageResourceData(); } catch { } if (messageTable == null) { @@ -2582,7 +2582,7 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_GROUP_CURSOR resource /// /// StringBuilder to append information to - private static void PrintResourceRT_GROUP_CURSOR(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_GROUP_CURSOR(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); builder.AppendLine($"{padding}Hardware-independent cursor resource found, not parsed yet"); @@ -2592,7 +2592,7 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_GROUP_ICON resource /// /// StringBuilder to append information to - private static void PrintResourceRT_GROUP_ICON(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_GROUP_ICON(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); builder.AppendLine($"{padding}Hardware-independent icon resource found, not parsed yet"); @@ -2602,11 +2602,11 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_VERSION resource /// /// StringBuilder to append information to - private static void PrintResourceRT_VERSION(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_VERSION(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); - Models.PortableExecutable.VersionInfo versionInfo = null; + SabreTools.Models.PortableExecutable.VersionInfo versionInfo = null; try { versionInfo = entry.AsVersionInfo(); } catch { } if (versionInfo == null) { @@ -2712,7 +2712,7 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_DLGINCLUDE resource /// /// StringBuilder to append information to - private static void PrintResourceRT_DLGINCLUDE(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_DLGINCLUDE(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); builder.AppendLine($"{padding}External header resource found, not parsed yet"); @@ -2722,7 +2722,7 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_PLUGPLAY resource /// /// StringBuilder to append information to - private static void PrintResourceRT_PLUGPLAY(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_PLUGPLAY(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); builder.AppendLine($"{padding}Plug and Play resource found, not parsed yet"); @@ -2732,7 +2732,7 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_VXD resource /// /// StringBuilder to append information to - private static void PrintResourceRT_VXD(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_VXD(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); builder.AppendLine($"{padding}VXD found, not parsed yet"); @@ -2742,7 +2742,7 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_ANICURSOR resource /// /// StringBuilder to append information to - private static void PrintResourceRT_ANICURSOR(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_ANICURSOR(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); builder.AppendLine($"{padding}Animated cursor found, not parsed yet"); @@ -2752,7 +2752,7 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_ANIICON resource /// /// StringBuilder to append information to - private static void PrintResourceRT_ANIICON(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_ANIICON(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); builder.AppendLine($"{padding}Animated icon found, not parsed yet"); @@ -2762,7 +2762,7 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_HTML resource /// /// StringBuilder to append information to - private static void PrintResourceRT_HTML(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_HTML(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); builder.AppendLine($"{padding}HTML resource found, not parsed yet"); @@ -2779,11 +2779,11 @@ namespace BinaryObjectScanner.Wrappers /// Print an RT_MANIFEST resource /// /// StringBuilder to append information to - private static void PrintResourceRT_MANIFEST(Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) + private static void PrintResourceRT_MANIFEST(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); - Models.PortableExecutable.AssemblyManifest assemblyManifest = null; + SabreTools.Models.PortableExecutable.AssemblyManifest assemblyManifest = null; try { assemblyManifest = entry.AsAssemblyManifest(); } catch { } if (assemblyManifest == null) { @@ -2946,13 +2946,13 @@ namespace BinaryObjectScanner.Wrappers /// Print an UNKNOWN or custom resource /// /// StringBuilder to append information to - private static void PrintResourceUNKNOWN(Models.PortableExecutable.ResourceDataEntry entry, int level, object resourceType, StringBuilder builder) + private static void PrintResourceUNKNOWN(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, int level, object resourceType, StringBuilder builder) { string padding = new string(' ', (level + 1) * 2); // Print the type first if (resourceType is uint numericType) - builder.AppendLine($"{padding}Type {(Models.PortableExecutable.ResourceType)numericType} found, not parsed yet"); + builder.AppendLine($"{padding}Type {(SabreTools.Models.PortableExecutable.ResourceType)numericType} found, not parsed yet"); else if (resourceType is string stringType) builder.AppendLine($"{padding}Type {stringType} found, not parsed yet"); else @@ -3015,13 +3015,13 @@ namespace BinaryObjectScanner.Wrappers return Enumerable.Empty(); var nb10Found = DebugData.Select(r => r.Value) - .Select(r => r as Models.PortableExecutable.NB10ProgramDatabase) + .Select(r => r as SabreTools.Models.PortableExecutable.NB10ProgramDatabase) .Where(n => n != null) .Where(n => n.PdbFileName.Contains(path)) .Select(n => (object)n); var rsdsFound = DebugData.Select(r => r.Value) - .Select(r => r as Models.PortableExecutable.RSDSProgramDatabase) + .Select(r => r as SabreTools.Models.PortableExecutable.RSDSProgramDatabase) .Where(r => r != null) .Where(r => r.PathAndFileName.Contains(path)) .Select(r => (object)r); @@ -3095,7 +3095,7 @@ namespace BinaryObjectScanner.Wrappers continue; // If we have CodeView debug data, try to parse it - if (entry.DebugType == Models.PortableExecutable.DebugType.IMAGE_DEBUG_TYPE_CODEVIEW) + if (entry.DebugType == SabreTools.Models.PortableExecutable.DebugType.IMAGE_DEBUG_TYPE_CODEVIEW) { // Read the signature int offset = 0; @@ -3142,14 +3142,14 @@ namespace BinaryObjectScanner.Wrappers /// /// Dialog box title to check for /// Enumerable of matching resources - public IEnumerable FindDialogByTitle(string title) + public IEnumerable FindDialogByTitle(string title) { // Ensure that we have the resource data cached if (ResourceData == null) - return Enumerable.Empty(); + return Enumerable.Empty(); return ResourceData.Select(r => r.Value) - .Select(r => r as Models.PortableExecutable.DialogBoxResource) + .Select(r => r as SabreTools.Models.PortableExecutable.DialogBoxResource) .Where(d => d != null) .Where(d => { @@ -3163,14 +3163,14 @@ namespace BinaryObjectScanner.Wrappers /// /// Dialog box item title to check for /// Enumerable of matching resources - public IEnumerable FindDialogBoxByItemTitle(string title) + public IEnumerable FindDialogBoxByItemTitle(string title) { // Ensure that we have the resource data cached if (ResourceData == null) - return Enumerable.Empty(); + return Enumerable.Empty(); return ResourceData.Select(r => r.Value) - .Select(r => r as Models.PortableExecutable.DialogBoxResource) + .Select(r => r as SabreTools.Models.PortableExecutable.DialogBoxResource) .Where(d => d != null) .Where(d => { @@ -3276,7 +3276,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Parse the resource directory table information /// - private void ParseResourceDirectoryTable(Models.PortableExecutable.ResourceDirectoryTable table, List types) + private void ParseResourceDirectoryTable(SabreTools.Models.PortableExecutable.ResourceDirectoryTable table, List types) { int totalEntries = table?.Entries?.Length ?? 0; for (int i = 0; i < totalEntries; i++) @@ -3296,7 +3296,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Parse the name resource directory entry information /// - private void ParseResourceDirectoryEntry(Models.PortableExecutable.ResourceDirectoryEntry entry, List types) + private void ParseResourceDirectoryEntry(SabreTools.Models.PortableExecutable.ResourceDirectoryEntry entry, List types) { if (entry.DataEntry != null) ParseResourceDataEntry(entry.DataEntry, types); @@ -3312,7 +3312,7 @@ namespace BinaryObjectScanner.Wrappers /// of those resources in the entire exectuable. This means that only the last found version or manifest will /// ever be cached. /// - private void ParseResourceDataEntry(Models.PortableExecutable.ResourceDataEntry entry, List types) + private void ParseResourceDataEntry(SabreTools.Models.PortableExecutable.ResourceDataEntry entry, List types) { // Create the key and value objects string key = types == null ? $"UNKNOWN_{Guid.NewGuid()}" : string.Join(", ", types); @@ -3323,70 +3323,70 @@ namespace BinaryObjectScanner.Wrappers { try { - switch ((Models.PortableExecutable.ResourceType)resourceType) + switch ((SabreTools.Models.PortableExecutable.ResourceType)resourceType) { - case Models.PortableExecutable.ResourceType.RT_CURSOR: + case SabreTools.Models.PortableExecutable.ResourceType.RT_CURSOR: value = entry.Data; break; - case Models.PortableExecutable.ResourceType.RT_BITMAP: + case SabreTools.Models.PortableExecutable.ResourceType.RT_BITMAP: value = entry.Data; break; - case Models.PortableExecutable.ResourceType.RT_ICON: + case SabreTools.Models.PortableExecutable.ResourceType.RT_ICON: value = entry.Data; break; - case Models.PortableExecutable.ResourceType.RT_MENU: + case SabreTools.Models.PortableExecutable.ResourceType.RT_MENU: value = entry.AsMenu(); break; - case Models.PortableExecutable.ResourceType.RT_DIALOG: + case SabreTools.Models.PortableExecutable.ResourceType.RT_DIALOG: value = entry.AsDialogBox(); break; - case Models.PortableExecutable.ResourceType.RT_STRING: + case SabreTools.Models.PortableExecutable.ResourceType.RT_STRING: value = entry.AsStringTable(); break; - case Models.PortableExecutable.ResourceType.RT_FONTDIR: + case SabreTools.Models.PortableExecutable.ResourceType.RT_FONTDIR: value = entry.Data; break; - case Models.PortableExecutable.ResourceType.RT_FONT: + case SabreTools.Models.PortableExecutable.ResourceType.RT_FONT: value = entry.Data; break; - case Models.PortableExecutable.ResourceType.RT_ACCELERATOR: + case SabreTools.Models.PortableExecutable.ResourceType.RT_ACCELERATOR: value = entry.AsAcceleratorTableResource(); break; - case Models.PortableExecutable.ResourceType.RT_RCDATA: + case SabreTools.Models.PortableExecutable.ResourceType.RT_RCDATA: value = entry.Data; break; - case Models.PortableExecutable.ResourceType.RT_MESSAGETABLE: + case SabreTools.Models.PortableExecutable.ResourceType.RT_MESSAGETABLE: value = entry.AsMessageResourceData(); break; - case Models.PortableExecutable.ResourceType.RT_GROUP_CURSOR: + case SabreTools.Models.PortableExecutable.ResourceType.RT_GROUP_CURSOR: value = entry.Data; break; - case Models.PortableExecutable.ResourceType.RT_GROUP_ICON: + case SabreTools.Models.PortableExecutable.ResourceType.RT_GROUP_ICON: value = entry.Data; break; - case Models.PortableExecutable.ResourceType.RT_VERSION: + case SabreTools.Models.PortableExecutable.ResourceType.RT_VERSION: _versionInfo = entry.AsVersionInfo(); value = _versionInfo; break; - case Models.PortableExecutable.ResourceType.RT_DLGINCLUDE: + case SabreTools.Models.PortableExecutable.ResourceType.RT_DLGINCLUDE: value = entry.Data; break; - case Models.PortableExecutable.ResourceType.RT_PLUGPLAY: + case SabreTools.Models.PortableExecutable.ResourceType.RT_PLUGPLAY: value = entry.Data; break; - case Models.PortableExecutable.ResourceType.RT_VXD: + case SabreTools.Models.PortableExecutable.ResourceType.RT_VXD: value = entry.Data; break; - case Models.PortableExecutable.ResourceType.RT_ANICURSOR: + case SabreTools.Models.PortableExecutable.ResourceType.RT_ANICURSOR: value = entry.Data; break; - case Models.PortableExecutable.ResourceType.RT_ANIICON: + case SabreTools.Models.PortableExecutable.ResourceType.RT_ANIICON: value = entry.Data; break; - case Models.PortableExecutable.ResourceType.RT_HTML: + case SabreTools.Models.PortableExecutable.ResourceType.RT_HTML: value = entry.Data; break; - case Models.PortableExecutable.ResourceType.RT_MANIFEST: + case SabreTools.Models.PortableExecutable.ResourceType.RT_MANIFEST: _assemblyManifest = entry.AsAssemblyManifest(); value = _versionInfo; break; @@ -3457,7 +3457,7 @@ namespace BinaryObjectScanner.Wrappers /// Name of the section to check for /// True to enable exact matching of names, false for starts-with /// Section data on success, null on error - public Models.PortableExecutable.SectionHeader GetFirstSection(string name, bool exact = false) + public SabreTools.Models.PortableExecutable.SectionHeader GetFirstSection(string name, bool exact = false) { // If we have no sections if (SectionTable == null || !SectionTable.Any()) @@ -3482,7 +3482,7 @@ namespace BinaryObjectScanner.Wrappers /// Name of the section to check for /// True to enable exact matching of names, false for starts-with /// Section data on success, null on error - public Models.PortableExecutable.SectionHeader GetLastSection(string name, bool exact = false) + public SabreTools.Models.PortableExecutable.SectionHeader GetLastSection(string name, bool exact = false) { // If we have no sections if (SectionTable == null || !SectionTable.Any()) @@ -3506,7 +3506,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Index of the section to check for /// Section data on success, null on error - public Models.PortableExecutable.SectionHeader GetSection(int index) + public SabreTools.Models.PortableExecutable.SectionHeader GetSection(int index) { // If we have no sections if (SectionTable == null || !SectionTable.Any()) diff --git a/BinaryObjectScanner.Wrappers/Quantum.cs b/BinaryObjectScanner.Wrappers/Quantum.cs index d81ca5e3..bd1fde7c 100644 --- a/BinaryObjectScanner.Wrappers/Quantum.cs +++ b/BinaryObjectScanner.Wrappers/Quantum.cs @@ -39,7 +39,7 @@ namespace BinaryObjectScanner.Wrappers #region File List /// - public Models.Quantum.FileDescriptor[] FileList => _archive.FileList; + public SabreTools.Models.Quantum.FileDescriptor[] FileList => _archive.FileList; #endregion @@ -53,7 +53,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the archive /// - private Models.Quantum.Archive _archive; + private SabreTools.Models.Quantum.Archive _archive; #endregion diff --git a/BinaryObjectScanner.Wrappers/SGA.cs b/BinaryObjectScanner.Wrappers/SGA.cs index 5c184aed..a9cef8c5 100644 --- a/BinaryObjectScanner.Wrappers/SGA.cs +++ b/BinaryObjectScanner.Wrappers/SGA.cs @@ -36,8 +36,8 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Header as Models.SGA.Header4).FileMD5; - case 5: return (_file.Header as Models.SGA.Header4).FileMD5; + case 4: return (_file.Header as SabreTools.Models.SGA.Header4).FileMD5; + case 5: return (_file.Header as SabreTools.Models.SGA.Header4).FileMD5; default: return null; }; } @@ -50,10 +50,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Header as Models.SGA.Header4).Name; - case 5: return (_file.Header as Models.SGA.Header4).Name; - case 6: return (_file.Header as Models.SGA.Header6).Name; - case 7: return (_file.Header as Models.SGA.Header6).Name; + case 4: return (_file.Header as SabreTools.Models.SGA.Header4).Name; + case 5: return (_file.Header as SabreTools.Models.SGA.Header4).Name; + case 6: return (_file.Header as SabreTools.Models.SGA.Header6).Name; + case 7: return (_file.Header as SabreTools.Models.SGA.Header6).Name; default: return null; }; } @@ -66,8 +66,8 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Header as Models.SGA.Header4).HeaderMD5; - case 5: return (_file.Header as Models.SGA.Header4).HeaderMD5; + case 4: return (_file.Header as SabreTools.Models.SGA.Header4).HeaderMD5; + case 5: return (_file.Header as SabreTools.Models.SGA.Header4).HeaderMD5; default: return null; }; } @@ -80,10 +80,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Header as Models.SGA.Header4).HeaderLength; - case 5: return (_file.Header as Models.SGA.Header4).HeaderLength; - case 6: return (_file.Header as Models.SGA.Header6).HeaderLength; - case 7: return (_file.Header as Models.SGA.Header6).HeaderLength; + case 4: return (_file.Header as SabreTools.Models.SGA.Header4).HeaderLength; + case 5: return (_file.Header as SabreTools.Models.SGA.Header4).HeaderLength; + case 6: return (_file.Header as SabreTools.Models.SGA.Header6).HeaderLength; + case 7: return (_file.Header as SabreTools.Models.SGA.Header6).HeaderLength; default: return null; }; } @@ -96,10 +96,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Header as Models.SGA.Header4).FileDataOffset; - case 5: return (_file.Header as Models.SGA.Header4).FileDataOffset; - case 6: return (_file.Header as Models.SGA.Header6).FileDataOffset; - case 7: return (_file.Header as Models.SGA.Header6).FileDataOffset; + case 4: return (_file.Header as SabreTools.Models.SGA.Header4).FileDataOffset; + case 5: return (_file.Header as SabreTools.Models.SGA.Header4).FileDataOffset; + case 6: return (_file.Header as SabreTools.Models.SGA.Header6).FileDataOffset; + case 7: return (_file.Header as SabreTools.Models.SGA.Header6).FileDataOffset; default: return null; }; } @@ -112,10 +112,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Header as Models.SGA.Header4).Dummy0; - case 5: return (_file.Header as Models.SGA.Header4).Dummy0; - case 6: return (_file.Header as Models.SGA.Header6).Dummy0; - case 7: return (_file.Header as Models.SGA.Header6).Dummy0; + case 4: return (_file.Header as SabreTools.Models.SGA.Header4).Dummy0; + case 5: return (_file.Header as SabreTools.Models.SGA.Header4).Dummy0; + case 6: return (_file.Header as SabreTools.Models.SGA.Header6).Dummy0; + case 7: return (_file.Header as SabreTools.Models.SGA.Header6).Dummy0; default: return null; }; } @@ -134,10 +134,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Directory as Models.SGA.Directory4).DirectoryHeader.SectionOffset; - case 5: return (_file.Directory as Models.SGA.Directory5).DirectoryHeader.SectionOffset; - case 6: return (_file.Directory as Models.SGA.Directory6).DirectoryHeader.SectionOffset; - case 7: return (_file.Directory as Models.SGA.Directory7).DirectoryHeader.SectionOffset; + case 4: return (_file.Directory as SabreTools.Models.SGA.Directory4).DirectoryHeader.SectionOffset; + case 5: return (_file.Directory as SabreTools.Models.SGA.Directory5).DirectoryHeader.SectionOffset; + case 6: return (_file.Directory as SabreTools.Models.SGA.Directory6).DirectoryHeader.SectionOffset; + case 7: return (_file.Directory as SabreTools.Models.SGA.Directory7).DirectoryHeader.SectionOffset; default: return null; }; } @@ -150,10 +150,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Directory as Models.SGA.Directory4).DirectoryHeader.SectionCount; - case 5: return (_file.Directory as Models.SGA.Directory5).DirectoryHeader.SectionCount; - case 6: return (_file.Directory as Models.SGA.Directory6).DirectoryHeader.SectionCount; - case 7: return (_file.Directory as Models.SGA.Directory7).DirectoryHeader.SectionCount; + case 4: return (_file.Directory as SabreTools.Models.SGA.Directory4).DirectoryHeader.SectionCount; + case 5: return (_file.Directory as SabreTools.Models.SGA.Directory5).DirectoryHeader.SectionCount; + case 6: return (_file.Directory as SabreTools.Models.SGA.Directory6).DirectoryHeader.SectionCount; + case 7: return (_file.Directory as SabreTools.Models.SGA.Directory7).DirectoryHeader.SectionCount; default: return null; }; } @@ -166,10 +166,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Directory as Models.SGA.Directory4).DirectoryHeader.FolderOffset; - case 5: return (_file.Directory as Models.SGA.Directory5).DirectoryHeader.FolderOffset; - case 6: return (_file.Directory as Models.SGA.Directory6).DirectoryHeader.FolderOffset; - case 7: return (_file.Directory as Models.SGA.Directory7).DirectoryHeader.FolderOffset; + case 4: return (_file.Directory as SabreTools.Models.SGA.Directory4).DirectoryHeader.FolderOffset; + case 5: return (_file.Directory as SabreTools.Models.SGA.Directory5).DirectoryHeader.FolderOffset; + case 6: return (_file.Directory as SabreTools.Models.SGA.Directory6).DirectoryHeader.FolderOffset; + case 7: return (_file.Directory as SabreTools.Models.SGA.Directory7).DirectoryHeader.FolderOffset; default: return null; }; } @@ -182,10 +182,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Directory as Models.SGA.Directory4).DirectoryHeader.FolderCount; - case 5: return (_file.Directory as Models.SGA.Directory5).DirectoryHeader.FolderCount; - case 6: return (_file.Directory as Models.SGA.Directory6).DirectoryHeader.FolderCount; - case 7: return (_file.Directory as Models.SGA.Directory7).DirectoryHeader.FolderCount; + case 4: return (_file.Directory as SabreTools.Models.SGA.Directory4).DirectoryHeader.FolderCount; + case 5: return (_file.Directory as SabreTools.Models.SGA.Directory5).DirectoryHeader.FolderCount; + case 6: return (_file.Directory as SabreTools.Models.SGA.Directory6).DirectoryHeader.FolderCount; + case 7: return (_file.Directory as SabreTools.Models.SGA.Directory7).DirectoryHeader.FolderCount; default: return null; }; } @@ -198,10 +198,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Directory as Models.SGA.Directory4).DirectoryHeader.FileOffset; - case 5: return (_file.Directory as Models.SGA.Directory5).DirectoryHeader.FileOffset; - case 6: return (_file.Directory as Models.SGA.Directory6).DirectoryHeader.FileOffset; - case 7: return (_file.Directory as Models.SGA.Directory7).DirectoryHeader.FileOffset; + case 4: return (_file.Directory as SabreTools.Models.SGA.Directory4).DirectoryHeader.FileOffset; + case 5: return (_file.Directory as SabreTools.Models.SGA.Directory5).DirectoryHeader.FileOffset; + case 6: return (_file.Directory as SabreTools.Models.SGA.Directory6).DirectoryHeader.FileOffset; + case 7: return (_file.Directory as SabreTools.Models.SGA.Directory7).DirectoryHeader.FileOffset; default: return null; }; } @@ -214,10 +214,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Directory as Models.SGA.Directory4).DirectoryHeader.FileCount; - case 5: return (_file.Directory as Models.SGA.Directory5).DirectoryHeader.FileCount; - case 6: return (_file.Directory as Models.SGA.Directory6).DirectoryHeader.FileCount; - case 7: return (_file.Directory as Models.SGA.Directory7).DirectoryHeader.FileCount; + case 4: return (_file.Directory as SabreTools.Models.SGA.Directory4).DirectoryHeader.FileCount; + case 5: return (_file.Directory as SabreTools.Models.SGA.Directory5).DirectoryHeader.FileCount; + case 6: return (_file.Directory as SabreTools.Models.SGA.Directory6).DirectoryHeader.FileCount; + case 7: return (_file.Directory as SabreTools.Models.SGA.Directory7).DirectoryHeader.FileCount; default: return null; }; } @@ -230,10 +230,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Directory as Models.SGA.Directory4).DirectoryHeader.StringTableOffset; - case 5: return (_file.Directory as Models.SGA.Directory5).DirectoryHeader.StringTableOffset; - case 6: return (_file.Directory as Models.SGA.Directory6).DirectoryHeader.StringTableOffset; - case 7: return (_file.Directory as Models.SGA.Directory7).DirectoryHeader.StringTableOffset; + case 4: return (_file.Directory as SabreTools.Models.SGA.Directory4).DirectoryHeader.StringTableOffset; + case 5: return (_file.Directory as SabreTools.Models.SGA.Directory5).DirectoryHeader.StringTableOffset; + case 6: return (_file.Directory as SabreTools.Models.SGA.Directory6).DirectoryHeader.StringTableOffset; + case 7: return (_file.Directory as SabreTools.Models.SGA.Directory7).DirectoryHeader.StringTableOffset; default: return null; }; } @@ -246,10 +246,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Directory as Models.SGA.Directory4).DirectoryHeader.StringTableCount; - case 5: return (_file.Directory as Models.SGA.Directory5).DirectoryHeader.StringTableCount; - case 6: return (_file.Directory as Models.SGA.Directory6).DirectoryHeader.StringTableCount; - case 7: return (_file.Directory as Models.SGA.Directory7).DirectoryHeader.StringTableCount; + case 4: return (_file.Directory as SabreTools.Models.SGA.Directory4).DirectoryHeader.StringTableCount; + case 5: return (_file.Directory as SabreTools.Models.SGA.Directory5).DirectoryHeader.StringTableCount; + case 6: return (_file.Directory as SabreTools.Models.SGA.Directory6).DirectoryHeader.StringTableCount; + case 7: return (_file.Directory as SabreTools.Models.SGA.Directory7).DirectoryHeader.StringTableCount; default: return null; }; } @@ -262,7 +262,7 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 7: return (_file.Directory as Models.SGA.Directory7).DirectoryHeader.HashTableOffset; + case 7: return (_file.Directory as SabreTools.Models.SGA.Directory7).DirectoryHeader.HashTableOffset; default: return null; }; } @@ -275,7 +275,7 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 7: return (_file.Directory as Models.SGA.Directory7).DirectoryHeader.BlockSize; + case 7: return (_file.Directory as SabreTools.Models.SGA.Directory7).DirectoryHeader.BlockSize; default: return null; }; } @@ -292,10 +292,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Directory as Models.SGA.Directory4).Sections; - case 5: return (_file.Directory as Models.SGA.Directory5).Sections; - case 6: return (_file.Directory as Models.SGA.Directory6).Sections; - case 7: return (_file.Directory as Models.SGA.Directory7).Sections; + case 4: return (_file.Directory as SabreTools.Models.SGA.Directory4).Sections; + case 5: return (_file.Directory as SabreTools.Models.SGA.Directory5).Sections; + case 6: return (_file.Directory as SabreTools.Models.SGA.Directory6).Sections; + case 7: return (_file.Directory as SabreTools.Models.SGA.Directory7).Sections; default: return null; }; } @@ -312,10 +312,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Directory as Models.SGA.Directory4).Folders; - case 5: return (_file.Directory as Models.SGA.Directory5).Folders; - case 6: return (_file.Directory as Models.SGA.Directory6).Folders; - case 7: return (_file.Directory as Models.SGA.Directory7).Folders; + case 4: return (_file.Directory as SabreTools.Models.SGA.Directory4).Folders; + case 5: return (_file.Directory as SabreTools.Models.SGA.Directory5).Folders; + case 6: return (_file.Directory as SabreTools.Models.SGA.Directory6).Folders; + case 7: return (_file.Directory as SabreTools.Models.SGA.Directory7).Folders; default: return null; }; } @@ -332,10 +332,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: return (_file.Directory as Models.SGA.Directory4).Files; - case 5: return (_file.Directory as Models.SGA.Directory5).Files; - case 6: return (_file.Directory as Models.SGA.Directory6).Files; - case 7: return (_file.Directory as Models.SGA.Directory7).Files; + case 4: return (_file.Directory as SabreTools.Models.SGA.Directory4).Files; + case 5: return (_file.Directory as SabreTools.Models.SGA.Directory5).Files; + case 6: return (_file.Directory as SabreTools.Models.SGA.Directory6).Files; + case 7: return (_file.Directory as SabreTools.Models.SGA.Directory7).Files; default: return null; }; } @@ -361,7 +361,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the SGA /// - private Models.SGA.File _file; + private SabreTools.Models.SGA.File _file; #endregion @@ -504,7 +504,7 @@ namespace BinaryObjectScanner.Wrappers switch (MajorVersion) { case 4: - var section4 = Sections[i] as Models.SGA.Section4; + var section4 = Sections[i] as SabreTools.Models.SGA.Section4; builder.AppendLine($" Alias: {section4.Alias ?? "[NULL]"}"); builder.AppendLine($" Name: {section4.Name ?? "[NULL]"}"); builder.AppendLine($" Folder start index: {section4.FolderStartIndex} (0x{section4.FolderStartIndex:X})"); @@ -517,7 +517,7 @@ namespace BinaryObjectScanner.Wrappers case 5: case 6: case 7: - var section5 = Sections[i] as Models.SGA.Section5; + var section5 = Sections[i] as SabreTools.Models.SGA.Section5; builder.AppendLine($" Alias: {section5.Alias ?? "[NULL]"}"); builder.AppendLine($" Name: {section5.Name ?? "[NULL]"}"); builder.AppendLine($" Folder start index: {section5.FolderStartIndex} (0x{section5.FolderStartIndex:X})"); @@ -555,7 +555,7 @@ namespace BinaryObjectScanner.Wrappers switch (MajorVersion) { case 4: - var folder4 = Folders[i] as Models.SGA.Folder4; + var folder4 = Folders[i] as SabreTools.Models.SGA.Folder4; builder.AppendLine($" Name offset: {folder4.NameOffset} (0x{folder4.NameOffset:X})"); builder.AppendLine($" Name: {folder4.Name ?? "[NULL]"}"); builder.AppendLine($" Folder start index: {folder4.FolderStartIndex} (0x{folder4.FolderStartIndex:X})"); @@ -567,7 +567,7 @@ namespace BinaryObjectScanner.Wrappers case 5: case 6: case 7: - var folder5 = Folders[i] as Models.SGA.Folder5; + var folder5 = Folders[i] as SabreTools.Models.SGA.Folder5; builder.AppendLine($" Name offset: {folder5.NameOffset} (0x{folder5.NameOffset:X})"); builder.AppendLine($" Name: {folder5.Name ?? "[NULL]"}"); builder.AppendLine($" Folder start index: {folder5.FolderStartIndex} (0x{folder5.FolderStartIndex:X})"); @@ -605,7 +605,7 @@ namespace BinaryObjectScanner.Wrappers { case 4: case 5: - var file4 = Files[i] as Models.SGA.File4; + var file4 = Files[i] as SabreTools.Models.SGA.File4; builder.AppendLine($" Name offset: {file4.NameOffset} (0x{file4.NameOffset:X})"); builder.AppendLine($" Name: {file4.Name ?? "[NULL]"}"); builder.AppendLine($" Offset: {file4.Offset} (0x{file4.Offset:X})"); @@ -617,7 +617,7 @@ namespace BinaryObjectScanner.Wrappers break; case 6: - var file6 = Files[i] as Models.SGA.File6; + var file6 = Files[i] as SabreTools.Models.SGA.File6; builder.AppendLine($" Name offset: {file6.NameOffset} (0x{file6.NameOffset:X})"); builder.AppendLine($" Name: {file6.Name ?? "[NULL]"}"); builder.AppendLine($" Offset: {file6.Offset} (0x{file6.Offset:X})"); @@ -629,7 +629,7 @@ namespace BinaryObjectScanner.Wrappers builder.AppendLine($" CRC32: {file6.CRC32} (0x{file6.CRC32:X})"); break; case 7: - var file7 = Files[i] as Models.SGA.File7; + var file7 = Files[i] as SabreTools.Models.SGA.File7; builder.AppendLine($" Name offset: {file7.NameOffset} (0x{file7.NameOffset:X})"); builder.AppendLine($" Name: {file7.Name ?? "[NULL]"}"); builder.AppendLine($" Offset: {file7.Offset} (0x{file7.Offset:X})"); @@ -708,9 +708,9 @@ namespace BinaryObjectScanner.Wrappers switch (MajorVersion) { case 4: - case 5: filename = (file as Models.SGA.File4).Name; break; - case 6: filename = (file as Models.SGA.File6).Name; break; - case 7: filename = (file as Models.SGA.File7).Name; break; + case 5: filename = (file as SabreTools.Models.SGA.File4).Name; break; + case 6: filename = (file as SabreTools.Models.SGA.File6).Name; break; + case 7: filename = (file as SabreTools.Models.SGA.File7).Name; break; default: return false; } @@ -721,10 +721,10 @@ namespace BinaryObjectScanner.Wrappers object folder; switch (MajorVersion) { - case 4: folder = (Folders as Models.SGA.Folder4[]).FirstOrDefault(f => index >= f.FileStartIndex && index <= f.FileEndIndex); break; + case 4: folder = (Folders as SabreTools.Models.SGA.Folder4[]).FirstOrDefault(f => index >= f.FileStartIndex && index <= f.FileEndIndex); break; case 5: case 6: - case 7: folder = (Folders as Models.SGA.Folder5[]).FirstOrDefault(f => index >= f.FileStartIndex && index <= f.FileEndIndex); break; + case 7: folder = (Folders as SabreTools.Models.SGA.Folder5[]).FirstOrDefault(f => index >= f.FileStartIndex && index <= f.FileEndIndex); break; default: return false; } @@ -733,10 +733,10 @@ namespace BinaryObjectScanner.Wrappers { switch (MajorVersion) { - case 4: parentNames.Add((folder as Models.SGA.Folder4).Name); break; + case 4: parentNames.Add((folder as SabreTools.Models.SGA.Folder4).Name); break; case 5: case 6: - case 7: parentNames.Add((folder as Models.SGA.Folder5).Name); break; + case 7: parentNames.Add((folder as SabreTools.Models.SGA.Folder5).Name); break; default: return false; } } @@ -752,9 +752,9 @@ namespace BinaryObjectScanner.Wrappers switch (MajorVersion) { case 4: - case 5: fileOffset = (file as Models.SGA.File4).Offset; break; - case 6: fileOffset = (file as Models.SGA.File6).Offset; break; - case 7: fileOffset = (file as Models.SGA.File7).Offset; break; + case 5: fileOffset = (file as SabreTools.Models.SGA.File4).Offset; break; + case 6: fileOffset = (file as SabreTools.Models.SGA.File6).Offset; break; + case 7: fileOffset = (file as SabreTools.Models.SGA.File7).Offset; break; default: return false; } @@ -767,16 +767,16 @@ namespace BinaryObjectScanner.Wrappers { case 4: case 5: - fileSize = (file as Models.SGA.File4).SizeOnDisk; - outputFileSize = (file as Models.SGA.File4).Size; + fileSize = (file as SabreTools.Models.SGA.File4).SizeOnDisk; + outputFileSize = (file as SabreTools.Models.SGA.File4).Size; break; case 6: - fileSize = (file as Models.SGA.File6).SizeOnDisk; - outputFileSize = (file as Models.SGA.File6).Size; + fileSize = (file as SabreTools.Models.SGA.File6).SizeOnDisk; + outputFileSize = (file as SabreTools.Models.SGA.File6).Size; break; case 7: - fileSize = (file as Models.SGA.File7).SizeOnDisk; - outputFileSize = (file as Models.SGA.File7).Size; + fileSize = (file as SabreTools.Models.SGA.File7).SizeOnDisk; + outputFileSize = (file as SabreTools.Models.SGA.File7).Size; break; default: return false; } diff --git a/BinaryObjectScanner.Wrappers/VBSP.cs b/BinaryObjectScanner.Wrappers/VBSP.cs index d0fb5e95..6bd03860 100644 --- a/BinaryObjectScanner.Wrappers/VBSP.cs +++ b/BinaryObjectScanner.Wrappers/VBSP.cs @@ -1,6 +1,6 @@ using System.IO; using System.Text; -using static BinaryObjectScanner.Models.VBSP.Constants; +using static SabreTools.Models.VBSP.Constants; namespace BinaryObjectScanner.Wrappers { @@ -22,7 +22,7 @@ namespace BinaryObjectScanner.Wrappers public int Version => _file.Header.Version; /// - public Models.VBSP.Lump[] Lumps => _file.Header.Lumps; + public SabreTools.Models.VBSP.Lump[] Lumps => _file.Header.Lumps; /// public int MapRevision => _file.Header.MapRevision; @@ -40,7 +40,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the VBSP /// - private Models.VBSP.File _file; + private SabreTools.Models.VBSP.File _file; #endregion diff --git a/BinaryObjectScanner.Wrappers/VPK.cs b/BinaryObjectScanner.Wrappers/VPK.cs index 9f0f0c1f..43f37d6c 100644 --- a/BinaryObjectScanner.Wrappers/VPK.cs +++ b/BinaryObjectScanner.Wrappers/VPK.cs @@ -3,7 +3,7 @@ using System.IO; using System.Linq; using System.Text; using BinaryObjectScanner.Utilities; -using static BinaryObjectScanner.Models.VPK.Constants; +using static SabreTools.Models.VPK.Constants; namespace BinaryObjectScanner.Wrappers { @@ -50,14 +50,14 @@ namespace BinaryObjectScanner.Wrappers #region Archive Hashes /// - public Models.VPK.ArchiveHash[] ArchiveHashes => _file.ArchiveHashes; + public SabreTools.Models.VPK.ArchiveHash[] ArchiveHashes => _file.ArchiveHashes; #endregion #region Directory Items /// - public Models.VPK.DirectoryItem[] DirectoryItems => _file.DirectoryItems; + public SabreTools.Models.VPK.DirectoryItem[] DirectoryItems => _file.DirectoryItems; #endregion @@ -118,7 +118,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the VPK /// - private Models.VPK.File _file; + private SabreTools.Models.VPK.File _file; /// /// Array of archive filenames attached to the given VPK @@ -295,7 +295,7 @@ namespace BinaryObjectScanner.Wrappers /// Print directory entry information /// /// StringBuilder to append information to - private void PrintDirectoryEntry(Models.VPK.DirectoryEntry directoryEntry, StringBuilder builder) + private void PrintDirectoryEntry(SabreTools.Models.VPK.DirectoryEntry directoryEntry, StringBuilder builder) { if (directoryEntry == null) { diff --git a/BinaryObjectScanner.Wrappers/WAD.cs b/BinaryObjectScanner.Wrappers/WAD.cs index de537828..23473f69 100644 --- a/BinaryObjectScanner.Wrappers/WAD.cs +++ b/BinaryObjectScanner.Wrappers/WAD.cs @@ -30,14 +30,14 @@ namespace BinaryObjectScanner.Wrappers #region Lumps /// - public Models.WAD.Lump[] Lumps => _file.Lumps; + public SabreTools.Models.WAD.Lump[] Lumps => _file.Lumps; #endregion #region Lump Infos /// - public Models.WAD.LumpInfo[] LumpInfos => _file.LumpInfos; + public SabreTools.Models.WAD.LumpInfo[] LumpInfos => _file.LumpInfos; #endregion @@ -54,7 +54,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the WAD /// - private Models.WAD.File _file; + private SabreTools.Models.WAD.File _file; #endregion diff --git a/BinaryObjectScanner.Wrappers/WrapperFactory.cs b/BinaryObjectScanner.Wrappers/WrapperFactory.cs index 90520dff..34639a40 100644 --- a/BinaryObjectScanner.Wrappers/WrapperFactory.cs +++ b/BinaryObjectScanner.Wrappers/WrapperFactory.cs @@ -75,22 +75,22 @@ namespace BinaryObjectScanner.Wrappers byte[] magic = stream.ReadBytes(4); // New Executable - if (magic.StartsWith(BinaryObjectScanner.Models.NewExecutable.Constants.SignatureBytes)) + if (magic.StartsWith(SabreTools.Models.NewExecutable.Constants.SignatureBytes)) { stream.Seek(0, SeekOrigin.Begin); return NewExecutable.Create(stream); } // Linear Executable - else if (magic.StartsWith(BinaryObjectScanner.Models.LinearExecutable.Constants.LESignatureBytes) - || magic.StartsWith(BinaryObjectScanner.Models.LinearExecutable.Constants.LXSignatureBytes)) + else if (magic.StartsWith(SabreTools.Models.LinearExecutable.Constants.LESignatureBytes) + || magic.StartsWith(SabreTools.Models.LinearExecutable.Constants.LXSignatureBytes)) { stream.Seek(0, SeekOrigin.Begin); return LinearExecutable.Create(stream); } // Portable Executable - else if (magic.StartsWith(BinaryObjectScanner.Models.PortableExecutable.Constants.SignatureBytes)) + else if (magic.StartsWith(SabreTools.Models.PortableExecutable.Constants.SignatureBytes)) { stream.Seek(0, SeekOrigin.Begin); return PortableExecutable.Create(stream); diff --git a/BinaryObjectScanner.Wrappers/XZP.cs b/BinaryObjectScanner.Wrappers/XZP.cs index 0d68970b..a0c62995 100644 --- a/BinaryObjectScanner.Wrappers/XZP.cs +++ b/BinaryObjectScanner.Wrappers/XZP.cs @@ -49,28 +49,28 @@ namespace BinaryObjectScanner.Wrappers #region Directory Entries /// - public Models.XZP.DirectoryEntry[] DirectoryEntries => _file.DirectoryEntries; + public SabreTools.Models.XZP.DirectoryEntry[] DirectoryEntries => _file.DirectoryEntries; #endregion #region Preload Directory Entries /// - public Models.XZP.DirectoryEntry[] PreloadDirectoryEntries => _file.PreloadDirectoryEntries; + public SabreTools.Models.XZP.DirectoryEntry[] PreloadDirectoryEntries => _file.PreloadDirectoryEntries; #endregion #region Preload Directory Entries /// - public Models.XZP.DirectoryMapping[] PreloadDirectoryMappings => _file.PreloadDirectoryMappings; + public SabreTools.Models.XZP.DirectoryMapping[] PreloadDirectoryMappings => _file.PreloadDirectoryMappings; #endregion #region Directory Items /// - public Models.XZP.DirectoryItem[] DirectoryItems => _file.DirectoryItems; + public SabreTools.Models.XZP.DirectoryItem[] DirectoryItems => _file.DirectoryItems; #endregion @@ -97,7 +97,7 @@ namespace BinaryObjectScanner.Wrappers /// /// Internal representation of the XZP /// - private Models.XZP.File _file; + private SabreTools.Models.XZP.File _file; #endregion diff --git a/BurnOutSharp.sln b/BurnOutSharp.sln index 01fe8980..246fc2b5 100644 --- a/BurnOutSharp.sln +++ b/BurnOutSharp.sln @@ -16,8 +16,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution README.md = README.md EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BinaryObjectScanner.Models", "BinaryObjectScanner.Models\BinaryObjectScanner.Models.csproj", "{44939210-BDC2-4250-BC0F-0AB8F316F09D}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BinaryObjectScanner.Builders", "BinaryObjectScanner.Builders\BinaryObjectScanner.Builders.csproj", "{7577733A-CC8D-4E7C-8B6D-FFC7EC1B3D07}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BinaryObjectScanner.Wrappers", "BinaryObjectScanner.Wrappers\BinaryObjectScanner.Wrappers.csproj", "{35BD489F-E58D-45DD-9929-DC4B32414750}" @@ -56,10 +54,6 @@ Global {88735BA2-778D-4192-8EB2-FFF6843719E2}.Debug|Any CPU.Build.0 = Debug|Any CPU {88735BA2-778D-4192-8EB2-FFF6843719E2}.Release|Any CPU.ActiveCfg = Release|Any CPU {88735BA2-778D-4192-8EB2-FFF6843719E2}.Release|Any CPU.Build.0 = Release|Any CPU - {44939210-BDC2-4250-BC0F-0AB8F316F09D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {44939210-BDC2-4250-BC0F-0AB8F316F09D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {44939210-BDC2-4250-BC0F-0AB8F316F09D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {44939210-BDC2-4250-BC0F-0AB8F316F09D}.Release|Any CPU.Build.0 = Release|Any CPU {7577733A-CC8D-4E7C-8B6D-FFC7EC1B3D07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7577733A-CC8D-4E7C-8B6D-FFC7EC1B3D07}.Debug|Any CPU.Build.0 = Debug|Any CPU {7577733A-CC8D-4E7C-8B6D-FFC7EC1B3D07}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/BurnOutSharp/BurnOutSharp.csproj b/BurnOutSharp/BurnOutSharp.csproj index ba6d4f8c..7b0acc64 100644 --- a/BurnOutSharp/BurnOutSharp.csproj +++ b/BurnOutSharp/BurnOutSharp.csproj @@ -23,6 +23,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + runtime; build; native; contentfiles; analyzers; buildtransitive @@ -63,10 +67,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Test/Test.csproj b/Test/Test.csproj index d5dd38a0..e6742626 100644 --- a/Test/Test.csproj +++ b/Test/Test.csproj @@ -12,13 +12,13 @@ - +