Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

capability of ignoring unwanted processes in injection list #15

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion UEVR/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -1068,6 +1070,20 @@ private string GenerateProcessName(Process p) {
private static extern bool IsWow64Process([In] IntPtr hProcess, [Out] out bool wow64Process);

private bool IsInjectableProcess(Process process) {

List<string> excludedProcesses = new List<string>();

// Check if the excluded processes file exists
if (File.Exists(excludedProcessesFile)) {
// 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;
}

praydog marked this conversation as resolved.
Show resolved Hide resolved
try {
if (Environment.Is64BitOperatingSystem) {
try {
Expand Down Expand Up @@ -1187,4 +1203,4 @@ await Task.Run(() => {
}
}
}
}
}