From b7fb17a79f51a0d86734925f107d7811a4f13263 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 5 Nov 2022 23:36:15 -0700 Subject: [PATCH] Add skeletons for other executable types --- BurnOutSharp.Builder/LinearExecutable.cs | 40 ++++++++++++++++++++++ BurnOutSharp.Builder/MSDOS.cs | 6 ++-- BurnOutSharp.Builder/NewExecutable.cs | 40 ++++++++++++++++++++++ BurnOutSharp.Builder/PortableExecutable.cs | 40 ++++++++++++++++++++++ 4 files changed, 123 insertions(+), 3 deletions(-) create mode 100644 BurnOutSharp.Builder/LinearExecutable.cs create mode 100644 BurnOutSharp.Builder/NewExecutable.cs create mode 100644 BurnOutSharp.Builder/PortableExecutable.cs diff --git a/BurnOutSharp.Builder/LinearExecutable.cs b/BurnOutSharp.Builder/LinearExecutable.cs new file mode 100644 index 00000000..43cd6242 --- /dev/null +++ b/BurnOutSharp.Builder/LinearExecutable.cs @@ -0,0 +1,40 @@ +using System.IO; +using BurnOutSharp.Models.LinearExecutable; + +namespace BurnOutSharp.Builder +{ + // TODO: Make Stream Data rely on Byte Data + public static class LinearExecutable + { + #region Byte Data + + /// + /// Parse a byte array into a Linear Executable + /// + /// Byte array to parse + /// Offset into the byte array + /// Filled executable on success, null on error + public static Executable ParseExecutable(byte[] data, int offset) + { + // TODO: Implement LE/LX parsing + return null; + } + + #endregion + + #region Stream Data + + /// + /// Parse a Stream into a Linear Executable + /// + /// Stream to parse + /// Filled executable on success, null on error + public static Executable ParseExecutable(Stream data) + { + // TODO: Implement LE/LX parsing + return null; + } + + #endregion + } +} \ No newline at end of file diff --git a/BurnOutSharp.Builder/MSDOS.cs b/BurnOutSharp.Builder/MSDOS.cs index 969cdd45..fd7d4be1 100644 --- a/BurnOutSharp.Builder/MSDOS.cs +++ b/BurnOutSharp.Builder/MSDOS.cs @@ -160,7 +160,7 @@ namespace BurnOutSharp.Builder #region Stream Data /// - /// Parse a byte array into an MS-DOS executable + /// Parse a Stream into an MS-DOS executable /// /// Stream to parse /// Filled executable on success, null on error @@ -207,7 +207,7 @@ namespace BurnOutSharp.Builder } /// - /// Parse a byte array into an MS-DOS executable header + /// Parse a Stream into an MS-DOS executable header /// /// Stream to parse /// Filled executable header on success, null on error @@ -276,7 +276,7 @@ namespace BurnOutSharp.Builder } /// - /// Parse a byte array into a relocation table + /// Parse a Stream into a relocation table /// /// Stream to parse /// Filled executable header on success, null on error diff --git a/BurnOutSharp.Builder/NewExecutable.cs b/BurnOutSharp.Builder/NewExecutable.cs new file mode 100644 index 00000000..333fcdd8 --- /dev/null +++ b/BurnOutSharp.Builder/NewExecutable.cs @@ -0,0 +1,40 @@ +using System.IO; +using BurnOutSharp.Models.NewExecutable; + +namespace BurnOutSharp.Builder +{ + // TODO: Make Stream Data rely on Byte Data + public static class NewExecutable + { + #region Byte Data + + /// + /// Parse a byte array into a New Executable + /// + /// Byte array to parse + /// Offset into the byte array + /// Filled executable on success, null on error + public static Executable ParseExecutable(byte[] data, int offset) + { + // TODO: Implement NE parsing + return null; + } + + #endregion + + #region Stream Data + + /// + /// Parse a Stream into a New Executable + /// + /// Stream to parse + /// Filled executable on success, null on error + public static Executable ParseExecutable(Stream data) + { + // TODO: Implement NE parsing + return null; + } + + #endregion + } +} \ No newline at end of file diff --git a/BurnOutSharp.Builder/PortableExecutable.cs b/BurnOutSharp.Builder/PortableExecutable.cs new file mode 100644 index 00000000..e05663fc --- /dev/null +++ b/BurnOutSharp.Builder/PortableExecutable.cs @@ -0,0 +1,40 @@ +using System.IO; +using BurnOutSharp.Models.PortableExecutable; + +namespace BurnOutSharp.Builder +{ + // TODO: Make Stream Data rely on Byte Data + public static class PortableExecutable + { + #region Byte Data + + /// + /// Parse a byte array into a Portable Executable + /// + /// Byte array to parse + /// Offset into the byte array + /// Filled executable on success, null on error + public static Executable ParseExecutable(byte[] data, int offset) + { + // TODO: Implement PE parsing + return null; + } + + #endregion + + #region Stream Data + + /// + /// Parse a Stream into a Portable Executable + /// + /// Stream to parse + /// Filled executable on success, null on error + public static Executable ParseExecutable(Stream data) + { + // TODO: Implement PE parsing + return null; + } + + #endregion + } +} \ No newline at end of file