You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
process_vm_readv, process_vm_writev should be available on android
process_vm_readv and process_vm_writev generally return -EPERM(-1) when used in android, however the syscalls work fine when running under privileged shell.
The following was tested(with modified nix) on Android 9/10 running Linux Kernel 4.9 on a SDM 845 phone:
```
fn read_mem_real(pid: i32, addr: usize, vsize: usize) -> Result<Vec<u8>, String> {
let mut res = vec![0; vsize];
let riovec: [RemoteIoVec; 1] = [RemoteIoVec {base: addr, len: vsize}];
match process_vm_readv(Pid::from_raw(pid), &[IoVec::from_mut_slice(&mut res)], &riovec) {
Err(e) => {
log::info!("ERR {}", e);
return Err(e.to_string());
},
Ok(_) => {
return Ok(res);
}
}
}
```
This will work fine when run under su shell.
0 commit comments