Browse Source

Make AntiMalwareEngine try to use the Win32 engine too

pull/72/head
Anairkoen Schno 3 years ago
parent
commit
6c9a842e03
Signed by: DaNike GPG Key ID: BEFB74D5F3FC4387
2 changed files with 5 additions and 0 deletions
  1. +1
    -0
      IPA.Loader/AntiMalware/AntiMalwareEngine.cs
  2. +4
    -0
      IPA.Loader/Loader/PluginLoader.cs

+ 1
- 0
IPA.Loader/AntiMalware/AntiMalwareEngine.cs View File

@ -25,6 +25,7 @@ namespace IPA.AntiMalware
#if !NET35
engine = WindowsCOMAntiMalware.TryInitialize();
#endif
engine ??= WindowsWin32AntiMalware.TryInitialize();
engine ??= new NoopAntiMalware();
return engine;


+ 4
- 0
IPA.Loader/Loader/PluginLoader.cs View File

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


Loading…
Cancel
Save