From dc252e8d86575332d92ff9dd2f89361a04b7aba5 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 14 Mar 2022 23:32:19 -0700 Subject: [PATCH] Add comments around remaining SourceArray usages --- BurnOutSharp/ExecutableType/Microsoft/PE/PortableExecutable.cs | 1 - BurnOutSharp/PackerType/InnoSetup.cs | 1 + BurnOutSharp/PackerType/UPX.cs | 2 ++ BurnOutSharp/ProtectionType/SecuROM.cs | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/BurnOutSharp/ExecutableType/Microsoft/PE/PortableExecutable.cs b/BurnOutSharp/ExecutableType/Microsoft/PE/PortableExecutable.cs index fc415ba7..8db4d59a 100644 --- a/BurnOutSharp/ExecutableType/Microsoft/PE/PortableExecutable.cs +++ b/BurnOutSharp/ExecutableType/Microsoft/PE/PortableExecutable.cs @@ -1,7 +1,6 @@ using System; using System.IO; using System.Linq; -using System.Text; using BurnOutSharp.ExecutableType.Microsoft.MZ.Headers; using BurnOutSharp.ExecutableType.Microsoft.PE.Headers; using BurnOutSharp.ExecutableType.Microsoft.PE.Sections; diff --git a/BurnOutSharp/PackerType/InnoSetup.cs b/BurnOutSharp/PackerType/InnoSetup.cs index fa534f7d..7b1784f8 100644 --- a/BurnOutSharp/PackerType/InnoSetup.cs +++ b/BurnOutSharp/PackerType/InnoSetup.cs @@ -69,6 +69,7 @@ namespace BurnOutSharp.PackerType return null; // Check for "Inno" in the reserved words + // TODO: Is this check needed for PE executables? The version check suggests otherwise if (stub.Reserved2[4] == 0x6E49 && stub.Reserved2[5] == 0x6F6E) { string version = GetOldVersion(file, pex.SourceArray); diff --git a/BurnOutSharp/PackerType/UPX.cs b/BurnOutSharp/PackerType/UPX.cs index 08f30b3f..91721589 100644 --- a/BurnOutSharp/PackerType/UPX.cs +++ b/BurnOutSharp/PackerType/UPX.cs @@ -15,6 +15,8 @@ namespace BurnOutSharp.PackerType if (sections == null) return null; + // TODO: Figure out how to more reasonably search before the sections + // Standard UPX int foundPosition = FindData(pex, "UPX"); if (foundPosition > -1) diff --git a/BurnOutSharp/ProtectionType/SecuROM.cs b/BurnOutSharp/ProtectionType/SecuROM.cs index a98a4899..11a7dbfc 100644 --- a/BurnOutSharp/ProtectionType/SecuROM.cs +++ b/BurnOutSharp/ProtectionType/SecuROM.cs @@ -28,6 +28,7 @@ namespace BurnOutSharp.ProtectionType return $"SecuROM {GetV7Version(pex.SourceArray)}"; // Search after the last section + // TODO: Figure out how to do this in a more reasonable way var lastSection = sections.LastOrDefault(); if (lastSection != null) { @@ -210,6 +211,7 @@ namespace BurnOutSharp.ProtectionType return $"{version}.{subVersion[0]}{subVersion[1]}.{subSubVersion[0]}{subSubVersion[1]}.{subSubSubVersion[0]}{subSubSubVersion[1]}{subSubSubVersion[2]}{subSubSubVersion[3]}"; } + // TODO: Figure out where this sits in an actual executable private static string GetV7Version(byte[] fileContent) { int index = 236;