#include <process-trace.h>

Public Member Functions | |
| ProcessTrace () | |
| std::string | Attach (pid_t pid) |
| Attach to a running process. | |
| std::string | Detach () |
| Detach from the current process. | |
| std::string | Stop () |
| Stop the execution of the process. | |
| std::string | Continue () |
| Resume the execution of the process. | |
| std::string | SetChildMem (char *address, char *buf, size_t len) |
| Write to the process memory space. | |
| std::string | GetChildMem (char *address, char *buf, size_t len) |
| Read the process memory space. | |
| std::string | GetRegisters (struct user_regs_struct *regs) |
| Read the general process registers. | |
| std::string | SetRegisters (struct user_regs_struct *regs) |
| Modify the general process registers. | |
Protected Member Functions | |
| virtual bool | HandleSyscall (long int syscall_no, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, int &return_code) |
| Handle syscalls of a subprocess. | |
Uses ptrace to spy or modify of a subprocess.
Definition at line 9 of file process-trace.h.
| ProcessTrace::ProcessTrace | ( | ) |
Definition at line 12 of file process-trace.cpp.
| std::string ProcessTrace::Attach | ( | pid_t | pid | ) |
Attach to a running process.
| pid | of the process to attach to. |
Definition at line 182 of file process-trace.cpp.
| std::string ProcessTrace::Continue | ( | ) |
Resume the execution of the process.
Send a SIGCONT to the subprocess.
Definition at line 214 of file process-trace.cpp.
| std::string ProcessTrace::Detach | ( | ) |
Detach from the current process.
Definition at line 190 of file process-trace.cpp.
| std::string ProcessTrace::GetChildMem | ( | char * | address, | |
| char * | buf, | |||
| size_t | len | |||
| ) |
Read the process memory space.
| address | of the memory to read. | |
| buf | pointer to the buffer where to write data. | |
| len | length of the buffer. |
Definition at line 147 of file process-trace.cpp.
| std::string ProcessTrace::GetRegisters | ( | struct user_regs_struct * | regs | ) |
Read the general process registers.
| regs | pointer that will store the registers state. |
Definition at line 227 of file process-trace.cpp.
| virtual bool ProcessTrace::HandleSyscall | ( | long int | syscall_no, | |
| void * | arg1, | |||
| void * | arg2, | |||
| void * | arg3, | |||
| void * | arg4, | |||
| void * | arg5, | |||
| int & | return_code | |||
| ) | [inline, protected, virtual] |
Handle syscalls of a subprocess.
This method is called when the subprocess makes a syscall. It can be used to spy or override the syscall.
| syscall_no | syscall number. | |
| arg1 | argument passed to the syscall. | |
| arg2 | argument passed to the syscall. | |
| arg3 | argument passed to the syscall. | |
| arg4 | argument passed to the syscall. | |
| arg5 | argument passed to the syscall. | |
| return_code | is undefined when the method is called. This parameter is used to set the value returned by the overwritten syscall. |
Definition at line 33 of file process-trace.h.
| std::string ProcessTrace::SetChildMem | ( | char * | address, | |
| char * | buf, | |||
| size_t | len | |||
| ) |
Write to the process memory space.
| address | of the memory to write. | |
| buf | pointer to the buffer to write. | |
| len | length of the buffer to write. |
Definition at line 111 of file process-trace.cpp.
| std::string ProcessTrace::SetRegisters | ( | struct user_regs_struct * | regs | ) |
Modify the general process registers.
| regs | pointer to the registers state to set. |
Definition at line 234 of file process-trace.cpp.
| std::string ProcessTrace::Stop | ( | ) |
Stop the execution of the process.
Send a SIGSTOP to the subprocess.
Definition at line 200 of file process-trace.cpp.
1.5.8