I want to write a little tracer function. I am using ptrace.
When I see a CALL statement, I want to show a function name equivalent to an address call.
My tracer works with characters with an absolute address (the character is defined in the main binary file). But I do not know how I can get the absolute address in the virtual memory of a shared library function. Define a libc function call, for example.
I noticed that the address of the function in the shared library refers to the file.
Is the following equation good?
Absolute address of symbol = address of the shared library in virtual memory +
relative address of the symbol.
How can I get the absolute address of a character from a shared library?
source
share