diff --git a/client/src/injection.rs b/client/src/injection.rs index 113d444..d150905 100644 --- a/client/src/injection.rs +++ b/client/src/injection.rs @@ -1,9 +1,5 @@ use { - core::ffi::c_void, - crate::driver::open_driver, - shared::structs::TargetInjection, - std::ptr::null_mut, - windows_sys::Win32::{Foundation::CloseHandle, System::IO::DeviceIoControl} + crate::{driver::open_driver, utils::check_file}, core::ffi::c_void, shared::structs::TargetInjection, std::ptr::null_mut, windows_sys::Win32::{Foundation::CloseHandle, System::IO::DeviceIoControl} }; pub fn injection_thread(ioctl_code: u32, pid: &u32, path: &String) { @@ -13,6 +9,12 @@ pub fn injection_thread(ioctl_code: u32, pid: &u32, path: &String) { path: path.to_string(), pid: *pid as usize }; + + if !check_file(path) { + eprintln!("File not found: {path}"); + return; + } + let mut return_buffer = 0; status = unsafe { DeviceIoControl( diff --git a/driver/.gitignore b/driver/.gitignore index 2b35a94..88c714b 100644 --- a/driver/.gitignore +++ b/driver/.gitignore @@ -1,3 +1,2 @@ /target -/src/backup -/src/memory \ No newline at end of file +/src/backup \ No newline at end of file