mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-09 02:16:46 +00:00
Fix bad LaserLok check
This commit is contained in:
@@ -5,7 +5,6 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using BurnOutSharp.Interfaces;
|
||||
using BurnOutSharp.Matching;
|
||||
using BurnOutSharp.Tools;
|
||||
using BurnOutSharp.Wrappers;
|
||||
|
||||
namespace BurnOutSharp.ProtectionType
|
||||
@@ -93,6 +92,12 @@ namespace BurnOutSharp.ProtectionType
|
||||
};
|
||||
containsCheck2 = pex.GetFirstSectionData(".text").FirstPosition(check2, out position2);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise, we reset the containsCheck2 value
|
||||
containsCheck2 = false;
|
||||
|
||||
}
|
||||
|
||||
if (containsCheck && containsCheck2)
|
||||
return $"LaserLok {GetVersion(pex.GetFirstSectionData(".text"), position2)} {GetBuild(pex.GetFirstSectionData(".text"), true)} [Check disc for physical ring]" + (includeDebug ? $" (Index {position}, {position2})" : string.Empty);
|
||||
@@ -184,6 +189,10 @@ namespace BurnOutSharp.ProtectionType
|
||||
|
||||
private static string GetVersion(byte[] sectionContent, int position)
|
||||
{
|
||||
// If we have invalid data
|
||||
if (sectionContent == null)
|
||||
return null;
|
||||
|
||||
return new string(new ArraySegment<byte>(sectionContent, position + 76, 4).Select(b => (char)b).ToArray());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user