From 2af0f166eb790ce4ac56618cd946db6817c5b8df Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 7 Dec 2022 23:56:38 -0800 Subject: [PATCH] Update WinRAR SFX with new framework --- BurnOutSharp/PackerType/WinRARSFX.cs | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/BurnOutSharp/PackerType/WinRARSFX.cs b/BurnOutSharp/PackerType/WinRARSFX.cs index ba8ecae7..5fb0045a 100644 --- a/BurnOutSharp/PackerType/WinRARSFX.cs +++ b/BurnOutSharp/PackerType/WinRARSFX.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; +using System.Linq; using BurnOutSharp.Interfaces; using BurnOutSharp.Matching; using BurnOutSharp.Tools; @@ -24,25 +25,13 @@ namespace BurnOutSharp.PackerType if (sections == null) return null; - // Get the .data/DATA section, if it exists - var dataSectionRaw = pex.GetFirstSectionData(".data") ?? pex.GetFirstSectionData("DATA"); - if (dataSectionRaw != null) - { - var matchers = new List - { - // Software\WinRAR SFX - new ContentMatchSet(new byte?[] - { - 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, - 0x5C, 0x57, 0x69, 0x6E, 0x52, 0x41, 0x52, 0x20, - 0x53, 0x46, 0x58 - }, "WinRAR SFX"), - }; + string name = pex.AssemblyDescription; + if (name?.Contains("WinRAR archiver") == true) + return "WinRAR SFX"; - string match = MatchUtil.GetFirstMatch(file, dataSectionRaw, matchers, includeDebug); - if (!string.IsNullOrWhiteSpace(match)) - return match; - } + var resources = pex.FindDialogByTitle("WinRAR self-extracting archive"); + if (resources.Any()) + return "WinRAR SFX"; return null; }