mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
ptrace: Add PT_PEEK
PT_PEEK reads a single word from the tracee's address space and returns it to the tracer.
This commit is contained in:
parent
77f671b462
commit
984ff93406
Notes:
sideshowbarker
2024-07-19 07:39:23 +09:00
Author: https://github.com/itamar8910
Commit: 984ff93406
Pull-request: https://github.com/SerenityOS/serenity/pull/1745
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/awesomekling
4 changed files with 28 additions and 2 deletions
|
@ -108,9 +108,17 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
printf("hit breakpoint\n");
|
||||
PtraceRegisters regs;
|
||||
if (ptrace(PT_GETREGS, g_pid, ®s, 0) == -1) {
|
||||
perror("getregs");
|
||||
return 1;
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
printf("hit breakpoint\n");
|
||||
printf("eip:0x%x\n", regs.eip);
|
||||
|
||||
uint32_t data = ptrace(PT_PEEK, g_pid, (void*)regs.eip, 0);
|
||||
printf("data: 0x%x\n", data);
|
||||
|
||||
if (ptrace(PT_CONTINUE, g_pid, 0, 0) == -1) {
|
||||
perror("continue");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue