Closed shay-V closed 11 months ago
It doesn't. It returns an Option<T>
, where T
is the type you're trying to read.
libmem C binding:
pub(super) fn LM_ReadMemoryEx(
pproc: *const lm_process_t,
src: lm_address_t,
dst: *mut lm_byte_t,
size: lm_size_t,
) -> lm_size_t;
Rust API:
pub fn LM_ReadMemoryEx<T>(pproc: &lm_process_t, src: lm_address_t) -> Option<T>
The size of the read would be the size of T
.
If it fails, it returns None
instead of Some(val)
@shay11111111111111111111
If you're talking about the actual Windows function, yes, it does return a boolean. But, the last parameter of ReadProcessMemory
is a pointer to a variable that will store the size of the read operation:
BOOL ReadProcessMemory(
[in] HANDLE hProcess,
[in] LPCVOID lpBaseAddress,
[out] LPVOID lpBuffer,
[in] SIZE_T nSize,
[out] SIZE_T *lpNumberOfBytesRead
);
ReadProcessMemory returns a Boolean value