From 56408ed9f4ceb542ebac1e77166c51a578ec02ce Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 10 Sep 2021 21:45:34 -0700 Subject: [PATCH] Add note and future code in Executable --- BurnOutSharp/FileType/Executable.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/BurnOutSharp/FileType/Executable.cs b/BurnOutSharp/FileType/Executable.cs index 0a3dd26b..06598f46 100644 --- a/BurnOutSharp/FileType/Executable.cs +++ b/BurnOutSharp/FileType/Executable.cs @@ -85,10 +85,6 @@ namespace BurnOutSharp.FileType return protections; } - // If we can, seek to the beginning of the stream - if (stream.CanSeek) - stream.Seek(0, SeekOrigin.Begin); - // TODO: Start moving toward reading from the stream directly. In theory, // deserialization can be done at this point, and if all of the sections are populated // properly, nearly all of the content checks can be dealt with without having @@ -96,9 +92,16 @@ namespace BurnOutSharp.FileType // byte array // Create PortableExecutable and NewExecutable objects for use in the checks + stream.Seek(0, SeekOrigin.Begin); PortableExecutable pex = PortableExecutable.Deserialize(fileContent, 0); NewExecutable nex = NewExecutable.Deserialize(fileContent, 0); + // Create PortableExecutable and NewExecutable objects for use in the checks + // PortableExecutable pex = PortableExecutable.Deserialize(stream); + // stream.Seek(0, SeekOrigin.Begin); + // NewExecutable nex = NewExecutable.Deserialize(stream); + // stream.Seek(0, SeekOrigin.Begin); + // Iterate through all content checks Parallel.ForEach(contentCheckClasses, contentCheckClass => {