mardi 6 février 2018

c/c++: How to find out the own library name

I would like to intercept a dynamically loaded shared library libA.so. LD_PRELOAD does not work, because the libA.so is opened explicitly. Can a function of a shared library determine its library name? Then i could move some original libA.so to libA-org.so. And replace it with a new libA.so, that itself loads the libA-org.so and wraps it. Or is there some simpler/better approach?





Aucun commentaire:

Enregistrer un commentaire