diff --git a/BurnOutSharp.Builder/LinearExecutable.cs b/BurnOutSharp.Builder/LinearExecutable.cs index caa74684..a09780c4 100644 --- a/BurnOutSharp.Builder/LinearExecutable.cs +++ b/BurnOutSharp.Builder/LinearExecutable.cs @@ -30,6 +30,14 @@ namespace BurnOutSharp.Builder // Create a new executable to fill var executable = new Executable(); + // Parse the MS-DOS stub + var stub = MSDOS.ParseExecutable(data, offset); + if (stub?.Header == null || stub.Header.NewExeHeaderAddr == 0) + return null; + + // Set the MS-DOS stub + executable.Stub = stub; + // TODO: Implement LE/LX parsing return null; } diff --git a/BurnOutSharp.Builder/NewExecutable.cs b/BurnOutSharp.Builder/NewExecutable.cs index 9b03c52c..59be7cac 100644 --- a/BurnOutSharp.Builder/NewExecutable.cs +++ b/BurnOutSharp.Builder/NewExecutable.cs @@ -30,6 +30,14 @@ namespace BurnOutSharp.Builder // Create a new executable to fill var executable = new Executable(); + // Parse the MS-DOS stub + var stub = MSDOS.ParseExecutable(data, offset); + if (stub?.Header == null || stub.Header.NewExeHeaderAddr == 0) + return null; + + // Set the MS-DOS stub + executable.Stub = stub; + // TODO: Implement NE parsing return null; } diff --git a/BurnOutSharp.Builder/PortableExecutable.cs b/BurnOutSharp.Builder/PortableExecutable.cs index ecce394b..da55fc72 100644 --- a/BurnOutSharp.Builder/PortableExecutable.cs +++ b/BurnOutSharp.Builder/PortableExecutable.cs @@ -30,6 +30,14 @@ namespace BurnOutSharp.Builder // Create a new executable to fill var executable = new Executable(); + // Parse the MS-DOS stub + var stub = MSDOS.ParseExecutable(data, offset); + if (stub?.Header == null || stub.Header.NewExeHeaderAddr == 0) + return null; + + // Set the MS-DOS stub + executable.Stub = stub; + // TODO: Implement PE parsing return null; }