diff --git a/UEVR/MainWindow.xaml.cs b/UEVR/MainWindow.xaml.cs index b8edd14..9791241 100644 --- a/UEVR/MainWindow.xaml.cs +++ b/UEVR/MainWindow.xaml.cs @@ -177,6 +177,8 @@ public partial class MainWindow : Window { [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern void SwitchToThisWindow(IntPtr hWnd, bool fAltTab); + private string excludedProcessesFile = "excluded.txt"; + public MainWindow() { InitializeComponent(); @@ -1068,6 +1070,7 @@ private string GenerateProcessName(Process p) { private static extern bool IsWow64Process([In] IntPtr hProcess, [Out] out bool wow64Process); private bool IsInjectableProcess(Process process) { + try { if (Environment.Is64BitOperatingSystem) { try { @@ -1104,6 +1107,21 @@ private bool IsInjectableProcess(Process process) { } } + // Check if the excluded processes file exists + if (File.Exists(excludedProcessesFile)) { + + List excludedProcesses = new List(); + + // Read excluded process names from the text file + excludedProcesses = File.ReadAllLines(excludedProcessesFile).ToList(); + + // Check if the process name is in the excluded list + if (excludedProcesses.Contains(process.ProcessName)) { + return false; + } + + } + return false; } catch(Exception ex) { Console.WriteLine(ex.ToString()); @@ -1187,4 +1205,4 @@ await Task.Run(() => { } } } -} \ No newline at end of file +}