diff --git a/BurnOutSharp.Builder/MSDOS.cs b/BurnOutSharp.Builder/MSDOS.cs index 458928d2..66f8a8f9 100644 --- a/BurnOutSharp.Builder/MSDOS.cs +++ b/BurnOutSharp.Builder/MSDOS.cs @@ -63,14 +63,6 @@ namespace BurnOutSharp.Builder /// Filled executable header on success, null on error private static ExecutableHeader ParseExecutableHeader(byte[] data, int offset) { - // If we don't have enough data - if (data.Length < 28) - return null; - - // If the offset means we don't have enough data - if (data.Length - offset < 28) - return null; - // TODO: Use marshalling here instead of building var header = new ExecutableHeader(); @@ -134,14 +126,6 @@ namespace BurnOutSharp.Builder /// Filled relocation table on success, null on error private static RelocationEntry[] ParseRelocationTable(byte[] data, int offset, int count) { - // If we don't have enough data - if (data.Length < (count * 4)) - return null; - - // If the offset means we don't have enough data - if (data.Length - offset < (count * 4)) - return null; - // TODO: Use marshalling here instead of building var relocationTable = new RelocationEntry[count]; @@ -214,14 +198,6 @@ namespace BurnOutSharp.Builder /// Filled executable header on success, null on error private static ExecutableHeader ParseExecutableHeader(Stream data) { - // If we don't have enough data - if (data.Length < 28) - return null; - - // If the offset means we don't have enough data - if (data.Length - data.Position < 28) - return null; - // TODO: Use marshalling here instead of building var header = new ExecutableHeader(); @@ -284,14 +260,6 @@ namespace BurnOutSharp.Builder /// Filled relocation table on success, null on error private static RelocationEntry[] ParseRelocationTable(Stream data, int count) { - // If we don't have enough data - if (data.Length < (count * 4)) - return null; - - // If the offset means we don't have enough data - if (data.Length - data.Position < (count * 4)) - return null; - // TODO: Use marshalling here instead of building var relocationTable = new RelocationEntry[count]; diff --git a/BurnOutSharp.Builder/NewExecutable.cs b/BurnOutSharp.Builder/NewExecutable.cs index 0762cdc0..a1f8e8b8 100644 --- a/BurnOutSharp.Builder/NewExecutable.cs +++ b/BurnOutSharp.Builder/NewExecutable.cs @@ -58,14 +58,6 @@ namespace BurnOutSharp.Builder /// Filled executable header on success, null on error private static ExecutableHeader ParseExecutableHeader(byte[] data, int offset) { - // If we don't have enough data - if (data.Length < 0x40) - return null; - - // If the offset means we don't have enough data - if (data.Length - offset < 0x40) - return null; - // TODO: Use marshalling here instead of building var header = new ExecutableHeader(); @@ -176,14 +168,6 @@ namespace BurnOutSharp.Builder /// Filled executable header on success, null on error private static ExecutableHeader ParseExecutableHeader(Stream data) { - // If we don't have enough data - if (data.Length < 0x40) - return null; - - // If the offset means we don't have enough data - if (data.Length - data.Position < 0x40) - return null; - // TODO: Use marshalling here instead of building var header = new ExecutableHeader();