I want to create a simple tool (with C) which can do this tiny subset of gdb
s features:
- Attach to an already running program (with PID)
- Inject instructions into it like this:
dup2(open("/tmp/my_stdout", 1089, 0777), 1)
GDB can do this without issues, but it has a massive source.
What Im looking for is some kind of starting point of guidance.
There are tons of information on Google but all of them are 10ish years old, and I need to make this work on aarch64 arch which was not existed by that time.
Really, any help is greatly appreciated.
I tried to strace gdb while it is attaching to a process, but my terminal blowed up literally.