Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hook a function for a particular shared ELF library?

LD_PRELOAD hooks some functions for the entire process, but I need to hook a particular function for only one dynamically linked library by its name.

like image 834
shoumikhin Avatar asked Jun 15 '10 13:06

shoumikhin


1 Answers

See the article Redirecting functions in shared ELF libraries. There's code of ELF hooking attached.

like image 166
shoumikhin Avatar answered Oct 12 '22 00:10

shoumikhin