diff --git a/BurnOutSharp.Builder/LinearExecutable.cs b/BurnOutSharp.Builder/LinearExecutable.cs index 3cc0ede3..d3080ea1 100644 --- a/BurnOutSharp.Builder/LinearExecutable.cs +++ b/BurnOutSharp.Builder/LinearExecutable.cs @@ -79,6 +79,13 @@ namespace BurnOutSharp.Builder // Create a new executable to fill var executable = new Executable(); + // Parse the MS-DOS stub + var stub = MSDOS.ParseExecutable(data); + if (stub?.Header == null || stub.Header.NewExeHeaderAddr == 0) + return null; + + // Set the MS-DOS stub + // TODO: Implement LE/LX parsing return null; } diff --git a/BurnOutSharp.Builder/NewExecutable.cs b/BurnOutSharp.Builder/NewExecutable.cs index 456c1ca8..0a0342a1 100644 --- a/BurnOutSharp.Builder/NewExecutable.cs +++ b/BurnOutSharp.Builder/NewExecutable.cs @@ -79,6 +79,14 @@ namespace BurnOutSharp.Builder // Create a new executable to fill var executable = new Executable(); + // Parse the MS-DOS stub + var stub = MSDOS.ParseExecutable(data); + 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 e7996d6e..f3a36246 100644 --- a/BurnOutSharp.Builder/PortableExecutable.cs +++ b/BurnOutSharp.Builder/PortableExecutable.cs @@ -79,6 +79,13 @@ namespace BurnOutSharp.Builder // Create a new executable to fill var executable = new Executable(); + // Parse the MS-DOS stub + var stub = MSDOS.ParseExecutable(data); + if (stub?.Header == null || stub.Header.NewExeHeaderAddr == 0) + return null; + + // Set the MS-DOS stub + // TODO: Implement PE parsing return null; }