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 00364df commit a603a5dCopy full SHA for a603a5d
src/sys/ptrace.rs
@@ -205,3 +205,18 @@ pub fn traceme() -> Result<()> {
205
ptr::null_mut(),
206
).map(|_| ()) // ignore the useless return value
207
}
208
+
209
+/// Makes the `PTRACE_PEEKDATA` request to ptrace
210
+pub fn peekdata(pid: Pid, addr: c_long) -> Result<c_long> {
211
+ ptrace(ptrace::PTRACE_PEEKDATA, pid, addr as *mut c_void, ptr::null_mut())
212
+}
213
214
215
+pub fn pokedata(pid: Pid, addr: c_long, val: c_long) -> Result<()> {
216
+ ptrace(
217
+ ptrace::PTRACE_POKEDATA,
218
+ pid,
219
+ addr as *mut c_void,
220
+ val as *mut c_void,
221
+ ).map(|_| ()) // ignore the useless return value
222
0 commit comments