From 6c9a842e0391e15206e17d4422780008c6e98f37 Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Tue, 6 Apr 2021 21:27:01 -0500 Subject: [PATCH] Make AntiMalwareEngine try to use the Win32 engine too --- IPA.Loader/AntiMalware/AntiMalwareEngine.cs | 1 + IPA.Loader/Loader/PluginLoader.cs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/IPA.Loader/AntiMalware/AntiMalwareEngine.cs b/IPA.Loader/AntiMalware/AntiMalwareEngine.cs index fcf9484d..ada9d18d 100644 --- a/IPA.Loader/AntiMalware/AntiMalwareEngine.cs +++ b/IPA.Loader/AntiMalware/AntiMalwareEngine.cs @@ -25,6 +25,7 @@ namespace IPA.AntiMalware #if !NET35 engine = WindowsCOMAntiMalware.TryInitialize(); #endif + engine ??= WindowsWin32AntiMalware.TryInitialize(); engine ??= new NoopAntiMalware(); return engine; diff --git a/IPA.Loader/Loader/PluginLoader.cs b/IPA.Loader/Loader/PluginLoader.cs index feb72462..1dad5c15 100644 --- a/IPA.Loader/Loader/PluginLoader.cs +++ b/IPA.Loader/Loader/PluginLoader.cs @@ -17,6 +17,7 @@ using SemVer; using System.Diagnostics.CodeAnalysis; using HarmonyLib; using System.Diagnostics; +using IPA.AntiMalware; #if NET4 using Task = System.Threading.Tasks.Task; using TaskEx = System.Threading.Tasks.Task; @@ -141,6 +142,9 @@ namespace IPA.Loader try { + Logger.loader.Debug($"Scanning {plugin}"); + AntiMalwareEngine.Engine.ScanFile(new FileInfo(plugin)); + var pluginModule = AssemblyDefinition.ReadAssembly(plugin, new ReaderParameters { ReadingMode = ReadingMode.Immediate,