mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Make Windows defender lookup dynamic
This commit is contained in:
parent
c225906277
commit
614682de03
@ -1,4 +1,5 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Org.BouncyCastle.Bcpg;
|
||||
@ -18,6 +19,16 @@ namespace Wabbajack.Lib
|
||||
Malware = 2
|
||||
}
|
||||
|
||||
private static AbsolutePath ScannerPath()
|
||||
{
|
||||
return ((AbsolutePath)@"C:\ProgramData\Microsoft\Windows Defender\Platform")
|
||||
.EnumerateDirectories(recursive:false)
|
||||
.OrderByDescending(f => f.FileName)
|
||||
.First()
|
||||
.EnumerateFiles(recursive:true)
|
||||
.First(f => f.FileName == (RelativePath)"MpCmdRun.exe");
|
||||
}
|
||||
|
||||
public static async Task<(Hash, Result)> ScanStream(Stream stream)
|
||||
{
|
||||
var ms = new MemoryStream();
|
||||
@ -43,8 +54,7 @@ namespace Wabbajack.Lib
|
||||
|
||||
var process = new ProcessHelper
|
||||
{
|
||||
Path =
|
||||
(AbsolutePath)@"C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.2006.10-0\X86\MpCmdRun.exe",
|
||||
Path = ScannerPath(),
|
||||
Arguments = new object[] {"-Scan", "-ScanType", "3", "-DisableRemediation", "-File", file.Path},
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user