Add comments around remaining SourceArray usages

This commit is contained in:
Matt Nadareski
2022-03-14 23:32:19 -07:00
parent 133e29dc2e
commit dc252e8d86
4 changed files with 5 additions and 1 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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)

View File

@@ -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;