Skip to content

Commit 17f8e18

Browse files
TheEZIC486c
authored andcommitted
fix: windows negative address reading
1 parent 999b77e commit 17f8e18

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/memory/windows.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::ffi::c_void;
1+
use std::ffi::{c_uint, c_void};
22
use std::path::PathBuf;
33

44
use windows::Win32::Foundation::HMODULE;
@@ -121,7 +121,7 @@ impl ProcessTraits for Process {
121121

122122
let res = unsafe { ReadProcessMemory(
123123
self.handle,
124-
region.from as *mut c_void,
124+
region.from as c_uint as *mut c_void,
125125
buf.as_mut_ptr() as *mut c_void,
126126
region.size,
127127
Some(&mut bytesread)
@@ -156,7 +156,7 @@ impl ProcessTraits for Process {
156156

157157
let res = unsafe { ReadProcessMemory(
158158
self.handle as HANDLE,
159-
addr as *mut c_void,
159+
addr as c_uint as *mut c_void,
160160
buff.as_mut_ptr() as *mut c_void,
161161
len,
162162
Some(&mut n)

0 commit comments

Comments
 (0)