Hello,
I'm trying to attach DynamoRIO to a running program, could you please give me some help?
I implemented a tool to detect memory access based on DynamoRIO, and successfully run with the following command:
drrun -t my_tool -- program_name
But now, I have to apply this tool to a running program.I need to attach and detach my tools to the target program while it is running. I cannot modify the target program's source code. Is there any way to attach my tool to it?
I found 3 ways but they all have some problems:
1. run it with: drrun -attach program_pid,but I get: ERROR: attaching to running processes is not yet implemented
2. Internally-triggered attach through dr_app_start():but according to my understanding, this method needs to modify the source code of the target program
3. ptrace: I found some information related to ptrace. I am not sure if this function is complete now. If it has been implemented, could you please give me some guidance on how to use ptrace?
Is there any other way I missed?
Thanks for your help !
Best regards,
Bess Lin