I have a requirement on changing certain symbols from shared library (.so) files like below example:
i need to rename symbol abc
in .so file to symbol xyz
. I have a tool to replace it in header files, only challenge i am facing for changing in my .so shared libraries.
For shared libraries, are there any tools or commands which can help me to disassemble .so files, update the symbols and reassemble again to .so files?
For shared libraries, we need a mechanism to reconstruct symbol tables. Need help if any tools exists to do my task?
FYI: changing source is the best approach, but for short-term looking at solution which can help to replace code words at symbols level.
.so
file is very hard (e.g. you'll need to rebuild symtab hashtables). A much easier option is to redefinexyz
in a small helper library and callabc
inside of it. – Alurd.global xyz; .extern abc; xyz: jmp abc
and can be generated automatically via script. – Alurd