We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7b9e39 commit f894e01Copy full SHA for f894e01
src/sys/ptrace.rs
@@ -204,3 +204,18 @@ pub fn traceme() -> Result<()> {
204
ptr::null_mut(),
205
).map(|_| ()) // ignore the useless return value
206
}
207
+
208
+/// Makes the `PTRACE_PEEKDATA` request to ptrace
209
+pub fn peekdata(pid: Pid, addr: c_long) -> Result<c_long> {
210
+ ptrace(ptrace::PTRACE_PEEKDATA, pid, addr as *mut c_void, ptr::null_mut())
211
+}
212
213
214
+pub fn pokedata(pid: Pid, addr: c_long, val: c_long) -> Result<()> {
215
+ ptrace(
216
+ ptrace::PTRACE_POKEDATA,
217
+ pid,
218
+ addr as *mut c_void,
219
+ val as *mut c_void,
220
+ ).map(|_| ()) // ignore the useless return value
221
0 commit comments