read_addr

Function read_addr 

Source
pub fn read_addr(pid: Pid, addr: usize, length: usize) -> Result<Vec<u8>, Error>
Expand description

read_addr is used to read n bytes from a process pid and starting from addr

§Note

the function will return Result<T,E>

Error examples:

  • EPERM: make sure running as sudo
  • ESRCH: make sure the process exist
  • ESFAULT: make sure the address exist in the scope of the process

§Backend

this function invokes the process_vm_readv syscall, enabling direct memory reading from a specified address in the target process.