Skip to content

Commit

Permalink
Merge pull request #6 from thepapanoob/main
Browse files Browse the repository at this point in the history
Added PROCESS_VM_OPERATION to OpenProcess
  • Loading branch information
ko1N authored Sep 25, 2024
2 parents ebc9a25 + f387c9b commit 0a172c1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/windows/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use super::{conv_err, Handle};
use windows::core::HRESULT;
use windows::Win32::System::Diagnostics::Debug::{ReadProcessMemory, WriteProcessMemory};
use windows::Win32::System::Threading::{
OpenProcess, PROCESS_QUERY_INFORMATION, PROCESS_VM_READ, PROCESS_VM_WRITE,
OpenProcess, PROCESS_QUERY_INFORMATION, PROCESS_VM_OPERATION, PROCESS_VM_READ, PROCESS_VM_WRITE,
};

#[derive(Clone)]
Expand All @@ -21,7 +21,10 @@ impl ProcessVirtualMemory {
pub fn try_new(info: &ProcessInfo) -> Result<Self> {
let handle: Arc<Handle> = unsafe {
OpenProcess(
PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_QUERY_INFORMATION,
PROCESS_VM_READ
| PROCESS_VM_WRITE
| PROCESS_VM_OPERATION
| PROCESS_QUERY_INFORMATION,
false,
info.pid as _,
)
Expand Down

0 comments on commit 0a172c1

Please sign in to comment.